Add an opt-out
add_opt_outBlock a phone number from receiving messages on a channel after a customer opts out. Requires confirm: true so send_message refuses with opted_out.
Instructions
Block a phone number from receiving messages from this account on a channel (POST /api/v1/sms/opt-outs), for example after a customer asks to stop; send_message then refuses it with opted_out. Requires VOBIZ_ENABLE_MESSAGING=true on the server and confirm: true after the user approved blocking this number. Adding a number that is already blocked succeeds without change. The reverse is remove_opt_out; to look before changing, use check_opt_out.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | Note stored on the record, e.g. 'customer request' (default 'manual'). | |
| channel | No | sms (default; also covers mms), mms or rcs. | |
| confirm | Yes | Must be true after the user approved blocking this number. | |
| phone_number | Yes | The number to block, E.164 (leading + optional). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | True on success; false when the result is an error (then error, message and retryable are set). | |
| channel | No | Channel the change applies to: sms, mms or rcs. | |
| opted_out | No | Always true: the number is now blocked. | |
| phone_number | No | The number, normalised to E.164. |