Emails
Send an email
Send a single transactional email from a verified domain on your account. For sending multiple emails at once, use the batch endpoint.
Request Body
fromstringrequiredSender address, e.g. "[email protected]". The domain must be verified on your account.
from_namestringoptionalSender display name. Recipients see "Name <email>" instead of just the address, e.g. John <[email protected]>.
tostring | string[]requiredOne or more recipient addresses.
ccstring | string[]optionalCC recipients. Combined total of to + cc + bcc cannot exceed 50.
bccstring | string[]optionalBCC recipients. Addresses are hidden from other recipients.
reply_tostringoptionalReply-To address. Replies will be directed here instead of the from address.
subjectstringrequiredEmail subject line.
textstringoptionalPlain-text body. At least one of text or html is required.
htmlstringoptionalHTML body. At least one of text or html is required.
attachmentsAttachment[]optionalArray of attachment objects (see below). Max 7 MB per file, 10 MB total.
Response
idstringUnique email ID stored in your account.
fromstringSender address used.
tostring[]To recipient addresses.
ccstring[]CC recipient addresses.
bccstring[]BCC recipient addresses.
subjectstringSubject line.
created_atISO 8601Timestamp when the email was sent.
Request (curl)
curl -X POST https://sendexapi.com/api/v1/emails \
-H "Authorization: Bearer sk_live_XXXX" \
-H "Content-Type: application/json" \
-d '{
"from": "[email protected]",
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": ["[email protected]"],
"reply_to": "[email protected]",
"subject": "Welcome to Acme",
"html": "<p>Thanks for signing up!</p>",
"text": "Thanks for signing up!"
}'Response
HTTP/1.1 201 Created
{
"id": "66f1a2b3c4d5e6f7a8b9c0d1",
"from": "[email protected]",
"to": ["[email protected]"],
"cc": ["[email protected]"],
"bcc": ["[email protected]"],
"subject": "Welcome to Acme",
"created_at": "2025-01-15T10:30:00.000Z"
}Attachment Object
| Field | Type | Required | Description |
|---|---|---|---|
filename | string | required | File name including extension. |
content | string | required | Base64-encoded file content. |
content_type | string | required | MIME type, e.g. "application/pdf". |
Send a batch of emails
Send up to 100 emails in a single request. Each email is sent independently — a failure in one does not affect the others. Returns HTTP 207 Multi-Status with per-email results.
Request Body
emailsEmail[]requiredArray of email objects (1–100). Each object has the same fields as the single send endpoint: from, from_name, to, cc, bcc, reply_to, subject, text, html, attachments.
Response
dataResult[]Per-email result. Successful items include all send response fields. Failed items include error and message.
totalnumberTotal number of emails submitted.
success_countnumberNumber of emails sent successfully.
error_countnumberNumber of emails that failed.
Request (curl)
curl -X POST https://sendexapi.com/api/v1/emails/batch \
-H "Authorization: Bearer sk_live_XXXX" \
-H "Content-Type: application/json" \
-d '{
"emails": [
{
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Hello Alice",
"text": "Hi Alice!"
},
{
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Hello Bob",
"text": "Hi Bob!"
}
]
}'Response
HTTP/1.1 207 Multi-Status
{
"data": [
{
"index": 0,
"id": "66f1a2b3c4d5e6f7a8b9c0d1",
"from": "[email protected]",
"to": ["[email protected]"],
"cc": [],
"bcc": [],
"subject": "Hello Alice",
"created_at": "2025-01-15T10:30:00.000Z"
},
{
"index": 1,
"error": "unprocessable_entity",
"message": "Sending domain is not verified on your account."
}
],
"total": 2,
"success_count": 1,
"error_count": 1
}List emails
Returns a paginated list of emails for a domain. Requires a full-access key.
Query Parameters
domainstringrequiredThe domain to list emails for.
folderinbox | sentoptionalFolder to list. Defaults to "inbox".
limitnumberoptionalNumber of emails to return (1–100). Default 20.
offsetnumberoptionalPagination offset. Default 0.
Response
dataEmail[]Array of email summary objects.
totalnumberTotal number of emails matching the query.
limitnumberLimit applied to the query.
offsetnumberOffset applied to the query.
Request (curl)
curl "https://sendexapi.com/api/v1/emails?domain=example.com&folder=inbox&limit=20" \ -H "Authorization: Bearer sk_live_XXXX"
Response
{
"data": [
{
"id": "66f1a2b3c4d5e6f7a8b9c0d1",
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Re: your order",
"preview": "Your order #1234 has shipped...",
"read": false,
"created_at": "2025-01-15T09:00:00.000Z",
"folder": "inbox"
}
],
"total": 142,
"limit": 20,
"offset": 0
}Retrieve an email
Retrieves the full content of an email including text body, HTML body, and attachment metadata. Requires a full-access key.
Response
idstringEmail ID.
fromstringSender address.
tostring[]To recipient addresses.
ccstring[]CC addresses.
bccstring[]BCC addresses.
reply_tostring | nullReply-To address, if set.
subjectstringSubject line.
textstringPlain-text body.
htmlstring | nullHTML body, if available.
attachmentsAttachmentMeta[]Attachment metadata (filename, content_type, size).
readbooleanWhether the email has been read.
created_atISO 8601Date the email was sent or received.
folderstring"inbox" or "sent".
Request (curl)
curl "https://sendexapi.com/api/v1/emails/66f1a2b3c4d5e6f7a8b9c0d1" \ -H "Authorization: Bearer sk_live_XXXX"
Response
{
"id": "66f1a2b3c4d5e6f7a8b9c0d1",
"from": "[email protected]",
"to": ["[email protected]"],
"cc": [],
"subject": "Re: your order",
"text": "Your order #1234 has shipped...",
"html": "<p>Your order <b>#1234</b> has shipped...</p>",
"attachments": [
{
"filename": "invoice.pdf",
"content_type": "application/pdf",
"size": 48210
}
],
"read": true,
"created_at": "2025-01-15T09:00:00.000Z",
"folder": "inbox"
}Get attachment
Redirects (302) to a short-lived presigned download URL for an attachment on a specific email. The URL expires after 1 hour. Requires a full-access key.
Response
—302 redirectRedirects to a presigned S3 URL. Follow redirects in your HTTP client to receive the file.
Request (curl)
curl -L "https://sendexapi.com/api/v1/emails/66f1a2b3c4d5e6f7a8b9c0d1/attachments/invoice.pdf" \ -H "Authorization: Bearer sk_live_XXXX" \ -o invoice.pdf
Response
HTTP/1.1 302 Found Location: https://s3.amazonaws.com/...presigned-url... # -L flag follows the redirect and downloads the file