Skip to Content

Read a mailbox thread

Read a mailbox thread. Request: GET /v1/mailboxes/{id}/threads/{threadId}/content. Scope: mailboxes:read.

GET
/v1/mailboxes/{id}/threads/{threadId}/content

Returns the thread's messages with their text, sanitized HTML, replyText (what each sender wrote, without quoted history), authentication verdicts, and attachments, oldest first. Pass nextCursor back as cursor for the next page; it is null on the last page.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^mbx_[0-9a-hjkmnp-tv-z]{16,24}$
threadId*string
Match^thread_[0-9a-hjkmnp-tv-z]{16,24}$

Query Parameters

limit?|null
cursor?string

Response Body

MailboxThreadContentPage

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.getThreadContent({
  "id": "example",
  "threadId": "example"
});
Example Response
{
  "items": [
    {
      "id": "string",
      "campaign": {
        "campaignId": "string",
        "runId": "string"
      },
      "threadId": "string",
      "conversationId": "string",
      "direction": "inbound",
      "from": {
        "actor": {
          "kind": "user",
          "id": "string",
          "displayName": "string"
        },
        "displayName": "string",
        "address": "string"
      },
      "sentBy": {
        "kind": "user",
        "id": "string",
        "displayName": "string"
      },
      "occurredAt": "string",
      "channel": "email",
      "recipients": [
        {
          "kind": "to",
          "actor": {
            "kind": "user",
            "id": "string",
            "displayName": "string"
          },
          "displayName": "string",
          "address": "string"
        }
      ],
      "replyTo": [
        "string"
      ],
      "subject": "string",
      "text": "string",
      "html": "string",
      "replyText": "string",
      "headers": {
        "messageId": "string",
        "inReplyTo": "string",
        "references": [
          "string"
        ]
      },
      "authentication": {
        "spf": "string",
        "dkim": "string",
        "dmarc": "string"
      },
      "attachments": [
        {
          "id": "string",
          "filename": "string",
          "contentType": "string",
          "size": 0,
          "isInline": true
        }
      ]
    }
  ],
  "nextCursor": "string"
}

Related documentation