API documentation
Connect one or more SMTP senders, then send transactional email from any application through a stable HTTPS contract. This guide covers setup, authentication, requests, errors, rotation, and operational safety.
Start here
Quickstart
Complete these steps in order. The full setup normally takes only a few minutes.
Identity
Authentication
Every email request requires an organization-owned API key. Dashboard session cookies are never accepted by the public email endpoint.
Authorization: Bearer gms_your_secret_keyYou may alternatively send the same secret in the x-api-key header. Bearer authentication is recommended because it works consistently with proxies and standard HTTP clients.
Endpoint
Send an email
Send JSON to POST /api/v1/emails. The configured workspace sender controls the From address.
curl https://your-domain.com/api/v1/emails \
-H "Authorization: Bearer $EASYMAIL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: receipt-order-9382" \
-d '{
"to": "customer@example.com",
"subject": "Your receipt",
"text": "Thanks for your order."
}'duplicate: true.Schema
Request fields
Unknown fields are rejected, preventing accidental From-address spoofing or unsupported Nodemailer options.
Safe retries
Idempotency
Use a stable Idempotency-Key whenever your application might retry a send after a timeout or temporary network failure.
Idempotency-Key: order-9382-receiptContract
Success responses
Responses include the delivery record and a request ID for tracing.
{
"data": {
"id": "44df90ce-...",
"status": "sent",
"messageId": "<provider-message-id@gmail.com>",
"accepted": ["customer@example.com"],
"rejected": [],
"duplicate": false
},
"requestId": "12d4139c-..."
}The same request ID is also returned in the x-request-id response header.
Check request status
Call GET /api/v1/emails/{id} with the same API-key header. A status of accepted means the SMTP provider accepted at least one recipient; it does not guarantee inbox placement or that the recipient opened the message.
curl https://your-domain.com/api/v1/emails/44df90ce-... \
-H "Authorization: Bearer $EASYMAIL_API_KEY"Recovery
Errors
Error codes are stable and safe to use in application logic. Human messages may become clearer over time.
{
"error": {
"code": "INVALID_API_KEY",
"message": "The API key is invalid or expired",
"requestId": "12d4139c-..."
}
}Boundaries
Limits and timeouts
These defaults keep delivery predictable and protect every workspace from accidental overload.
The endpoint has a 30-second execution budget. Treat 502 responses and client-side timeouts as retryable only when you also supplied an idempotency key.
Credential lifecycle
Rotate an API key
Rotation creates a replacement and revokes the selected key. Plan the change so applications do not lose access.
- 1
Open Dashboard โ API keys and identify the key used by your application.
- 2
Select Rotate, then immediately copy the replacement secret.
- 3
Update the secret in your deployment platform or secret manager.
- 4
Redeploy or restart the application and verify a test email.
Operations
Security guidance
easymail protects credentials at the platform boundary, while your application must protect its API key.
Help
Troubleshooting
Start with the response code and request ID, then work through the matching check.