curl --request POST \
--url https://apix.spotzee.com/api/client/subscriptions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"subscription_id": 7,
"state": 1,
"external_id": "cust-9f4b21",
"anonymous_id": "<string>"
}
]
'{
"results": [
{
"index": 0,
"subscription_id": 123,
"external_id": "<string>",
"anonymous_id": "<string>",
"state": 1,
"error": {
"code": "resource_missing",
"message": "Contact identity could not be resolved."
}
}
],
"succeeded": 99,
"failed": 1
}Subscribes or unsubscribes one or more contacts across one or more subscription types in a single call. Each item identifies its target contact by external_id or anonymous_id. Up to 100 toggles per request; the response reports per-item success or failure. Toggling to the current state is a no-op (idempotent).
Idempotent — pass an Idempotency-Key header to make safely retryable. On a replay the original response is returned with Idempotent-Replayed: true. See the API conventions guide for the full state machine, TTL, and mismatch behaviour.
curl --request POST \
--url https://apix.spotzee.com/api/client/subscriptions/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"subscription_id": 7,
"state": 1,
"external_id": "cust-9f4b21",
"anonymous_id": "<string>"
}
]
'{
"results": [
{
"index": 0,
"subscription_id": 123,
"external_id": "<string>",
"anonymous_id": "<string>",
"state": 1,
"error": {
"code": "resource_missing",
"message": "Contact identity could not be resolved."
}
}
],
"succeeded": 99,
"failed": 1
}Documentation Index
Fetch the complete documentation index at: https://docs.spotzee.com/llms.txt
Use this file to discover all available pages before exploring further.
Project-scoped secret API key (sk_…). Pass in the Authorization: Bearer <key> header. Grants access to the project the key was issued for.
1 - 100 elementsNumeric subscription-type identifier to toggle.
7
Subscription state: 0 unsubscribed, 1 subscribed, 2 explicit double-opt-in. Reads return the current state; writes accept any of the three values to set it.
0 1
External identifier for the contact whose state is being toggled. Either external_id or anonymous_id must be present.
"cust-9f4b21"
Anonymous identifier for the contact whose state is being toggled. Either external_id or anonymous_id must be present.
Per-item toggle outcomes. Partial success is allowed.
Synchronous result of a cross-contact bulk subscription state-toggle.
Per-item outcomes in the same order as the request body.
Hide child attributes
Position of this item in the request body, zero-indexed.
0
Numeric subscription-type identifier the caller targeted.
External identifier the caller supplied, echoed for correlation.
Anonymous identifier the caller supplied, echoed for correlation.
New state, present when the toggle succeeded.
0 1
Failure detail, present when the toggle could not be applied.
Count of toggles that applied successfully.
99
Count of toggles that failed.
1
Was this page helpful?