This API allows an authenticated user to update existing SMS Opt-Out records, such as changing the phone number, reason, or purpose.
Endpoint
POST https://api.convoso.com/v1/sms-opt-out/updateπ Authentication
| Field | Type | Required | Description |
|---|---|---|---|
auth_token | string | β Yes | API authentication token |
Token must be retrieved from the login endpoint.
HTTP Method: POST
π Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
auth_token | string | β Yes | Your API token |
id | integer | β Yes | Record ID of the SMS Opt-Out entry to update |
phone_code | string | β No | Country/area code (e.g., 1 for US/Canada) |
phone_number | string | β No | New or updated phone number |
reason | string | β No | Reason for SMS opt-out. Use -BLANK- to leave it empty. |
purpose | string | β No | Purpose for SMS opt-out. Use -BLANK- to leave it empty. |
Error Codes
| Code | Message |
|---|---|
6004 | Unknown Campaign ID |
6008 | The phone number is invalid. |
6026 | Missing or Invalid Country Code |
6056 | Missing or Invalid value for ID |
6057 | Invalid Purpose Provided |
6058 | Invalid Reason Provided |
6059 | This combination of Phone number, Campaign ID, and Phone Code already exists. |
4001 | Missing a required field: phone_number / phone_code / campaign_id. |
4002 | phone_number / phone_code / campaign_id must be numeric. |
Example PHP Usage
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.convoso.com/v1/sms-opt-out/update');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'auth_token' => 'your_token',
'id' => '12345',
'phone_code' => '1',
'phone_number' => '9876543210',
'reason' => 'User request',
'purpose' => 'Promotional opt-out'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_close($ch);Example JSON Response
{
"success": true,
"data": {
"id": "12345"
}
}Response Field Descriptions
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the update request was processed successfully. |
data | object | Contains metadata about the updated record. |
data.id | string or int | The ID of the SMS Opt-Out record that was updated. |
π This ID should match the one sent in your
idrequest parameter, confirming the update.