Transactional
Send individual transactional emails
Send transactional emails for order confirmations, password resets, and notifications.
Best for: Real-time, one-to-one emails triggered by user actions
Send a single transactional email with text, HTML, or template content.
Use this endpoint for:
Order confirmations
Password reset emails
Account notifications
Welcome emails
System alerts
API token in Api-Token header
Email successfully sent
trueMessage IDs (one per recipient)
0c7fd939-02cf-11ed-88c2-0a58a9feac02Bad request. Fix errors listed in response before retrying.
Unauthorized. Check your API credentials.
Forbidden. Verify domain or check permissions.
Internal server error. Retry later or contact support.
curl -X POST https://send.api.mailtrap.io/api/send \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"from": {"email": "sender@example.com"},
"to": [{"email": "recipient@example.com"}],
"subject": "Hello from Mailtrap",
"text": "Welcome to Mailtrap!"
}'
{
"success": true,
"message_ids": [
"0c7fd939-02cf-11ed-88c2-0a58a9feac02"
]
}Send up to 500 transactional emails in a single API call. Each email can have unique recipients and content while sharing base properties.
Limits:
Maximum 500 messages per call
Maximum 50 MB total payload size (including attachments)
Note: The endpoint returns HTTP 200 even if individual messages fail. Check the responses array for individual message status.
API token in Api-Token header
Send multiple emails in a single API call (up to 500)
Batch processed. Check individual responses for delivery status.
Overall request success
trueGeneral errors
Bad request. Fix errors listed in response before retrying.
Unauthorized. Check your API credentials.
Internal server error. Retry later or contact support.
curl -X POST https://send.api.mailtrap.io/api/batch \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"base": {
"from": {"email": "sender@example.com"},
"subject": "Monthly Newsletter"
},
"requests": [
{"to": [{"email": "user1@example.com"}]},
{"to": [{"email": "user2@example.com"}]},
{"to": [{"email": "user3@example.com"}]}
]
}'
{
"success": true,
"responses": [
{
"success": true,
"message_ids": [
"0c7fd939-02cf-11ed-88c2-0a58a9feac02"
],
"errors": [
"text"
]
}
],
"errors": [
"text"
]
}Last updated
Was this helpful?

