Opt a contact out of messaging
curl --request POST \ --url https://api.sipstack.com/api/v2/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/opt-out \ --header 'x-api-key: <x-api-key>'import requests
url = "https://api.sipstack.com/api/v2/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/opt-out"
headers = {"x-api-key": "<x-api-key>"}
response = requests.post(url, headers=headers)
print(response.json())const url = 'https://api.sipstack.com/api/v2/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/opt-out';const options = {method: 'POST', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}import axios from 'axios';
const options = { method: 'POST', url: 'https://api.sipstack.com/api/v2/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/opt-out', headers: {'x-api-key': '<x-api-key>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}Sets the real send gate for a contact: flips is_opted_out to true
and adds the contact’s number to your organization’s STOP list, so
campaign and dispatch send-paths both exclude them. This is the
compliance-correct way to suppress a contact — updating consent_status
via PATCH alone does not stop delivery. Requires contacts:write.
Idempotent. 404 when the contact isn’t your organization’s (absent,
cross-org, or soft-deleted).
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Responses
Section titled “ Responses ”Contact opted out.
object
Example
{ "message": "Contact opted out successfully"}Missing or invalid API key.
Inline error shape used by the messaging API and management endpoints.
object
Example
{ "success": false, "error": "Recipient phone number (to) is required"}The key is missing the contacts:write scope, or the Flare API tier is not on your plan.
Inline error shape used by the messaging API and management endpoints.
object
Example
{ "success": false, "error": "Recipient phone number (to) is required"}Contact not found in your organization.
Inline error shape used by the messaging API and management endpoints.
object
Example
{ "success": false, "error": "Recipient phone number (to) is required"}