API-Referenz: E-Mails
10 Endpunkte der Gruppe «E-Mails». Die Referenz stammt aus der englischen OpenAPI-Spezifikation und ist nicht übersetzt.
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}.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
Idempotency-Key | header | string | Makes a repeated request safe (24 hours). |
Request-Body application/json
| Feld | Typ | Beschreibung |
|---|---|---|
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 |
Beispiel
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>"}' Antworten
| Status | Beschreibung | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Repeat of an idempotent request EmailAccepted Felder der Antwort
| ||||||||||||
202 | Accepted EmailAccepted Felder der Antwort
| ||||||||||||
400 | Fehler im üblichen Format, Fehler und Limits | ||||||||||||
401 | Fehler im üblichen Format, Fehler und Limits | ||||||||||||
409 | Fehler im üblichen Format, Fehler und Limits | ||||||||||||
422 | Fehler im üblichen Format, Fehler und Limits | ||||||||||||
429 | Fehler im üblichen Format, Fehler und 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.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
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. |
Beispiel
curl "https://api.sendtide.ch/v1/emails" \
-H "Authorization: Bearer sk_test_…" Antworten
| Status | Beschreibung | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Results Felder der Antwort
|
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.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
Idempotency-Key | header | string | Makes a repeated request safe (24 hours). |
Request-Body application/json
| Feld | Typ | Beschreibung |
|---|---|---|
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. |
Beispiel
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"}}]}' Antworten
| Status | Beschreibung | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
202 | Accepted Felder der Antwort
| ||||||||||||||||||
422 | Fehler im üblichen Format, Fehler und 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.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
Idempotency-Key | header | string | Makes a repeated request safe (24 hours). |
Request-Body application/json
| Feld | Typ | Beschreibung |
|---|---|---|
raw * | string (base64) | RFC 5322 message, at most 10 MB |
to | array<string (email)> | |
tags | array<string> | |
send_at | string (date-time) |
Beispiel
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…"}' Antworten
| Status | Beschreibung | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | Repeat with the same Idempotency-Key EmailAccepted Felder der Antwort
| ||||||||||||
202 | Accepted EmailAccepted Felder der Antwort
| ||||||||||||
409 | Fehler im üblichen Format, Fehler und Limits | ||||||||||||
422 | Fehler im üblichen Format, Fehler und Limits |
Get an email with its events
GET/v1/emails/{id}
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
id * | path | string | |
tenant | query | string | Slug of a sub-account to act for. |
Beispiel
curl "https://api.sendtide.ch/v1/emails/msg_8kq2m4bt" \
-H "Authorization: Bearer sk_test_…" Antworten
| Status | Beschreibung | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
200 | The email Email Felder der Antwort
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
404 | Fehler im üblichen Format, Fehler und 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.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
id * | path | string | |
tenant | query | string | Slug of a sub-account to act for. |
Request-Body application/json
| Feld | Typ | Beschreibung |
|---|---|---|
send_at * | string (date-time) |
Beispiel
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"}' Antworten
| Status | Beschreibung | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
200 | Rescheduled Felder der Antwort
| |||||||||
404 | Fehler im üblichen Format, Fehler und Limits | |||||||||
409 | Fehler im üblichen Format, Fehler und Limits | |||||||||
422 | Fehler im üblichen Format, Fehler und 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.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
id * | path | string | |
tenant | query | string | Slug of a sub-account to act for. |
Beispiel
curl -X POST "https://api.sendtide.ch/v1/emails/msg_8kq2m4bt/cancel" \
-H "Authorization: Bearer sk_test_…" Antworten
| Status | Beschreibung | ||||||
|---|---|---|---|---|---|---|---|
200 | Canceled Felder der Antwort
| ||||||
404 | Fehler im üblichen Format, Fehler und Limits | ||||||
409 | Fehler im üblichen Format, Fehler und Limits |
Cancel the queued emails of a batch
POST/v1/batches/{id}/cancel
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
id * | path | string | |
tenant | query | string | Slug of a sub-account to act for. |
Beispiel
curl -X POST "https://api.sendtide.ch/v1/batches/bat_4f8k2m9q/cancel" \
-H "Authorization: Bearer sk_test_…" Antworten
| Status | Beschreibung | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
200 | Result Felder der Antwort
| |||||||||
404 | Fehler im üblichen Format, Fehler und Limits |
Unsubscribe page (public)
GET/u/{token} Ohne API-Key
Shows a confirmation page with a button. Changes nothing, so mail scanners that open links cannot unsubscribe anybody. No API key.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
token * | path | string |
Beispiel
curl "https://api.sendtide.ch/u/tok_…" Antworten
| Status | Beschreibung |
|---|---|
200 | HTML page |
404 | Unknown token |
One-click unsubscribe (RFC 8058, public)
POST/u/{token} Ohne 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.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
token * | path | string |
Beispiel
curl -X POST "https://api.sendtide.ch/u/tok_…" Antworten
| Status | Beschreibung |
|---|---|
200 | HTML page |
404 | Unknown token |
429 | Too many requests |