Warteliste offen: Hol dir früh Zugang

API-Referenz: Exporte

5 Endpunkte der Gruppe «Exporte». Die Referenz stammt aus der englischen OpenAPI-Spezifikation und ist nicht übersetzt.

Download mail as CSV or JSON Lines (streamed)

GET/v1/emails/export

The mail of a range (default: the last 30 days) with the filters of the search, newest last. Up to 100'000 mails; more is 422 range_too_large, use POST /v1/exports. JSON Lines carry recipients and events, CSV the flat columns. Cells that start with =, +, - or @ get a leading quote, so spreadsheets do not run them.

Parameter

NameOrtTypBeschreibung
format *queryenum: csv | jsonl
qquerystringSame query language as GET /v1/emails
sincequerystring (date-time)
untilquerystring (date-time)

Beispiel

curl "https://api.sendtide.ch/v1/emails/export?format=csv" \
  -H "Authorization: Bearer sk_test_…"

Antworten

StatusBeschreibung
200 The file
422 Fehler im üblichen Format, Fehler und Limits

List exports

GET/v1/exports

Beispiel

curl "https://api.sendtide.ch/v1/exports" \
  -H "Authorization: Bearer sk_test_…"

Antworten

StatusBeschreibung
200 The latest exports
Felder der Antwort
dataarray<Export>
data[].idstringExample: exp_8kq2m4bt
data[].kindenum: emails | account
data[].formatenum: csv | jsonl | zip
data[].statusenum: pending | running | ready | failed
data[].errorstring | null
data[].rowsinteger
data[].sizeintegerBytes of the file
data[].paramsobject
data[].created_atstring (date-time)
data[].finished_atstring | null (date-time)
data[].expires_atstring | null (date-time)24 hours after the file is ready
data[].download_urlstring | nullWhile the export is ready, only in GET /v1/exports/{id}, and only in the first read after it is ready (the token is stored hashed); ?new_link=true makes a new link and the earlier one stops working. Bucket exports get a presigned link on every read. Needs no key
next_cursorstring | null

Export mail as a job

POST/v1/exports

The scheduler builds a gzip file (CSV or JSON Lines) of the mail of a range with the filters of the search. Poll GET /v1/exports/{id}. source archive or all includes the archive (Scale plan, 403 plan_limit otherwise); all needs jsonl. At most 5 exports are open at once (429 too_many_exports).

Request-Body application/json

FeldTypBeschreibung
format *enum: csv | jsonl
qstring
sincestring (date-time)
untilstring (date-time)
sourceenum: live | archive | allDefault: "live"

Beispiel

curl -X POST "https://api.sendtide.ch/v1/exports" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"format":"jsonl","q":"status:bounced","since":"2026-11-01T00:00:00Z"}'

Antworten

StatusBeschreibung
202 Accepted Export
Felder der Antwort
idstringExample: exp_8kq2m4bt
kindenum: emails | account
formatenum: csv | jsonl | zip
statusenum: pending | running | ready | failed
errorstring | null
rowsinteger
sizeintegerBytes of the file
paramsobject
created_atstring (date-time)
finished_atstring | null (date-time)
expires_atstring | null (date-time)24 hours after the file is ready
download_urlstring | nullWhile the export is ready, only in GET /v1/exports/{id}, and only in the first read after it is ready (the token is stored hashed); ?new_link=true makes a new link and the earlier one stops working. Bucket exports get a presigned link on every read. Needs no key
403 Fehler im üblichen Format, Fehler und Limits
422 Fehler im üblichen Format, Fehler und Limits
429 Fehler im üblichen Format, Fehler und Limits

Status of an export, and its download link

GET/v1/exports/{id}

download_url is set while the export is ready; the link works for 24 hours after that and needs no key. After that the file is gone (status: failed, error: expired).

Parameter

NameOrtTypBeschreibung
id *pathstring

Beispiel

curl "https://api.sendtide.ch/v1/exports/exp_8kq2m4bt" \
  -H "Authorization: Bearer sk_test_…"

Antworten

StatusBeschreibung
200 The export Export
Felder der Antwort
idstringExample: exp_8kq2m4bt
kindenum: emails | account
formatenum: csv | jsonl | zip
statusenum: pending | running | ready | failed
errorstring | null
rowsinteger
sizeintegerBytes of the file
paramsobject
created_atstring (date-time)
finished_atstring | null (date-time)
expires_atstring | null (date-time)24 hours after the file is ready
download_urlstring | nullWhile the export is ready, only in GET /v1/exports/{id}, and only in the first read after it is ready (the token is stored hashed); ?new_link=true makes a new link and the earlier one stops working. Bucket exports get a presigned link on every read. Needs no key
404 Fehler im üblichen Format, Fehler und Limits

Export all data of the account (owner, dashboard session only)

POST/v1/account/export

A zip of JSON files with everything the account holds (nDSG requests). Passwords, key hashes and other secrets are not included. Follow it like any export.

Beispiel

curl -X POST "https://api.sendtide.ch/v1/account/export" \
  -H "Authorization: Bearer sk_test_…"

Antworten

StatusBeschreibung
202 Accepted Export
Felder der Antwort
idstringExample: exp_8kq2m4bt
kindenum: emails | account
formatenum: csv | jsonl | zip
statusenum: pending | running | ready | failed
errorstring | null
rowsinteger
sizeintegerBytes of the file
paramsobject
created_atstring (date-time)
finished_atstring | null (date-time)
expires_atstring | null (date-time)24 hours after the file is ready
download_urlstring | nullWhile the export is ready, only in GET /v1/exports/{id}, and only in the first read after it is ready (the token is stored hashed); ?new_link=true makes a new link and the earlier one stops working. Bucket exports get a presigned link on every read. Needs no key
403 Fehler im üblichen Format, Fehler und Limits