Unsubscribe a recipient
curl --request POST \ --url https://rocketem.fotone.io/api/v2/recipients/unsubscribe \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "audience": "aud_xxxxxxxxxxxx", "email": "hello@example.com", "reason": "gdpr-tool", "scope": "list" }'Required scope: subscriptions:write
Adds the email to the suppression list with reason ‘unsubscribe’.
With audience the opt-out is the row’s status in that audience table (doi_status = unsubscribed); the
organisation’s suppression list is not touched, so the person still receives the newsletter.
With scope=all the person is unsubscribed from everything: the suppression list gets reason
unsubscribe_all, which blocks the newsletter and every audience (use it for a shop’s global opt-out).
scope=all is accepted for any address, also one that is in no list yet, and ignores audience.
Authorizations
Abschnitt betitelt „Authorizations“Parameters
Abschnitt betitelt „Parameters“Header Parameters
Abschnitt betitelt „Header Parameters“Unique key for idempotent requests. Responses cached 24h.
Request Bodyrequired
Abschnitt betitelt „Request Bodyrequired“object
The audience to work on, by its identifier (aud_ plus 12 characters): in the app under Settings > Preference
Center > General (and Settings > API with Custom Audiences on), or as id in GET /audiences. The first audience’s identifier, or none, addresses the newsletter. A
Custom Audience’s table has no shop
figures (total_revenue, order_count, first_order_date, last_order_date: 422); the organisation’s
custom fields exist there too (since 2.3.0); its
doi_status is one of pending, confirmed, not_required, unsubscribed, cleaned. A newsletter opt-out does
not block an audience; complaints, bounces and legal blocks do.
Example
aud_xxxxxxxxxxxxSource/context for the unsubscribe (stored as ‘source’ in blacklist)
Example
gdpr-toollist (default) unsubscribes from the newsletter or the given audience only, all from everything. Since 2.2.0.
Responses
Abschnitt betitelt „Responses“Unsubscribed
object
object
Example
{ "data": { "status": "unsubscribed" }}Resource not found
object
object
Example generated
{ "error": { "code": "example", "message": "example", "status": 1 }}The unsubscribe could not be stored; nothing changed, send it again