Zum Inhalt springen

Opt-outs of an API send

GET
/campaigns/{campaignId}/unsubscribes
Code sample: Shell / cURL
curl --request GET \
--url 'https://rocketem.fotone.io/api/v2/campaigns/example/unsubscribes?limit=500' \
--header 'Authorization: Bearer <token>'

Required scope: messages:status

Who opted out of the mails of this API-send campaign, oldest first. Meant for the system that keeps the consents: fetch the list regularly with since and mark the addresses on your side, instead of learning of an opt-out only from 422 not_sent at the next call.

An opt-out applies to this campaign. “Unsubscribe from everything” additionally puts the address on the organisation’s suppression list (GET /suppression).

since returns what was unsubscribed or lifted from that moment on. At most 500 entries per answer; while meta.has_more is true, continue with after=<meta.next_after>.

Requires the messages:status scope. email is part of the answer only for a token that also has messages:status_pii (or recipients:read_pii). email_sha256 (SHA-256 of the trimmed, lower-cased address) lets you match addresses you hold; it is there for a token that may hand mails in (campaigns:trigger) or read addresses. An address erased on request is null.

since needs a UTC offset (2026-11-12T00:00:00+01:00 or …Z).

campaignId
required
string

Campaign public_id

since
string format: date-time
after
integer

meta.next_after of the previous answer

limit
integer
default: 500 >= 1 <= 500

Opt-outs

Media typeapplication/json
object
data
Array<object>
object
id
integer
email

Only with messages:status_pii or recipients:read_pii

string
nullable
email_sha256

Only with campaigns:trigger, messages:status_pii or recipients:read_pii

string
status
string
Allowed values: unsubscribed lifted
source

user_request (unsubscribe page or one click in the mail client), mailto_unsubscribe (mail to the unsubscribe address)

string
nullable
unsubscribed_at
string format: date-time
nullable
lifted_at
string format: date-time
nullable
meta
object
has_more
boolean
next_after
integer
nullable

Example

{
"data": [
{
"id": 12,
"email_sha256": "973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b",
"status": "unsubscribed",
"source": "user_request",
"unsubscribed_at": "2026-11-12T09:15:02+01:00",
"lifted_at": null
}
],
"meta": {
"has_more": false,
"next_after": null
}
}

Missing scope, request IP not allowed for this key, or organisation inactive

Resource not found

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

Example generated

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

since without a UTC offset, or after/limit out of range

Too many requests; repeat after Retry-After seconds

The opt-outs could not be read right now. Ask again after Retry-After seconds.

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

Example

{
"error": {
"code": "retry_later",
"message": "Not available right now. Ask again after Retry-After seconds.",
"status": 503
}
}
Retry-After
integer

Seconds to wait