GET
/api/public/v1/email-threads/{threadId}

Get an email thread

A whole back-and-forth, oldest first, each message with its body in words. `lastDirection` says who spoke last — INBOUND means the other party is waiting on a reply. What comes back is the token employee’s own copies of the thread: their company’s, in one of their mailboxes.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

email:messages:read

Path Parameters

NameTypeRequiredDescription
threadIdstringRequiredThread ID — the `threadId` on any message in it.

Query Parameters

NameTypeRequiredDescription
includeHtmlbooleanOptionalAlso return the HTML body as it arrived. Off by default — the text is the message.
includeHeadersbooleanOptionalAlso return the raw headers the provider passed along.
GETExample request
curl
curl -X GET "https://www.pxb.app/api/public/v1/email-threads/{threadId}" \
  -H "Authorization: Bearer your_access_token"
200Example response
json
{
  "message": "Email thread retrieved successfully!",
  "content": {
    "thread": {
      "id": "eml_3390",
      "subject": "Invoice 1042",
      "participants": [
        "sam@acme.example",
        "ap@northwind.example"
      ],
      "messageCount": 2,
      "unreadCount": 1,
      "startedAt": "2026-08-22T15:04:00.000Z",
      "lastMessageAt": "2026-08-23T09:12:00.000Z",
      "lastDirection": "INBOUND",
      "messages": [
        {
          "id": "eml_3390",
          "threadId": "eml_3390",
          "from": "sam@acme.example",
          "to": "ap@northwind.example",
          "cc": null,
          "subject": "Invoice 1042",
          "snippet": "Attached is the invoice for phase one. Let me know if purchasing needs anything else.",
          "direction": "OUTBOUND",
          "unread": false,
          "starred": false,
          "folder": null,
          "accountId": "acc_7712",
          "hasAttachments": true,
          "attachments": [
            {
              "id": "eat_19",
              "fileName": "invoice-1042.pdf",
              "contentType": "application/pdf",
              "fileSize": 84210
            }
          ],
          "receivedAt": "2026-08-22T15:04:00.000Z",
          "createdAt": "2026-08-22T15:04:00.000Z",
          "updatedAt": "2026-08-22T15:04:00.000Z",
          "text": "Attached is the invoice for phase one. Let me know if purchasing needs anything else."
        },
        {
          "id": "eml_3391",
          "threadId": "eml_3390",
          "from": "ap@northwind.example",
          "to": "sam@acme.example",
          "cc": null,
          "subject": "Re: Invoice 1042",
          "snippet": "Received, thanks — this will go out in Friday’s run.",
          "direction": "INBOUND",
          "unread": true,
          "starred": false,
          "folder": null,
          "accountId": "acc_7712",
          "hasAttachments": false,
          "attachments": [],
          "receivedAt": "2026-08-23T09:12:00.000Z",
          "createdAt": "2026-08-23T09:12:00.000Z",
          "updatedAt": "2026-08-23T09:12:00.000Z",
          "text": "Received, thanks — this will go out in Friday’s run."
        }
      ]
    }
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Email
/email/inbox
  1. Open a conversation from the list.