Zum Inhalt springen

Record tracking consent or its withdrawal

PUT
/recipients/tracking-consent
Code sample: Shell / cURL
curl --request PUT \
--url https://rocketem.fotone.io/api/v2/recipients/tracking-consent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "email": "customer@example.com", "status": "granted", "occurred_at": "2026-10-12T14:03:00+02:00", "text_version": "shop-2026-10" }'

Required scope: tracking_consent:write

granted records consent, revoked withdraws it (open/click events of the address are anonymised). A consent only replaces an existing withdrawal when occurred_at is later than that withdrawal (otherwise 409 revoked_later); a withdrawal dated before an existing consent changes nothing (409 granted_later). An existing consent keeps its original date and proof. Send occurred_at with the time the person decided in your system; consent without it is stored as undated. No IP address is stored for API calls. A withdrawal the person made themselves in rocketEM (consent page, preference center, unsubscribe) can only be lifted by the person: the answer is 409 revoked_by_recipient. Recorded with source api.

Requires tracking_consent:write scope.

Idempotency-Key
string
<= 255 characters

Unique key for idempotent requests. Responses cached 24h.

Media typeapplication/json
object
email
required
string format: email
status
required
string
Allowed values: granted revoked
occurred_at

When it happened (not in the future). Without it a consent never replaces a withdrawal.

string format: date-time
text_version

Identifier of the consent wording shown (stored as api:<value>); for status granted it requires occurred_at; ignored for revoked

string
<= 28 characters

Example

{
"email": "customer@example.com",
"status": "granted",
"occurred_at": "2026-10-12T14:03:00+02:00",
"text_version": "shop-2026-10"
}

Consent state after the update

Media typeapplication/json
object
data
object
email_hash
string
status
string
nullable
Allowed values: granted revoked
granted_at
string format: date-time
nullable
revoked_at
string format: date-time
nullable
source

Signup, consent_page, preference_center, import, api, unsubscribe, shop_unsubscribe, blocked

string
nullable
tracking_allowed

Whether opens and clicks of this address are recorded right now

boolean

Example

{
"data": {
"status": "granted"
}
}

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

A newer or equally dated withdrawal (revoked_later), a withdrawal by the person (revoked_by_recipient), a newer or equally dated consent (granted_later), or the address was deleted per GDPR request (conflict); nothing changed

Validation failed

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