Delete User
Remove a user from your Exotel Contact Center account.
HTTP Request
DELETE /v2/accounts/<account_sid>/users/<user_id>
Path Parameters
| Parameter | Description |
|---|---|
user_id | The UUID of the user to delete |
Code Examples
- cURL
- Python
- Node.js
- PHP
- Go
curl -u '<api_key>:<api_token>' -X DELETE 'https://ccm-api.exotel.com/v2/accounts/<account_sid>/users/<user_id>'
import requests
response = requests.delete(
'https://ccm-api.exotel.com/v2/accounts/<account_sid>/users/<user_id>',
auth=('<api_key>', '<api_token>')
)
print(response.status_code)
print(response.json())
const apiKey = '<api_key>';
const apiToken = '<api_token>';
const url = 'https://ccm-api.exotel.com/v2/accounts/<account_sid>/users/<user_id>';
const response = await fetch(url, {
method: 'DELETE',
headers: {
'Authorization': 'Basic ' + Buffer.from(`${apiKey}:${apiToken}`).toString('base64'),
},
});
const data = await response.json();
console.log(response.status, data);
<?php
$ch = curl_init('https://ccm-api.exotel.com/v2/accounts/<account_sid>/users/<user_id>');
curl_setopt($ch, CURLOPT_USERPWD, "<api_key>:<api_token>");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $status . "\n" . $response;
?>
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
endpoint := "https://ccm-api.exotel.com/v2/accounts/<account_sid>/users/<user_id>"
req, err := http.NewRequest("DELETE", endpoint, nil)
if err != nil {
panic(err)
}
req.SetBasicAuth("<api_key>", "<api_token>")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
respBody, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(respBody))
}
Response
{
"request_id": "string",
"method": "DELETE",
"http_code": 200,
"response": {
"code": 200,
"status": "success",
"data": null
}
}
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
10801 | 404 | User not found |
1010 | 401 | Authentication failed |
1003 | 403 | Unauthorized credentials |
Common Error Codes
These errors apply across all Users API endpoints:
| Code | HTTP Status | Description |
|---|---|---|
1004 | 500 | Internal server error |
1007 | 400 | Invalid request format |
1010 | 401 | Authentication failure |
429 | 429 | Too many requests (rate limited) |