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

Show email message

Get email message by ID.

get
Authorizations
Api-TokenstringRequired

Pass the API token in the Api-Token

Path parameters
sandbox_idinteger · int64 · min: 1Required

Unique sandbox ID

Example: 4015
message_idinteger · int64 · min: 1Required

Unique message ID

Example: 427
Responses
200

Returns email message with its attributes.

application/json

Email message captured in a Sandbox. Body URLs are often under /api/testing_message_parts/... rather than nested under /api/accounts/.../messages/.... blacklists_report_info may contain only result or the full report. template_variables is set when the message was sent from a template.

idintegerOptional
sandbox_idintegerOptional
subjectstringOptional
sent_atstringOptional
from_emailstringOptional
from_namestringOptional
to_emailstringOptional
to_namestringOptional
email_sizeintegerOptional
is_readbooleanOptional
created_atstringOptional
updated_atstringOptional
template_idintegerOptional
html_body_sizeintegerOptional
text_body_sizeintegerOptional
human_sizestringOptional
html_pathstringOptional
txt_pathstringOptional
raw_pathstringOptional
download_pathstringOptional
html_source_pathstringOptional
get/api/sandboxes/{sandbox_id}/messages/{message_id}
curl -X GET https://mailtrap.io/api/sandboxes/{sandbox_id}/messages/{message_id} \
  -H 'Authorization: Bearer YOUR_API_KEY'
{
  "id": 2323,
  "sandbox_id": 17002,
  "subject": "Test email",
  "sent_at": "2022-07-01T19:29:59.295Z",
  "from_email": "john@mailtrap.io",
  "from_name": "John",
  "to_email": "mary@mailtrap.io",
  "to_name": "Mary",
  "email_size": 300,
  "is_read": false,
  "created_at": "2022-07-01T19:29:59.295Z",
  "updated_at": "2022-07-01T19:29:59.295Z",
  "template_id": 0,
  "template_variables": null,
  "html_body_size": 150,
  "text_body_size": 100,
  "human_size": "300 Bytes",
  "html_path": "/api/accounts/16297/sandboxes/17002/messages/2323/body.html",
  "txt_path": "/api/accounts/16297/sandboxes/17002/messages/2323/body.txt",
  "raw_path": "/api/accounts/16297/sandboxes/17002/messages/2323/body.raw",
  "download_path": "/api/accounts/16297/sandboxes/17002/messages/2323/body.eml",
  "html_source_path": "/api/accounts/16297/sandboxes/17002/messages/2323/body.htmlsource",
  "blacklists_report_info": {
    "result": "success",
    "domain": "example.com",
    "ip": "23.215.0.138",
    "report": []
  },
  "smtp_information": {
    "ok": true,
    "data": {
      "mail_from_addr": "john@mailtrap.io",
      "client_ip": "193.62.62.184",
      "rcpt_to_addrs": [
        "mary@mailtrap.io"
      ]
    }
  }
}

Last updated

Was this helpful?