Get a message
Returns a single inbound message together with URLs for the raw .eml file and for each attachment, plus the decoded HTML and plain-text bodies. URLs expire after one hour.
API token in Api-Token header
Inbound inbox ID
1Inbound message ID
1700000000000123Message details
Mailtrap object ID for the message (not the Message-ID header value).
17000000000001231sender@example.com["support-tickets-1a2b3c4d@inbound-mailtrap.io"]HelloValue of the original Message-ID header.
<abc@sender.example>Selected headers from the original message, lowercased.
{"mime-version":"1.0","return-path":"<sender@example.com>"}Total size of the raw message in bytes.
4096Size of the HTML body in bytes. Zero if the message has no HTML part.
512Size of the plain-text body in bytes. Zero if the message has no text part.
1282026-05-08T10:30:00.000ZID of the thread this message belongs to. Use it with the Threads endpoints to fetch the full conversation.
1700000000000124URL to download the raw .eml file. Expires after one hour.
https://s3.amazonaws.com/inbound-mail/raw.eml?X-Amz-Signature=...2026-05-08T11:30:00.000ZDecoded HTML body. null when the message has no HTML part.
<html><body>Hello</body></html>Decoded plain-text body. null when the message has no text part.
HelloUnauthorized
Forbidden
Not found
curl -X GET https://mailtrap.io/api/inbound/inboxes/{inbox_id}/messages/{id} \
-H 'Authorization: Bearer YOUR_API_KEY'
{
"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",
"return-path": "<sender@example.com>"
},
"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",
"download_url": "https://s3.amazonaws.com/inbound-mail/att-1?X-Amz-Signature=...",
"download_url_expires_at": "2026-05-08T11:30:00.000Z"
}
],
"raw_message_url": "https://s3.amazonaws.com/inbound-mail/raw.eml?X-Amz-Signature=...",
"raw_message_expires_at": "2026-05-08T11:30:00.000Z",
"html_body": "<html><body>Hello</body></html>",
"text_body": "Hello"
}Last updated
Was this helpful?

