Get a thread
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. Onlyvisibility_statusanddirectionare returned; every other field is omitted and no attachment download URLs are issued.
API token in Api-Token header
Inbound inbox ID
1Inbound thread ID
1700000000000123Thread details
Summary of a thread. All aggregates are computed over the messages you can still access (those within the plan's retention window).
1700000000000123Subject of the thread's root message.
Support requestNumber of accessible messages in the thread. Messages sent together (reply-all fan-out) count once.
3Combined size of the accessible messages, in bytes.
245762026-05-08T10:30:00.000ZWhen the most recent inbound message arrived, if any.
2026-05-08T12:05:00.000ZWhen the most recent message was sent, if any.
2026-05-08T11:40:00.000ZTimestamp of the most recent message in either direction.
2026-05-08T12:05:00.000ZID of the most recent accessible message in the thread.
1700000000000789Distinct from addresses across the accessible messages.
["customer@example.com","support-tickets-1a2b3c4d@inbound-mailtrap.io"]Distinct to/cc/bcc addresses across the accessible messages.
["support-tickets-1a2b3c4d@inbound-mailtrap.io","customer@example.com"]Unauthorized
Forbidden
Not found
curl -X GET https://mailtrap.io/api/inbound/inboxes/{inbox_id}/threads/{id} \
-H 'Authorization: Bearer YOUR_API_KEY'
{
"id": "1700000000000123",
"subject": "Support request",
"message_count": 3,
"size": 24576,
"first_message_at": "2026-05-08T10:30:00.000Z",
"last_received_at": "2026-05-08T12:05:00.000Z",
"last_sent_at": "2026-05-08T11:40:00.000Z",
"last_activity_at": "2026-05-08T12:05:00.000Z",
"last_message_id": "1700000000000789",
"senders": [
"customer@example.com",
"support-tickets-1a2b3c4d@inbound-mailtrap.io"
],
"recipients": [
"support-tickets-1a2b3c4d@inbound-mailtrap.io",
"customer@example.com"
],
"attachments": [
{
"attachment_id": "att-1",
"filename": "invoice.pdf",
"size": 20480,
"content_type": "application/pdf",
"content_disposition": "attachment",
"content_id": null,
"download_url": "https://s3.amazonaws.com/inbound-mail/att-1?X-Amz-Signature=...",
"download_url_expires_at": "2026-05-08T13:05:00.000Z"
}
],
"messages": [
{
"visibility_status": "available",
"direction": "inbound",
"id": "1700000000000123",
"subject": "Support request",
"rfc_message_id": "<abc@customer.example>",
"in_reply_to": null,
"references": [],
"from": "customer@example.com",
"to": [
"support-tickets-1a2b3c4d@inbound-mailtrap.io"
],
"cc": [],
"bcc": [],
"reply_to": null,
"created_at": "2026-05-08T10:30:00.000Z",
"email_size": 8192,
"text_body": "I need help with my order.",
"html_body": "<p>I need help with my order.</p>",
"attachments": []
},
{
"visibility_status": "available",
"direction": "outbound",
"id": "1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
"subject": "Re: Support request",
"rfc_message_id": "<def@send.example>",
"in_reply_to": "<abc@customer.example>",
"references": [
"<abc@customer.example>"
],
"from": "support-tickets-1a2b3c4d@inbound-mailtrap.io",
"to": [
"customer@example.com"
],
"cc": [],
"bcc": [],
"reply_to": null,
"created_at": "2026-05-08T11:40:00.000Z",
"email_size": 8192,
"text_body": "Happy to help — could you share your order ID?",
"html_body": "<p>Happy to help — could you share your order ID?</p>",
"attachments": [],
"delivery_status": "delivered",
"delivered_at": "2026-05-08T11:40:05.000Z",
"bounced_at": null
},
{
"visibility_status": "placeholder",
"direction": "inbound"
}
]
}Last updated
Was this helpful?

