Update a customer's opt-outs
Opt a person out of, or back in to, specific senders and channels. Provide one entry per sender/channel in the optouts array.
Set optout to true to opt the person out of a sender, or false to opt them back in. The channel field is optional and defaults to sms.
This request is processed asynchronously; it may take a moment for changes to reflect in read requests.
- Type: stringcustomer
_id requiredThe ID of the customer you want to perform an operation against.
- Type: stringenumid
_type The type of
customer_idyou want to use to reference a person. If you don't provide this parameter, we assume that thecustomer_idin your request is a person'sid. You can useemailandphoneonly if they're enabled as identifiers in your workspace settings; otherwise the request returns400. Referencephonevalues in E.164 format, like+14155552671, and URL-encode the leading+as%2B.values- id
- email
- phone
- cio
_id
- Type: array object[]optoutsrequired
The senders and channels you want to opt the person out of, or back in to. Provide one entry per sender/channel.
- 204
A successful request produces an empty response.
- 400
The request is malformed—for example, it references an unknown
channel. - 404
The
customer_iddoes not exist. - 429
Your request is over the 10-per-second limit.
curl 'https://api.customer.io/v1/customers/12345/optouts?id_type=id' \
--request PUT \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"optouts": [
{
"from": "+15551234567",
"optout": true,
"channel": "sms"
}
]
}'
A successful request produces an empty response.