Zum Inhalt springen

Add email to suppression list

POST
/suppression
Code sample: Shell / cURL
curl --request POST \
--url https://rocketem.fotone.io/api/v2/suppression \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "hello@example.com", "emails": [ "hello@example.com" ], "reason": "manual", "delete_recipient": false, "dry_run": false, "history": false }'

Required scope: suppression:write

Adds an email to the suppression list. Reason must be ‘manual’, ‘unsubscribe’, ‘shop_unsubscribe’ or ‘unsubscribe_all’. ‘unsubscribe’ and ‘shop_unsubscribe’ are newsletter opt-outs and do not block audiences; ‘unsubscribe_all’ blocks every list. ‘legal’ reason is reserved for GDPR deletions via DELETE /recipients, ‘block_all’ (every mail blocked, transactional ones included) for the app’s privacy page; neither can be set or removed through this API. A write that could not be stored answers 503 (single address), nothing changed.

One entry per address: a stronger reason replaces a weaker existing one (block_all > legal > robinson > complaint > manual > bounce/none > unsubscribe_all > legacy_unsubscribe > unsubscribe > shop_unsubscribe); a weaker or equal reason leaves the entry as it is; a block no DOI click lifts (manual, bounce, no reason) is never replaced by a complaint. Addresses are compared in canonical form (lower case, IDN domains as punycode).

The delete_recipient flag additionally triggers a full GDPR deletion. Note: this is equivalent to calling DELETE /recipients directly, which is the recommended approach for GDPR deletions.

Supports dry_run=true: reports whether the email is already suppressed and — when combined with delete_recipient=true — what GDPR deletion would affect, without writing anything. The scope check still runs and can return 403.

A batch: emails with up to 1000 addresses instead of email, one reason for all, no delete_recipient. The answer counts what was added, what was there already and what could not be stored, with one result per address in the order sent; dry_run counts without writing. history: true marks the addresses as taken over from another system (no automation event, no shop writeback). A batch draws on the bulk quota (10 per minute per organisation), not on the per-address write limit.

Idempotency-Key
string
<= 255 characters

Unique key for idempotent requests. Responses cached 24h.

Media typeapplication/json
object
email

One address (required without emails)

string format: email
emails

A batch of addresses instead of email; not with delete_recipient

Array<string>
<= 1000 items
reason
string
default: manual
Allowed values: manual unsubscribe shop_unsubscribe unsubscribe_all
delete_recipient

Also GDPR-delete the recipient (requires recipients:delete scope); not with emails

boolean
dry_run

Preview only — nothing is suppressed or deleted

boolean
history

Batch only: the opt-outs are history from another system, no automation event and no shop writeback

boolean

Dry-run preview (only when dry_run=true)

Media typeapplication/json
object
data
object
dry_run
boolean
email_hash
string
would_suppress
boolean
already_suppressed
boolean
existing_reason
string
nullable
would_delete_recipient

Only present if delete_recipient=true

boolean
gdpr

Only present if delete_recipient=true

object
email_found
boolean
total_records
integer
would_affect
object
has_external_source

Active (not switched-off) data sources such as shop connectors may hold more data

boolean
deletion_record
object

Example generated

{
"data": {
"dry_run": true,
"email_hash": "example",
"would_suppress": true,
"already_suppressed": true,
"existing_reason": "example",
"would_delete_recipient": true,
"gdpr": {
"email_found": true,
"total_records": 1,
"would_affect": {},
"has_external_source": true,
"deletion_record": {}
}
}
}

Added to suppression list (only when dry_run=false). With emails the counts of the batch and one result per address.

Media typeapplication/json
object
data
object
suppressed

One address: stored. Batch: how many were added (integer)

boolean
email_hash

One address only

string
deleted

Only present if delete_recipient=true. false when the deletion failed: the address is suppressed anyway, send the deletion again

boolean
submitted

Batch only

integer
already_suppressed

Batch only (dry_run too)

integer
failed

Batch only: invalid after normalisation or not storable

integer
would_suppress

Batch dry_run only

integer
results

Batch only, in the order sent

Array<object>
object
index
integer
email_hash
string
suppressed
boolean
already_suppressed
boolean
existing_reason
string
nullable
error

Only when the address was not stored

string

Example generated

{
"data": {
"suppressed": true,
"email_hash": "example",
"deleted": true,
"submitted": 1,
"already_suppressed": 1,
"failed": 1,
"would_suppress": 1,
"results": [
{
"index": 1,
"email_hash": "example",
"suppressed": true,
"already_suppressed": true,
"existing_reason": "example",
"error": "example"
}
]
}
}

Token lacks required scope

Media typeapplication/json
object
error
object
code
string
message
string
status
integer

Example generated

{
"error": {
"code": "example",
"message": "example",
"status": 1
}
}