Download OpenAPI specification:Download
By using the Opt-in & Opt-out service, it's possible to register an opt-in or an opt-out event for a contact with the underlying channel. In order to execute the request, either the contactId of the contact or its channel recipient identities are required.
Requests are executed asynchronously, therefore the endpoint immediately returns the registered request. The result of the Opt-in or Opt-out request is posted to the webhook which has an OPT_IN or OPT_OUT trigger respectively. To read more about setting up webhooks go to Webhooks.
This method is asynchronous - it returns immediately the requested OptIn registration with any defaults resolved. All changes of the actual opt-in status are then delivered as callbacks to registered webhooks with trigger OPT_IN.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
The opt-in request.
app_id required | string The app for which the Opt-In is being registered. | ||||||
channels required | Array of strings (Channel Identifier) The channels covered by this Opt-In. The default are all the channels for a contact if recipient is contact_id or the channels in the channel_identities list. | ||||||
required | contact_id (object) or identified_by (object) The recipient to opt-in. Requires either | ||||||
processing_strategy | string (ProcessingStrategy) Overrides the app's Processing Mode. Default value is
|
A successful response.
Malformed request
Incorrect credentials
Correct credentials but you don't have access to the requested resource
Correct credentials but you don't have access to the requested resource
Something went wrong on our end, try again with exponential back-off
{- "app_id": "{APP_ID}",
- "channels": [
- "WHATSAPP"
], - "recipient": {
- "contact_id": "{CONTACT_ID}"
}
}
{- "opt_in": {
- "app_id": "{APP_ID}",
- "channels": [
- "WHATSAPP"
], - "recipient": {
- "contact_id": "{CONTACT_ID}"
}, - "processing_strategy": "DEFAULT"
}, - "request_id": "string"
}
This method is asynchronous - it returns immediately the requested OptOut registration with any defaults resolved. All changes of the actual opt-out status are then delivered as callbacks to registered webhooks with trigger OPT_OUT.
project_id required | string The unique ID of the project. You can find this on the Sinch Dashboard. |
The opt-out request.
app_id required | string The app for which the Opt-Out is being registered. | ||||||
channels required | Array of strings (Channel Identifier) The channels covered by this Opt-Out. The default are all the channels for a contact if recipient is contact_id or the channels in the channel_identities list. | ||||||
required | contact_id (object) or identified_by (object) The recipient to opt-out. Requires either | ||||||
processing_strategy | string (ProcessingStrategy) Overrides the app's Processing Mode. Default value is
|
A successful response.
Malformed request
Incorrect credentials
Correct credentials but you don't have access to the requested resource
Correct credentials but you don't have access to the requested resource
Something went wrong on our end, try again with exponential back-off
{- "app_id": "{APP_ID}",
- "channels": [
- "WHATSAPP"
], - "recipient": {
- "contact_id": "{CONTACT_ID}"
}
}
{- "opt_out": {
- "app_id": "{APP_ID}",
- "channels": [
- "WHATSAPP"
], - "recipient": {
- "contact_id": "{CONTACT_ID}"
}, - "processing_strategy": "DEFAULT"
}, - "request_id": "string"
}