Zum Inhalt springen

Replace topic preferences for a recipient

PUT
/recipients/preferences
Code sample: Shell / cURL
curl --request PUT \
--url https://rocketem.fotone.io/api/v2/recipients/preferences \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "customer@example.com", "opted_out_topics": [ "tp_a1b2c3d4", "tp_e5f6a7b8" ] }'

Required scope: preferences:write

FULL-SET update: the submitted opted_out_topics list REPLACES all existing opt-outs for that email. An empty array opts the email back in to every topic. Unknown, inactive or deleted topic ids are rejected with 422 (unknown_topics) — nothing is silently dropped.

Opt-out model: topics not listed are opted in. Changes made here are recorded with source api. An address deleted per GDPR request is refused with 409, nothing is stored for it.

Requires preferences:write scope.

Idempotency-Key
string
<= 255 characters

Unique key for idempotent requests. Responses cached 24h.

Media typeapplication/json
object
audience

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.

string
/^aud_[A-Za-z0-9]{12}$/
email
required
string format: email
opted_out_topics
required

Topic public_ids the email opts OUT of (full set — replaces all existing opt-outs)

Array<string>

Example

{
"email": "customer@example.com",
"opted_out_topics": [
"tp_a1b2c3d4",
"tp_e5f6a7b8"
]
}

Preference state after the update

Media typeapplication/json
object
data

Topic opt-out state for one email (opt-out model — no entry = opted in)

object
email_hash

HMAC-SHA256 hash of the email

string
opted_out_topics
Array<object>
object
id

Topic public_id

string
name
string
opted_out_at
string format: date-time
source

Where the opt-out came from (e.g. preference_center, api)

string
opted_in_topics

Public ids of all active topics the email is NOT opted out of

Array<string>

Example generated

{
"data": {
"email_hash": "example",
"opted_out_topics": [
{
"id": "example",
"name": "example",
"opted_out_at": "2026-04-15T12:00:00Z",
"source": "example"
}
],
"opted_in_topics": [
"example"
]
}
}

Invalid or missing API token

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

Example generated

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

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
}
}

Validation failed, or unknown/inactive topic ids (unknown_topics)

Media typeapplication/json
object
error
object
code
string
message
string
status
integer
details
object
key
additional properties
Array<string>

Example

{
"error": {
"code": "validation_error",
"message": "The given data was invalid.",
"status": 422
}
}

Organisation not configured for API access

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

Example generated

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