List opt-outs in the workspace
Return a workspace-wide list of opt-outs across all channels. Each entry represents a person and the senders/channels (SMS or WhatsApp) they've opted out of.
A person opts out of a specific sender on a specific channel—for example, a person can opt out of SMS messages from one sender number while continuing to receive messages from another. An entry's presence in the optouts array means the person is opted out of that sender/channel.
Use the from parameter to filter for a specific sender. Use the start parameter with the next value from the previous response to paginate through results.
Note: SMS sender values are stored normalized (trimmed and lowercased). For alphanumeric SMS senders and messaging-service SIDs, the response recovers the original casing from your workspace's Twilio sender identities. E.164 phone numbers are unaffected.
- Type: stringfrom
Filter for a specific sender on any channel. For SMS, this is a sender phone number (E.164), an alphanumeric sender ID, or a messaging-service SID; for WhatsApp, it's the sender phone number.
- Type: stringstart
A pagination cursor—a base64-encoded value returned in the
nextproperty of the previous page. Omit this parameter to return the first page; pass the previous page'snextvalue to return the following page. - Type: integerlimitmax:1000
The maximum number of results you want to retrieve per page.
- application/json
- 401
Unauthorized request. Make sure that you provided the right credentials.
- 429
Your request is over the 10-per-second limit.
curl 'https://api.customer.io/v1/optouts?from=%2B15551234567&start=MTox&limit=100' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"optouts": [
{
"customer_id": "abc123",
"cio_id": "cio_03000001",
"optouts": [
{
"channel": "sms",
"from": "+15551234567"
},
{
"channel": "whatsapp",
"from": "+15559876543"
}
]
}
],
"next": "MTox"
}Returns an array of opt-out records, one per person.