Warteliste offen: Hol dir früh Zugang

API-Referenz: Sperrliste

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

List suppressed addresses

GET/v1/suppressions

Parameter

NameOrtTypBeschreibung
qquerystring
reasonqueryenum: bounce | complaint | unsubscribe | manual
limitqueryintegerPage 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
cursorquerystringThe next_cursor of the previous page. Opaque; pass it unchanged to the same endpoint with the same filters.
afterveraltetquerystringDeprecated, use cursor. The address to continue after.

Beispiel

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

Antworten

StatusBeschreibung
200 Addresses
Felder der Antwort
dataarray<Suppression>
data[].addressstring
data[].reasonenum: bounce | complaint | unsubscribe | manual
data[].categorystringEmpty: all mail. Otherwise only mail of this category.
data[].created_atstring (date-time)
data[].bounce_classstring | nullFor a bounce: Sendtide's class (unknown_user, mailbox_full, policy_block ...)
data[].bounce_severityenum: hard | soft | block | unknown | null
data[].bounce_explanationstring | nullGerman
data[].bounce_actionstring | nullGerman
next_cursorstring | null
nextstring
removalsSuppressionRemovalsHow many bounce suppressions the account may still remove today (UTC day).
removals.limitintegerExample: 100
removals.usedinteger
removals.remaininginteger

Suppress an address

POST/v1/suppressions

With a category the address is only suppressed for mail of that category.

Request-Body application/json

FeldTypBeschreibung
address *string (email)
reasonenum: manual | unsubscribe
categorystringExample: newsletter

Beispiel

curl -X POST "https://api.sendtide.ch/v1/suppressions" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"address":"anna@example.com","category":"newsletter"}'

Antworten

StatusBeschreibung
201 Added

Import a CSV of suppressed addresses

POST/v1/suppressions/import

Send the CSV as text/csv or as the file field of a multipart/form-data form (at most 16 MB, 100'000 rows, else 422 too_many_rows). Columns: email (or address), reason (manual, unsubscribe, bounce, complaint; default manual), category, created_at (RFC 3339 or YYYY-MM-DD), with a header row or in this order without one. Rows are deduplicated (address and category); addresses that are already listed stay as they are. Invalid rows are reported (the first 100), all others are imported.

Request-Body text/csv

Beispiel

curl -X POST "https://api.sendtide.ch/v1/suppressions/import" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: text/csv" \
  --data-binary @suppressions.csv

Antworten

StatusBeschreibung
200 Result
Felder der Antwort
rowsintegerRows read
importedinteger
already_listedinteger
duplicates_in_fileinteger
invalidinteger
invalid_rowsarray<object>
invalid_rows[].rowinteger
invalid_rows[].emailstring
invalid_rows[].errorstring
422 Fehler im üblichen Format, Fehler und Limits

Export the suppression list as CSV

GET/v1/suppressions/export

Columns email,reason,category,created_at, streamed. A cell that starts with = + - or @ gets a leading quote, so a spreadsheet does not run it; the import removes it.

Parameter

NameOrtTypBeschreibung
reasonqueryenum: bounce | complaint | unsubscribe | manual

Beispiel

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

Antworten

StatusBeschreibung
200 The CSV

Allow up to 10'000 addresses again

POST/v1/suppressions/delete

Complaints stay on the list and are counted in locked. Removing bounce suppressions is limited to 100 per day and account (UTC day); a request that would go over the limit removes nothing and answers 429 suppression_removal_limit. The allowance is removals in listSuppressions.

Request-Body application/json

FeldTypBeschreibung
emails *array<string (email)>

Beispiel

curl -X POST "https://api.sendtide.ch/v1/suppressions/delete" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"emails":["anna@example.com"]}'

Antworten

StatusBeschreibung
200 Result
Felder der Antwort
deletedinteger
lockedintegerAddresses kept because the recipient complained
429 More bounce suppressions than today's allowance (suppression_removal_limit), nothing was removed

Allow an address again

DELETE/v1/suppressions/{address}

Removes the address for every category. A complaint cannot be removed (409 suppression_locked). Bounce suppressions can be removed 100 times per day and account (UTC day), then 429 suppression_removal_limit.

Parameter

NameOrtTypBeschreibung
address *pathstring

Beispiel

curl -X DELETE "https://api.sendtide.ch/v1/suppressions/anna@example.org" \
  -H "Authorization: Bearer sk_test_…"

Antworten

StatusBeschreibung
204 Removed
409 The recipient complained
429 Today's allowance of bounce removals is used up (suppression_removal_limit)