Mail API reference

Mail API · Threads

get/v1/workspaces/{workspace_id}/threads/{id}Auth

Retrieve a conversation

One conversation of a mailbox with every message in it, oldest first: received messages (`direction: inbound`, body at `GET /received/{id}/raw`) and mail sent from the mailbox (`direction: outbound`, `GET /emails/{id}`). Messages join a thread by their `In-Reply-To` / `References` headers, else by subject and sender within 14 days. `snippet` needs `mail.message.body.read`.

Path parameters

workspace_id*string · uuid

Id of the workspace.

id*string · uuid

Thread id (`thread_id` on `email.received` and on sends from a mailbox).

Response · 200

id*string · uuid

Thread id.

mailbox_id*string · uuid

The mailbox the conversation belongs to.

subject*string

Subject of the first message.

status*object

New mail on an `archived` thread moves it back to `open`.

assignee_account_id*string · uuid

Workspace member it is assigned to.

message_count*number

Received messages plus sent emails.

unread_count*number

Received messages not yet read.

has_attachments*boolean

Any message in it has files.

participants*array

Everyone who wrote or was written to, the mailbox itself excluded.

last_message_at*string · date-time

When the newest message, received or sent, arrived or went out.

last_inbound_at*string · date-time

When the newest received message arrived; null for a conversation with sent mail only.

created_at*string · date-time

When the conversation started.

messages*array

Every message, oldest first.

Example

Request

GET https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/threads/{id}
Authorization: Bearer YOUR_TOKEN

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "mailbox_id": "00000000-0000-0000-0000-000000000000",
  "subject": "string",
  "status": {},
  "assignee_account_id": "00000000-0000-0000-0000-000000000000",
  "message_count": 0,
  "unread_count": 0,
  "has_attachments": false,
  "participants": [
    "string"
  ],
  "last_message_at": "2026-01-01T00:00:00.000Z",
  "last_inbound_at": "2026-01-01T00:00:00.000Z",
  "created_at": "2026-01-01T00:00:00.000Z",
  "messages": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "direction": {},
      "from": "alice@example.com",
      "to": [
        "string"
      ],
      "cc": [
        "string"
      ],
      "subject": "string",
      "snippet": "string",
      "message_id_header": "<0110019a@eu-north-1.amazonses.com>",
      "date": "2026-01-01T00:00:00.000Z",
      "read": false,
      "attachment_count": 0,
      "status": "sent"
    }
  ]
}