Sending email
One request per email, a batch of up to 1,000 emails or a finished MIME message. All three accept the email and answer at once, delivery happens in the background.
Send one email
POST /v1/emails with JSON. You need at least from, to and either content (subject plus html and/or text) or a template.
curl https://api.sendtide.ch/v1/emails \
-H "Authorization: Bearer $SENDTIDE_API_KEY" \
-H "Idempotency-Key: invoice-2026-1042" \
-H "Content-Type: application/json" \
-d '{
"from": "Acme <billing@example.com>",
"to": ["anna@example.org"],
"cc": "accounting@example.com",
"reply_to": "support@example.com",
"subject": "Your invoice 2026-1042",
"html": "<p>Hello Anna, your invoice is attached.</p>",
"text": "Hello Anna, your invoice is attached.",
"tags": ["invoice"],
"metadata": { "order_id": "1042" }
}'
The answer is 202 with {"id": "msg_…", "status": "queued"}. The main fields:
| Field | Meaning |
|---|---|
from |
Name <address@domain> or just the address. For live keys from a verified domain. |
to, cc, bcc, reply_to |
One address or a list of at most 50 addresses. |
subject |
At most 998 characters. |
html, text |
Content. Send both if you can: a text version helps deliverability. For templates Sendtide derives it from the HTML when needed. |
template, data, locale |
Instead of content: template (alias or tpl_ id), values and language, see Templates. |
headers |
Custom headers as an object. |
tags |
At most 10 tags, searchable with tag:invoice. |
metadata |
Any JSON object, returned in webhooks and logs. |
category |
Groups email for unsubscribes, see Suppressions. |
unsubscribe |
Turn on List-Unsubscribe, see Suppressions. |
track |
Measure opens and clicks. Defaults to the account setting (off). |
send_at |
Scheduled send, at most 72 hours ahead. |
tenant |
Send for a sub-account. |
attachments |
Attachments and inline images. |
All fields with their types are in the API reference.
How recipients are counted
The quota counts recipients, not emails: To, Cc and Bcc that are actually sent to. One email to three addresses counts three times. Addresses on the suppression list do not count, the email to them gets the status suppressed.
Attachments
attachments takes files (base64) and inline images:
{
"from": "hello@example.com",
"to": "anna@example.org",
"subject": "Your invoice",
"html": "<p>Hello</p><img src=\"cid:logo\">",
"attachments": [
{ "filename": "invoice.pdf", "content": "JVBERi0xLjQK…", "content_type": "application/pdf" },
{ "filename": "logo.png", "content": "iVBORw0KGgo…", "content_id": "logo" }
]
}
- At most 20 files. The whole message may be at most 10 MB after MIME encoding.
- A
content_idmakes a file an inline image. Refer to it in the HTML withsrc="cid:logo". - Executable and script files (exe, bat, cmd, com, js, vbs, scr, msi, jar, ps1 and more) are refused.
- Filenames are sanitized, path and control characters are removed.
- The content of attachments is deleted with the content of the email after the retention period, name and size stay.
The SDKs have helpers for this, such as attachmentFromFile() in Node.js, see SDKs.
Batch
POST /v1/emails/batch sends up to 1,000 emails in one request. Every entry of emails is merged onto defaults. All entries are validated first: if one is invalid, none is sent.
curl https://api.sendtide.ch/v1/emails/batch \
-H "Authorization: Bearer $SENDTIDE_API_KEY" \
-H "Idempotency-Key: monthly-invoices-2026-11" \
-H "Content-Type: application/json" \
-d '{
"defaults": { "from": "Acme <billing@example.com>", "template": "invoice", "locale": "en" },
"emails": [
{ "to": "anna@example.org", "data": { "amount": "120.00" } },
{ "to": "ben@example.org", "data": { "amount": "80.00" } }
]
}'
The answer has a batch_id and an id and status per email. Attachments in defaults.attachments are stored once and shared by all emails that do not set their own. With POST /v1/batches/{id}/cancel you cancel all emails of a batch that are still waiting.
MIME
If you build the message yourself, send it finished: POST /v1/emails/mime with the RFC 5322 message as base64 in raw (at most 10 MB). Sendtide sends it as it is, only Bcc is removed. The envelope recipients default to To, Cc and Bcc of the message. to overrides them, and tags and send_at work too.
RAW=$(base64 < message.eml | tr -d '\n')
curl https://api.sendtide.ch/v1/emails/mime \
-H "Authorization: Bearer $SENDTIDE_API_KEY" \
-H "Content-Type: application/json" \
-d "{ \"raw\": \"$RAW\" }"
There are no templates with MIME. If you prefer SMTP, see SMTP.
Templates
Instead of subject, html and text you name a template and its values:
{
"from": "hello@example.com",
"to": ["anna@example.org"],
"template": "welcome",
"locale": "en",
"data": { "name": "Anna" }
}
Sendtide always sends the published version. If values are missing the API answers 422 missing_variables and names them, instead of sending “Hello ,”. Details in Templates.
Streams (coming later)
All email runs in the transactional stream today. Separate streams, for example for newsletters, come later. The API already accepts the stream field, but you don’t need it.
Scheduling
With send_at (RFC 3339, at most 72 hours ahead) the email waits with status queued until that time. While it is queued you can move or cancel it:
# move
curl -X PATCH https://api.sendtide.ch/v1/emails/msg_8kq2m4bt \
-H "Authorization: Bearer $SENDTIDE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "send_at": "2026-12-01T09:00:00Z" }'
# cancel
curl -X POST https://api.sendtide.ch/v1/emails/msg_8kq2m4bt/cancel \
-H "Authorization: Bearer $SENDTIDE_API_KEY"
Canceling sets the status to canceled, fires the event email.canceled and counts the recipients back that were counted for today. If a worker already took the email, the API answers 409 not_cancelable (or 409 not_reschedulable). A time in the past sends at once.
Idempotency keys
Send an Idempotency-Key (at most 255 characters) with every POST that creates email, for example the id of the order. Then repeating after a timeout or network error is safe:
- The same request with the same key returns the first answer, with status
200instead of202. Nothing is sent twice. - The same key with a different body is refused:
409 idempotency_conflict. - Keys live 24 hours and belong to the environment. A test key and a live key do not share keys.
- Concurrent requests with the same key send once.
The SDKs send a random key automatically and reuse it when they retry. You can pass your own.
Delivery: at least once
Sendtide hands every email to Amazon SES (Zurich region) at least once. That means:
- An email is handed to SES as soon as the outcome is known, also while the service restarts.
- If the answer from SES is lost (timeout), Sendtide does not blindly send again. The email stays
sendinguntil SES reports delivery or bounce, and fails with “outcome unknown” after an hour without a report. - A crash exactly between the call to SES and the database write can, rarely, send an email twice.
Make the handling of repeated emails idempotent where it matters. For payment confirmations, for example, the receiving code remembers the order number instead of treating every email as new.
Status of an email
GET /v1/emails/{id} returns the email with its events and one row per recipient in recipients (address, type, status, last event, bounce class). The status of the email is the aggregate: delivered when all recipients are, bounced when all bounced, partially_delivered when the outcomes differ.
Possible statuses: queued, sending, sent, delayed, delivered, partially_delivered, opened, clicked, bounced, complained, rejected, failed, suppressed, canceled.
The search GET /v1/emails?q=… understands status:bounced, tag:invoice, domain:gmx.ch, to:anna@example.org, template:welcome, stream:transactional, recipient_status:bounced, a leading - to negate, and free text over recipient and subject. More about lists in Pagination.
Test mode
With a test key Sendtide renders every email, checks it like a real one and logs it, but does not deliver it. That way you finish your integration without anything reaching real recipients.