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

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.

get
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
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?