List threads in a mailbox
Returns thread summaries. With `q`, semantic and keyword search returns up to 100 best-matching threads in relevance order across cursor pages.
Returns thread summaries. With q, semantic and keyword search returns up to 100 best-matching threads in relevance order across cursor pages. It searches subjects, participants, message text including quoted history, and attachment filenames, not attachment contents. New mail can take a few seconds to become searchable. Other filters narrow the searchable set. Without q, threads use most recent activity first; after and before filter by last activity for polling. Pass nextCursor back as cursor for the next page; it is null on the last page. In a list without q, a thread that gains activity while you page moves ahead of the cursor, so a walk lists each thread at most once.
apiKeyx-api-key<token>id*string^mbx_[0-9a-hjkmnp-tv-z]{16,24}$limit?|nullcursor?stringafter?stringbefore?stringq?stringSearch subjects, participants, message text, and attachment filenames by semantic and keyword relevance. Filters narrow the search. Returns up to 100 best-matching threads across cursor pages; omit q to list by recent activity. New mail can take a few seconds to become searchable. Attachment contents are not searched.
state?string"active""done"folder?string"inbox""assigned""pending""sent""archived""trash"label?string^label_[0-9a-hjkmnp-tv-z]{16,24}$unread?boolean|nullstarred?boolean|nullsnoozed?boolean|nullMailboxThreadPage
application/json- response
items*array<>nextCursor*string|nullimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.mailboxes.listThreads({
"id": "example"
});{
"items": [
{
"id": "string",
"channel": "sms",
"endpointId": "string",
"subject": "string",
"preview": "string",
"from": {
"address": "string",
"displayName": "string"
},
"messageCount": 0,
"hasAttachments": true,
"hasDraft": true,
"folder": "inbox",
"priority": "low",
"labels": [
"string"
],
"read": true,
"starred": true,
"snoozedUntil": "string",
"doneAt": "string",
"closedAt": "string",
"closedBy": {
"kind": "user",
"id": "string",
"displayName": "string"
},
"lastActivityAt": "string"
}
],
"nextCursor": "string"
}