For the complete documentation index, see llms.txt. This page is also available as Markdown.

Threads

Group related messages into conversations

A thread groups the inbound and sent messages that belong to the same conversation. Use these endpoints to page through an inbox's threads, fetch a single thread with its messages embedded, or delete a thread.

List threads

get

Returns the inbox's conversation threads, ordered by most recent activity first.

Only threads and messages within your plan's retention window are included; the per-thread aggregates (message count, size, senders, recipients, attachments) are computed over those accessible messages.

Results use cursor pagination. When more results are available the response includes a last_id; pass it back as the last_id query parameter to get the next page. When last_id is null you have reached the end.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
inbox_idintegerRequired

Inbound inbox ID

Example: 1
Query parameters
last_idstringOptional

Cursor from the previous response's last_id. Omit on the first request.

Example: eyJsYXN0X2FjdGl2aXR5X2F0IjoxNzQ2NzAwMjAwMDAwLCJpZCI6IjE3MDAwMDAwMDAwMDAxMjMifQ
Responses
200

List of threads

application/json
total_countintegerRequired

Total number of threads matching the query.

Example: 1
last_idstring · nullableRequired

Cursor for the next page. null when there are no more results.

get/api/inbound/inboxes/{inbox_id}/threads

Get a thread

get

Returns a single thread with its messages embedded, ordered oldest first.

Each message carries a visibility_status:

  • available — the message is within your plan's retention window. The full envelope, subject, RFC headers, decoded bodies, and attachment download URLs are included; sent messages also carry their delivery lifecycle (delivery_status, delivered_at, bounced_at).

  • placeholder — the message is outside the retention window. Only visibility_status and direction are returned; every other field is omitted and no attachment download URLs are issued.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
inbox_idintegerRequired

Inbound inbox ID

Example: 1
idstringRequired

Inbound thread ID

Example: 1700000000000123
Responses
200

Thread details

application/json

Summary of a thread. All aggregates are computed over the messages you can still access (those within the plan's retention window).

idstringOptionalExample: 1700000000000123
subjectstring · nullableOptional

Subject of the thread's root message.

Example: Support request
message_countintegerOptional

Number of accessible messages in the thread. Messages sent together (reply-all fan-out) count once.

Example: 3
sizeintegerOptional

Combined size of the accessible messages, in bytes.

Example: 24576
first_message_atstring · date-timeOptionalExample: 2026-05-08T10:30:00.000Z
last_received_atstring · nullableOptional

When the most recent inbound message arrived, if any.

Example: 2026-05-08T12:05:00.000Z
last_sent_atstring · nullableOptional

When the most recent message was sent, if any.

Example: 2026-05-08T11:40:00.000Z
last_activity_atstring · date-timeOptional

Timestamp of the most recent message in either direction.

Example: 2026-05-08T12:05:00.000Z
last_message_idstring · nullableOptional

ID of the most recent accessible message in the thread.

Example: 1700000000000789
sendersstring[]Optional

Distinct from addresses across the accessible messages.

Example: ["customer@example.com","support-tickets-1a2b3c4d@inbound-mailtrap.io"]
recipientsstring[]Optional

Distinct to/cc/bcc addresses across the accessible messages.

Example: ["support-tickets-1a2b3c4d@inbound-mailtrap.io","customer@example.com"]
get/api/inbound/inboxes/{inbox_id}/threads/{id}

Delete a thread

delete

Delete a thread. Inbound messages in the thread are removed; sent messages are preserved.

Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
inbox_idintegerRequired

Inbound inbox ID

Example: 1
idstringRequired

Inbound thread ID

Example: 1700000000000123
Responses
204

Thread deleted

No content

delete/api/inbound/inboxes/{inbox_id}/threads/{id}

No content

Last updated

Was this helpful?