API reference: Emails
10 endpoints of the Emails group.
Send an email
POST/v1/emails
Accepts the mail, stores it and answers at once. Delivery happens in the background; follow it with webhooks or GET /v1/emails/{id}.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Makes a repeated request safe (24 hours). |
Request body application/json
| Field | Type | Description |
|---|---|---|
from | string | From a verified domain (live keys) Example: Sendtide <hello@sendtide.ch> |
to | string (email) | array<string (email)> | |
cc | string (email) | array<string (email)> | |
bcc | string (email) | array<string (email)> | |
reply_to | string (email) | array<string (email)> | |
subject | string | |
html | string | |
text | string | |
template | string | Alias or tpl_ id; instead of subject |
data | object | Values for the template |
locale | string | Language of the template: exact, then the base language, then the account's default Example: de-CH |
tenant | string | Sub-account slug to send for |
headers | object | |
tags | array<string> | |
metadata | object | |
send_at | string (date-time) | At most 72 hours ahead |
track | boolean | Track opens and clicks; default from the account setting (off) |
attachments | array<Attachment> | Files and inline images. In a batch, defaults.attachments is shared by all mails that do not set their own. |
attachments[].filename * | string | Sanitized: path and control characters are removed. Executable and script files are refused. Example: rechnung.pdf |
attachments[].content * | string (base64) | |
attachments[].content_type | string | Taken from the file extension if missing Example: application/pdf |
attachments[].content_id | string | Makes the file an inline image; the HTML refers to it as src="cid:logo" Example: logo |
attachments[].disposition | enum: attachment | inline | Default inline with a content_id, else attachment |
category | string | Groups mail for unsubscribes: lowercase letters, digits, dot, dash, underscore, up to 64 characters Example: newsletter |
unsubscribe | Unsubscribe | List-Unsubscribe with one-click (RFC 8058). Needs a mail with exactly one recipient. Without this object the account setting unsubscribe_default decides. |
unsubscribe.enabled | boolean | Default: true |
unsubscribe.url | string (uri) | Your own https page instead of Sendtide's link; it must accept the one-click POST itself. Nothing is suppressed by Sendtide then. |
stream | string | Message stream: transactional (default) or one of your own (GET /v1/streams). broadcast and streams of kind broadcast are not available yet (403 broadcast_not_available) Example: transactional |
Example
curl -X POST "https://api.sendtide.ch/v1/emails" \
-H "Authorization: Bearer sk_test_…" \
-H "Idempotency-Key: order-4821" \
-H "Content-Type: application/json" \
-d '{"from":"Sendtide <hello@sendtide.ch>","to":"anna@example.com","subject":"Willkommen","html":"<p>Hallo Anna</p>"}' Responses
| Status | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Repeat of an idempotent request EmailAccepted Response fields
| ||||||||||||
202 | Accepted EmailAccepted Response fields
| ||||||||||||
400 | Error in the usual format, errors and limits | ||||||||||||
401 | Error in the usual format, errors and limits | ||||||||||||
409 | Error in the usual format, errors and limits | ||||||||||||
422 | Error in the usual format, errors and limits | ||||||||||||
429 | Error in the usual format, errors and limits |
Search emails
GET/v1/emails
Newest first. q understands status:bounced, tag:invoice, domain:gmx.ch, to:anna@example.com, template:welcome, stream:broadcast, recipient_status:bounced (some recipient of the mail has this status), a leading - to negate, and free text (recipient and subject). status:bounced also finds mail that bounced for some of its recipients.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
q | query | string | |
since | query | string (date-time) | Default 30 days ago |
until | query | string (date-time) | |
limit | query | integer | Page size. The default and the maximum depend on the endpoint (emails 50 up to 500, received mail 50 up to 200, audit up to 200, the others 100 up to 500 or 1000). Default: 100 |
cursor | query | string | The next_cursor of the previous page. Opaque; pass it unchanged to the same endpoint with the same filters. |
tenant | query | string | Slug of a sub-account to act for. |
Example
curl "https://api.sendtide.ch/v1/emails" \
-H "Authorization: Bearer sk_test_…" Responses
| Status | Description | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Results Response fields
|
Send up to 1'000 emails
POST/v1/emails/batch
Every entry of emails is merged onto defaults. All are validated first; if one is invalid, none is sent.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Makes a repeated request safe (24 hours). |
Request body application/json
| Field | Type | Description |
|---|---|---|
defaults | SendEmailRequest | |
defaults.from | string | From a verified domain (live keys) Example: Sendtide <hello@sendtide.ch> |
defaults.to | string (email) | array<string (email)> | |
defaults.cc | string (email) | array<string (email)> | |
defaults.bcc | string (email) | array<string (email)> | |
defaults.reply_to | string (email) | array<string (email)> | |
defaults.subject | string | |
defaults.html | string | |
defaults.text | string | |
defaults.template | string | Alias or tpl_ id; instead of subject |
defaults.data | object | Values for the template |
defaults.locale | string | Language of the template: exact, then the base language, then the account's default Example: de-CH |
defaults.tenant | string | Sub-account slug to send for |
defaults.headers | object | |
defaults.tags | array<string> | |
defaults.metadata | object | |
defaults.send_at | string (date-time) | At most 72 hours ahead |
defaults.track | boolean | Track opens and clicks; default from the account setting (off) |
defaults.attachments | array<Attachment> | Files and inline images. In a batch, defaults.attachments is shared by all mails that do not set their own. |
defaults.attachments[].filename * | string | Sanitized: path and control characters are removed. Executable and script files are refused. Example: rechnung.pdf |
defaults.attachments[].content * | string (base64) | |
defaults.attachments[].content_type | string | Taken from the file extension if missing Example: application/pdf |
defaults.attachments[].content_id | string | Makes the file an inline image; the HTML refers to it as src="cid:logo" Example: logo |
defaults.attachments[].disposition | enum: attachment | inline | Default inline with a content_id, else attachment |
defaults.category | string | Groups mail for unsubscribes: lowercase letters, digits, dot, dash, underscore, up to 64 characters Example: newsletter |
defaults.unsubscribe | Unsubscribe | List-Unsubscribe with one-click (RFC 8058). Needs a mail with exactly one recipient. Without this object the account setting unsubscribe_default decides. |
defaults.unsubscribe.enabled | boolean | Default: true |
defaults.unsubscribe.url | string (uri) | Your own https page instead of Sendtide's link; it must accept the one-click POST itself. Nothing is suppressed by Sendtide then. |
defaults.stream | string | Message stream: transactional (default) or one of your own (GET /v1/streams). broadcast and streams of kind broadcast are not available yet (403 broadcast_not_available) Example: transactional |
emails * | array<SendEmailRequest> | Same fields as SendEmailRequest above. |
Example
curl -X POST "https://api.sendtide.ch/v1/emails/batch" \
-H "Authorization: Bearer sk_test_…" \
-H "Idempotency-Key: order-4821" \
-H "Content-Type: application/json" \
-d '{"defaults":{"from":"Shop <hallo@example.ch>","template":"invoice","locale":"de-CH"},"emails":[{"to":"anna@example.com","data":{"amount":"120.00"}},{"to":"beat@example.com","data":{"amount":"80.00"}}]}' Responses
| Status | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
202 | Accepted Response fields
| ||||||||||||||||||
422 | Error in the usual format, errors and limits |
Send a complete MIME message
POST/v1/emails/mime
The message is sent as it is (Bcc removed). Envelope recipients default to To, Cc and Bcc.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Makes a repeated request safe (24 hours). |
Request body application/json
| Field | Type | Description |
|---|---|---|
raw * | string (base64) | RFC 5322 message, at most 10 MB |
to | array<string (email)> | |
tags | array<string> | |
send_at | string (date-time) |
Example
curl -X POST "https://api.sendtide.ch/v1/emails/mime" \
-H "Authorization: Bearer sk_test_…" \
-H "Idempotency-Key: order-4821" \
-H "Content-Type: application/json" \
-d '{"raw":"RnJvbTogaGFsbG9AZXhhbXBsZS5jaA0K…"}' Responses
| Status | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Repeat with the same Idempotency-Key EmailAccepted Response fields
| ||||||||||||
202 | Accepted EmailAccepted Response fields
| ||||||||||||
409 | Error in the usual format, errors and limits | ||||||||||||
422 | Error in the usual format, errors and limits |
Get an email with its events
GET/v1/emails/{id}
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | |
tenant | query | string | Slug of a sub-account to act for. |
Example
curl "https://api.sendtide.ch/v1/emails/msg_8kq2m4bt" \
-H "Authorization: Bearer sk_test_…" Responses
| Status | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | The email Email Response fields
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
404 | Error in the usual format, errors and limits |
Change the send time of a queued email
PATCH/v1/emails/{id}
Only while the mail is queued (409 not_reschedulable otherwise). send_at at most 72 hours ahead; a time in the past sends at once.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | |
tenant | query | string | Slug of a sub-account to act for. |
Request body application/json
| Field | Type | Description |
|---|---|---|
send_at * | string (date-time) |
Example
curl -X PATCH "https://api.sendtide.ch/v1/emails/msg_8kq2m4bt" \
-H "Authorization: Bearer sk_test_…" \
-H "Content-Type: application/json" \
-d '{"send_at":"2026-12-01T08:00:00Z"}' Responses
| Status | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
200 | Rescheduled Response fields
| |||||||||
404 | Error in the usual format, errors and limits | |||||||||
409 | Error in the usual format, errors and limits | |||||||||
422 | Error in the usual format, errors and limits |
Cancel a queued email
POST/v1/emails/{id}/cancel
Only while the mail is queued, that is scheduled or not yet taken by a worker (409 not_cancelable otherwise). The status becomes canceled and the event email.canceled is recorded. Recipients counted for today's usage are counted back.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | |
tenant | query | string | Slug of a sub-account to act for. |
Example
curl -X POST "https://api.sendtide.ch/v1/emails/msg_8kq2m4bt/cancel" \
-H "Authorization: Bearer sk_test_…" Responses
| Status | Description | ||||||
|---|---|---|---|---|---|---|---|
200 | Canceled Response fields
| ||||||
404 | Error in the usual format, errors and limits | ||||||
409 | Error in the usual format, errors and limits |
Cancel the queued emails of a batch
POST/v1/batches/{id}/cancel
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | |
tenant | query | string | Slug of a sub-account to act for. |
Example
curl -X POST "https://api.sendtide.ch/v1/batches/bat_4f8k2m9q/cancel" \
-H "Authorization: Bearer sk_test_…" Responses
| Status | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
200 | Result Response fields
| |||||||||
404 | Error in the usual format, errors and limits |
Unsubscribe page (public)
GET/u/{token} No API key
Shows a confirmation page with a button. Changes nothing, so mail scanners that open links cannot unsubscribe anybody. No API key.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
token * | path | string |
Example
curl "https://api.sendtide.ch/u/tok_…" Responses
| Status | Description |
|---|---|
200 | HTML page |
404 | Unknown token |
One-click unsubscribe (RFC 8058, public)
POST/u/{token} No API key
The mail client posts List-Unsubscribe=One-Click here. Adds a suppression with reason unsubscribe (for the mail's category, if it had one) and fires email.unsubscribed. Repeating it changes nothing. No API key.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
token * | path | string |
Example
curl -X POST "https://api.sendtide.ch/u/tok_…" Responses
| Status | Description |
|---|---|
200 | HTML page |
404 | Unknown token |
429 | Too many requests |