Mailboxes
List threads in a mailbox
Returns thread summaries, most recent activity first.
GET
Returns thread summaries, most recent activity first. after and before filter by last activity, so an agent polling for new mail passes the last time it looked. q is a full-text search over subjects, senders, and message text; folder, label, unread, and starred narrow the list. Pass nextCursor back as cursor for the next page; it is null on the last page. A thread that gains activity while you page moves ahead of the cursor, so a walk lists each thread at most once.
apiKeyheader
x-api-key<token>id*stringMatch
^mbx_[0-9a-hjkmnp-tv-z]{16,24}$limit?|nullcursor?stringafter?stringbefore?stringq?stringstate?stringValue in
"active""done"folder?stringValue in
"inbox""assigned""pending""sent""archived""trash"label?stringMatch
^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"});Example Response
{ "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"}