Opt a contact back into messaging
curl --request POST \ --url https://api.sipstack.com/api/v2/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/opt-in \ --header 'Content-Type: application/json' \ --header 'x-api-key: <x-api-key>' \ --data '{ "reason": "Signed consent form received at the front desk on 2026-09-17" }'import requests
url = "https://api.sipstack.com/api/v2/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/opt-in"
payload = { "reason": "Signed consent form received at the front desk on 2026-09-17" }headers = { "x-api-key": "<x-api-key>", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())const url = 'https://api.sipstack.com/api/v2/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/opt-in';const options = { method: 'POST', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"reason":"Signed consent form received at the front desk on 2026-09-17"}'};
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-in', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, data: {reason: 'Signed consent form received at the front desk on 2026-09-17'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}Reverses an opt-out: removes the contact’s number from the STOP list and
sets is_opted_out back to false, so the contact is eligible to receive
messages again. Only do this with a genuine, documented re-consent.
Requires contacts:write. 404 when the contact isn’t your
organization’s.
If the contact opted out by texting STOP, a reason is required. It
is saved to the contact’s consent history together with the API key that
made the change. Without one the request is refused with 400
OPT_OUT_REASON_REQUIRED and nothing changes. A reason is optional
when the opt-out was made another way (for example by you, or after a
delivery bounce). A contact who texts START is opted back in
automatically.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Request Body
Section titled “Request Body ”object
Why the contact may receive messages again — for example, how they gave permission. Required when the contact opted out by texting STOP. Leading and trailing spaces are trimmed; text beyond 500 characters is not stored.
Example
Signed consent form received at the front desk on 2026-09-17Responses
Section titled “ Responses ”Contact opted in.
object
Example
{ "message": "Contact opted in successfully"}OPT_OUT_REASON_REQUIRED — the contact opted out by texting STOP and
the request has no reason. Nothing was changed; send the request
again with a reason.
object
Example
{ "success": false, "code": "OPT_OUT_REASON_REQUIRED", "error": "This contact opted out by texting STOP. A reason is required to opt them back in."}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"}