Delete an agent
POST https://secure.usedesk.com/uapi/delete/user
Warning. If you use the server version of Usedesk, you will have a different URL of methods. Check the URL for the API with our team — support@usedesk.com.
Agent deletion method. Tickets remain assigned to the agent.
You cannot delete a bot and an administrator if it is the only one in the company.
* — required fields
| Parameter | Value |
| api_token* | Channel API token |
| user_id* | Agent ID |
PHP request example
$data = array(
'api_token'=> 'ba82c31d43b286e43e0e5489fb522ec57dc4c3fd',
'user_id'=>'545',
);
$mch_api = curl_init(); // initialize cURL connection
curl_setopt($mch_api, CURLOPT_URL, 'https://secure.usedesk.com/uapi/create/comment');
curl_setopt($mch_api, CURLOPT_USERAGENT, 'PHP-MCAPI/2.0');
curl_setopt($mch_api, CURLOPT_RETURNTRANSFER, true);
curl_setopt($mch_api, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($mch_api, CURLOPT_TIMEOUT, 10);
curl_setopt($mch_api, CURLOPT_POST, true);
curl_setopt($mch_api, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($mch_api, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($mch_api);
return $result;
Example of a response from server
{
"status":"success",
"user_id":2154861
}
Server response parameters
| Parameter | Description |
| user_id | Agent ID |
| status | Request execution status |