Skip to main content
POST
/
subscriptions
/
batch
Bulk toggle subscription states across many contacts
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.

Authorizations

Authorization
string
header
required

Project-scoped secret API key (sk_…). Pass in the Authorization: Bearer <key> header. Grants access to the project the key was issued for.

Body

application/json
Required array length: 1 - 100 elements
subscription_id
integer
required

Numeric subscription-type identifier to toggle.

Example:

7

state
required

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.

Available options:
0
Example:

1

external_id
string | null

External identifier for the contact whose state is being toggled. Either external_id or anonymous_id must be present.

Example:

"cust-9f4b21"

anonymous_id
string | null

Anonymous identifier for the contact whose state is being toggled. Either external_id or anonymous_id must be present.

Response

Per-item toggle outcomes. Partial success is allowed.

Synchronous result of a cross-contact bulk subscription state-toggle.

results
object[]
required

Per-item outcomes in the same order as the request body.

succeeded
integer
required

Count of toggles that applied successfully.

Example:

99

failed
integer
required

Count of toggles that failed.

Example:

1