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.
Sender setup
Create provider credentials
The platform sends through the sender you select. Use the exact credential type required by that provider: an app password, an SMTP username/password pair, or OAuth where supported.
Identity
Authentication
Programmatic sending requires two setup items: a verified SMTP sender and an organization-owned API key bound to that sender. Your request sends the key, and the platform securely resolves the sender. Dashboard playground sends only require selecting the saved sender.
Authorization: Bearer $EASYMAIL_API_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://easymail-nu.vercel.app/api/v1/emails \
-H "Authorization: Bearer $EASYMAIL_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: receipt-order-9382" \
-d '{
"to": "customer@gmail.com",
"cc": ["finance@gmail.com"],
"subject": "Your receipt",
"text": "Thanks for your order.",
"html": "<h1>Your receipt</h1><p>Thanks for your order.</p>",
"attachments": [{"filename":"receipt.pdf","content":"BASE64_FILE_CONTENT","contentType":"application/pdf"}]
}'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@gmail.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://easymail-nu.vercel.app/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.