Create an opt-out
Adds a phone number to your opt-out list for one channel, so Vobiz stops messages to it. After this, POST /messages to that number on that channel returns 422 and broadcasts skip it. An sms opt-out also blocks mms.
curl --request POST \
--url https://api.vobiz.ai/api/v1/sms/opt-outs \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"phoneNumber": "+14155550123"
}
'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.opt_outs.create_opt_out(
phone_number="+14155550123",
channel="sms",
reason="customer request",
)
const options = {
method: 'POST',
headers: {
'X-Auth-ID': '<api-key>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({phoneNumber: '+14155550123'})
};
fetch('https://api.vobiz.ai/api/v1/sms/opt-outs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "ok"
}Authorizations
Your Vobiz account Auth ID (MA_XXXXXXXX).
Your Vobiz account Auth Token.
Body
The number and channel to add to your opt-out list, with an optional reason.
Required. The phone number to block, in E.164 format, for example +14155550123.
"+14155550123"
Channel to block: sms, mms or rcs. Defaults to sms. An sms opt-out also blocks mms.
"sms"
Free-text note stored on the record, for example customer request. Defaults to manual. Repeating the request for the same number and channel replaces it.
"manual"
Response
The opt-out is recorded.
Confirmation returned by actions that have no resource to return, such as marking a conversation read or creating or deleting an opt-out.
Always ok when the action succeeded.
"ok"
Was this page helpful?
curl --request POST \
--url https://api.vobiz.ai/api/v1/sms/opt-outs \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"phoneNumber": "+14155550123"
}
'from vobiz import Vobiz
client = Vobiz(api_key="MA_XXXXXXXX", auth_token="YOUR_AUTH_TOKEN")
client.sms.opt_outs.create_opt_out(
phone_number="+14155550123",
channel="sms",
reason="customer request",
)
const options = {
method: 'POST',
headers: {
'X-Auth-ID': '<api-key>',
'X-Auth-Token': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({phoneNumber: '+14155550123'})
};
fetch('https://api.vobiz.ai/api/v1/sms/opt-outs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "ok"
}