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

List messages

Returns inbound messages received by the inbox, ordered by received_at descending.

List responses 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

ID of the last message from the previous page. Pass the last_id value returned by the previous response to fetch the next page. Omit on the first request.

Example: 1700000000000123
Responses
200

List of messages

application/json
total_countintegerRequired

Total number of messages within the retention window.

Example: 1
last_idstring · nullableRequired

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

get/api/inbound/inboxes/{inbox_id}/messages
curl -X GET 'https://mailtrap.io/api/inbound/inboxes/{inbox_id}/messages' \
  -H 'Authorization: Bearer YOUR_API_KEY'
{
  "data": [
    {
      "id": "1700000000000123",
      "inbox_id": 1,
      "from": "sender@example.com",
      "to": [
        "support-tickets-1a2b3c4d@inbound-mailtrap.io"
      ],
      "cc": [],
      "bcc": [],
      "reply_to": null,
      "subject": "Hello",
      "rfc_message_id": "<abc@sender.example>",
      "in_reply_to": null,
      "references": [],
      "headers": {
        "mime-version": "1.0"
      },
      "size": 4096,
      "html_size": 512,
      "text_size": 128,
      "received_at": "2026-05-08T10:30:00.000Z",
      "thread_id": "1700000000000124",
      "attachments": [
        {
          "attachment_id": "att-1",
          "size": 1024,
          "filename": "logo.png",
          "content_type": "image/png",
          "content_disposition": "inline",
          "content_id": "logo@example.com"
        }
      ]
    }
  ],
  "total_count": 1,
  "last_id": null
}

Last updated

Was this helpful?