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_idintegerRequiredExample:
Inbound inbox ID
1Query parameters
last_idstringOptionalExample:
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.
1700000000000123Responses
200
List of messages
application/json
total_countintegerRequiredExample:
Total number of messages within the retention window.
1last_idstring · nullableRequired
Cursor for the next page. null when there are no more results.
401
Unauthorized
application/json
403
Forbidden
application/json
404
Not found
application/json
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?

