From d2fde9163c67cc4cc3ee650f4a43bc9b5a62678f Mon Sep 17 00:00:00 2001 From: Jennifer Hasegawa <5481259+jhaaaa@users.noreply.github.com> Date: Mon, 28 Jul 2025 10:02:47 -0700 Subject: [PATCH] first pass --- docs/pages/inboxes/sync-and-syncall.mdx | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/pages/inboxes/sync-and-syncall.mdx b/docs/pages/inboxes/sync-and-syncall.mdx index 1bdac808..0726675b 100644 --- a/docs/pages/inboxes/sync-and-syncall.mdx +++ b/docs/pages/inboxes/sync-and-syncall.mdx @@ -100,4 +100,32 @@ client.conversations.syncAllConversations(consentState = listOf(ConsentState.ALL try await client.conversations.syncAllConversations(consentState: [.allowed]) ``` +::: + +### Sync a limited number of messages per conversation + +To protect from spam, you can sync just the first few messages of new conversations. For example, you can sync all conversations with an `unknown` consent state, but limit it to the first 5 messages per conversation. + +:::code-group + +```js [Browser] +await client.conversations.syncAll({ consentState: ["unknown"], numMessages: 5 }); +``` + +```js [Node] +await client.conversations.syncAll({ consentState: ["unknown"], numMessages: 5 }); +``` + +```tsx [React Native] +await client.conversations.syncAllConversations({ consentState: ["unknown"], numMessages: 5 }); +``` + +```kotlin [Kotlin] +client.conversations.syncAllConversations(consentState = listOf(ConsentState.UNKNOWN), numMessages = 5) +``` + +```swift [Swift] +try await client.conversations.syncAllConversations(consentState: [.unknown], numMessages: 5) +``` + ::: \ No newline at end of file