Get messages
Get all messages in the sandbox. The response contains up to 30 messages. Use last_id or page to retrieve more.
Pass the API token in the Api-Token
Unique sandbox ID
4015Search query string. Matches subject, to_email, and to_name.
welcomeIf specified, a page of records before last_id is returned. Overrides page if both are given.
123Page number for paginated results.
5lists messages
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.
Returns unauthorized error message. Check your credentials.
Returns forbidden error message. Check your permissions.
curl -X GET https://mailtrap.io/api/sandboxes/{sandbox_id}/messages \
-H 'Authorization: Bearer YOUR_API_KEY'
[
{
"id": 92,
"sandbox_id": 342,
"subject": "Test email",
"sent_at": "2022-08-19T11:34:33.839Z",
"from_email": "per667son25@feeney.biz",
"from_name": "Ela Marks",
"to_email": "per688son26@donnelly.info",
"to_name": "Edmund Maggio",
"email_size": 300,
"is_read": false,
"created_at": "2022-08-19T11:34:33.841Z",
"updated_at": "2022-08-19T11:34:33.841Z",
"template_id": 0,
"template_variables": null,
"html_body_size": 150,
"text_body_size": 100,
"human_size": "300 Bytes",
"html_path": "/api/accounts/336/sandboxes/342/messages/92/body.html",
"txt_path": "/api/accounts/336/sandboxes/342/messages/92/body.txt",
"raw_path": "/api/accounts/336/sandboxes/342/messages/92/body.raw",
"download_path": "/api/accounts/336/sandboxes/342/messages/92/body.eml",
"html_source_path": "/api/accounts/336/sandboxes/342/messages/92/body.htmlsource",
"blacklists_report_info": {
"result": "pending"
},
"smtp_information": {
"ok": true,
"data": {
"mail_from_addr": "per667son25@feeney.biz",
"client_ip": "75.180.183.201",
"rcpt_to_addrs": [
"per688son26@donnelly.info"
]
}
}
}
]Last updated
Was this helpful?

