Skip to Content

List threads across your mailboxes

Lists only threads in mailboxes the caller can read.

GET
/v1/mailboxes/threads

Lists only threads in mailboxes the caller can read. With q, semantic and keyword search returns the best-matching threads in relevance order, capped across cursor pages. Without q, threads use newest activity first. Repeat mailboxId to narrow the scope; kind selects personal or shared mailboxes. conversation selects the threads of one conversation (the conversationId a thread reports), one per readable mailbox it reached. state=active excludes the caller's Done and shared closed threads; state=done selects the caller's Done plus closed shared threads, without duplicates. Other filters and cursor pagination match the per-mailbox list.

Authorization

apiKey
headerx-api-key<token>

Query Parameters

limit?|null
cursor?string
after?string
before?string
q?string

Search 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
Value in"active""done"
folder?string
Value in"inbox""assigned""pending""sent""archived""trash"
label?string
Match^label_[0-9a-hjkmnp-tv-z]{16,24}$
unread?boolean|null
starred?boolean|null
snoozed?boolean|null
mailboxId?|array<>
kind?string
Value in"personal""shared"
conversation?string
Match^conv_[0-9a-hjkmnp-tv-z]{16,24}$

Response Body

OrganizationMailboxThreadPage

application/json
  1. response
items*array<>
nextCursor*string|null
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.mailboxes.listOrganizationThreads({});
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",
      "mailbox": {
        "id": "string",
        "address": "string",
        "kind": "personal"
      }
    }
  ],
  "nextCursor": "string"
}

Related documentation