Threads API

List conversation threads and retrieve thread details with messages.

GET /v1/mailboxes/:id/threads

GET/v1/mailboxes/:id/threads

List threads for a mailbox, sorted by most recent message. Returns the last 50 threads.

response — 200 OK
{
  "threads": [
    {
      "id": "thr_abc123",
      "mailboxId": "mbx_abc123",
      "subject": "Project update",
      "messageCount": 3,
      "lastMessageAt": "2026-03-11T14:00:00.000Z",
      "participants": ["[email protected]", "[email protected]"],
      "createdAt": "2026-03-11T12:00:00.000Z"
    }
  ]
}

GET /v1/mailboxes/:id/threads/:threadId

GET/v1/mailboxes/:id/threads/:threadId

Get a thread with all its messages, ordered chronologically (oldest first).

response — 200 OK
{
  "thread": {
    "id": "thr_abc123",
    "subject": "Project update",
    "messageCount": 3,
    "participants": ["[email protected]", "[email protected]"],
    "messages": [
      {
        "id": "msg_001",
        "direction": "OUTBOUND",
        "subject": "Project update",
        "bodyText": "Here is the latest...",
        "status": "DELIVERED",
        "createdAt": "2026-03-11T12:00:00.000Z"
      },
      {
        "id": "msg_002",
        "direction": "INBOUND",
        "subject": "Re: Project update",
        "bodyText": "Thanks for the update...",
        "status": "RECEIVED",
        "createdAt": "2026-03-11T13:00:00.000Z"
      }
    ]
  }
}

See Threading for how messages are grouped into threads.