Get a list of agent groups


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 —

The method returns a list of groups and agents that are members of them.

* — required fields

Parameter Value
api_token* Channel API token

PHP request example
$data = array(
    'api_token'=> 'e1cbe1c1c9d910ef2ae975215644cb53dd555de4',
$mch_api = curl_init();
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
        "id": "354",
        "name": "Group 2",
        "company_id": "153561",
        "deleted": "0",
        "deleted_at": "0000-00-00 00:00:00",
        "users": [
                "id": "568",
                "name": "agent1",
                "email": "",
                "position": "",
                "role": "admin",
                "phone": null,
                "pivot": {
                    "user_group_id": "354",
                    "user_id": "568"
                "id": "558",
                "name": "Agent2",
                "email": "",
                "position": "",
                "role": "employee",
                "phone": null,
                "pivot": {
                    "user_group_id": "354",
                    "user_id": "558"

Server response parameters

idGroup ID
nameGroup name
company_idCompany ID
deletedFlag indicating deletion of a group
deleted_atDate of group deletion
custom_working_timeFlag indicating the group's working time, different from the company's working time
timezoneGroup Time Zone
usersData on the membership of the group
idAgent ID
nameAgent's name
emailAgent's Email
positionAgent position
roleRole of the agent
phoneAgent's phone number
pivotData about the agent in the specified group
user_idAgent ID
user_group_idAgent group ID