Delete an agent


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 —

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',
$mch_api = curl_init(); // initialize cURL connection
curl_setopt($mch_api, CURLOPT_URL, '');
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

Server response parameters

user_idAgent ID
statusRequest execution status