List threads
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.
API token in Api-Token header
Inbound inbox ID
1Cursor from the previous response's last_id. Omit on the first
request.
eyJsYXN0X2FjdGl2aXR5X2F0IjoxNzQ2NzAwMjAwMDAwLCJpZCI6IjE3MDAwMDAwMDAwMDAxMjMifQList of threads
Total number of threads matching the query.
1Cursor for the next page. null when there are no more results.
Unauthorized
Forbidden
Not found
curl -X GET 'https://mailtrap.io/api/inbound/inboxes/{inbox_id}/threads' \
-H 'Authorization: Bearer YOUR_API_KEY'
{
"data": [
{
"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"
}
]
}
],
"total_count": 1,
"last_id": null
}Last updated
Was this helpful?

