This API allows you to insert an SMS opt-out request into the system, enabling users to unsubscribe from SMS communications.
Endpoint
POST https://api.convoso.com/v1/sms-opt-out/insert
🔐 Authentication
| Parameter | Type |
Required |
Description |
|---|---|---|---|
| auth_token | string |
Yes |
API authentication token |
You must obtain the token from the POST /v1/login endpoint.
HTTP Method: Post
🔎 Query Parameters
| Parameter | Type |
Required |
Description |
|---|---|---|---|
| auth_token | string |
Yes |
API authentication token |
| phone_number | string |
Yes |
Phone number to opt out |
| phone_code | string |
Yes |
Country/region phone code |
| campaign_id | string |
Yes |
Campaign ID (0 for global opt-out) |
| reason | string |
Optional |
Reason for opt-out |
| purpose | string |
Optional |
Purpose of opt-out |
⚠️ Error Codes
| Code | Message |
|---|---|
6006 |
Invalid Campaign ID |
6007 |
Invalid Phone Number |
6008 |
The phone number already exists |
6026 |
Missing or Invalid Country Code |
6057 |
Invalid Purpose Provided |
6058 |
Invalid Purpose Provided |
Example PHP Usage
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.convoso.com/v1/sms-opt-out/insert');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
'auth_token' => '02e482d2111c72-04834465f22582c3a7358661',
'phone_number' => '8181234566',
'phone_code' => '1',
'campaign_id' => '0',
'reason' => 'SMS Opt-Out Reason',
'purpose' => 'SMS Opt-Out purpose'
)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);
Example JSON Response
{
"success": true
}Response Field Descriptions
| Field | Type | Description |
|---|---|---|
| success | boolean | Indicates whether the request was successfully processed. true = success. |
⚠️ Note: The Insert endpoint does not return the ID of the newly created record in this case—only success confirmation.