Sending
Emails
Send, schedule, retrieve, list, reschedule and cancel emails.
Send an email
POST /v1/emails
| Field | Type | Description |
|---|---|---|
from |
string | Required. Sender, e.g. Acme <hello@mail.acme.com>. Must be on a verified domain. |
to |
string | string[] | Required. Recipient(s). |
subject |
string | Required. |
html |
string | HTML body. html and/or text is required. |
text |
string | Plain-text body. |
cc, bcc, reply_to |
string | string[] | Optional. Up to 50 recipients in total. |
headers |
object | Custom headers, e.g. { "X-Entity-Ref-ID": "123" }. |
attachments |
array | Up to 20 files, 10 MB total. { filename, content (base64), content_type? }. |
tags |
array | Up to 10 { name, value } pairs (letters, numbers, _ and -). |
scheduled_at |
string | ISO 8601 timestamp up to 30 days in the future. |
curl -X POST https://stackemails.com/v1/emails \
-H "Authorization: Bearer $STACKEMAILS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "Acme <billing@mail.acme.com>",
"to": ["ada@example.com"],
"subject": "Your receipt",
"html": "<p>Thanks for your order!</p>",
"tags": [{ "name": "category", "value": "receipt" }],
"attachments": [{ "filename": "receipt.pdf", "content": "JVBERi0xLjQK..." }]
}'
Response 202:
{ "id": "msg_5b1f0c6c2a8e4e0f", "status": "queued", "scheduled_at": null }
Emails to addresses on your suppression list are skipped automatically.
Send a batch
POST /v1/emails/batch: an array of up to 100 email objects (attachments and scheduled_at aren't supported in batches). Validation is all-or-nothing; each email is then queued independently.
{
"data": [{ "id": "msg_..." }, { "id": "msg_..." }],
"errors": []
}
Schedule an email
Pass scheduled_at when sending:
{ "from": "...", "to": "...", "subject": "...", "html": "...", "scheduled_at": "2026-11-01T09:00:00Z" }
The email's status is scheduled until it sends.
Reschedule
PATCH /v1/emails/:id with { "scheduled_at": "..." }. Only emails still in scheduled status can be changed.
Cancel
POST /v1/emails/:id/cancel returns { "id": "msg_...", "status": "canceled" }.
Retrieve an email
GET /v1/emails/:id returns the email with its HTML, text, tags, attachments metadata, open and click counts and full event timeline.
{
"object": "email",
"id": "msg_5b1f0c6c2a8e4e0f",
"from": "Acme <billing@mail.acme.com>",
"to": ["ada@example.com"],
"subject": "Your receipt",
"status": "delivered",
"last_event": "delivered",
"created_at": "2026-10-20T10:15:02.000Z",
"sent_at": "2026-10-20T10:15:03.000Z",
"delivered_at": "2026-10-20T10:15:05.000Z",
"opens": 1,
"clicks": 0,
"events": [
{ "type": "queued", "at": "2026-10-20T10:15:02.000Z", "detail": null },
{ "type": "sent", "at": "2026-10-20T10:15:03.000Z", "detail": null },
{ "type": "delivered", "at": "2026-10-20T10:15:05.000Z", "detail": null }
]
}
List emails
GET /v1/emails?limit=20&after=<id>&status=delivered
Returns { "object": "list", "has_more": true, "data": [...] }, newest first. Paginate by passing the last id as after. limit is 1–100.
Statuses
queued, then sent, then delivered, with scheduled, canceled, delivery_delayed, bounced, complained, opened, clicked and failed along the way.
Suppressions
Addresses that hard-bounce or file a spam complaint are added to your team's suppression list, and later sends to them are skipped. Manage the list in Emails > Suppressions.