List agents and groups

Agents and groups a chat can be transferred to, with their current availability.

GET https://cotlet.dev/api/v1/livechat/agents

read

Returns the agents and groups shown in the Transfer to... dialog, with each agent's group and availability. Use the agent_id or group from here in transfer_chat. Transferring to a group lands on the first free agent in it, so no agent is chosen for a group.

Parameters

No parameters.

Request

cURL
curl https://cotlet.dev/api/v1/livechat/agents \
  -H "Authorization: Bearer $COTLET_API_KEY"
Python
result = client.call("livechat", "list_agents")
Node.js
const result = await cotlet.call('livechat', 'list_agents');
CLI
cotlet call livechat list_agents

Example response

JSON

{
  "agents": [
    {
      "agent_id": "maria@example.com",
      "name": "Maria Silva",
      "groups": [
        "Support"
      ],
      "available": true
    }
  ],
  "groups": [
    {
      "group": "Billing"
    },
    {
      "group": "Support"
    }
  ]
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.