Agent Availability

When your organisation turns on availability in Teambox (Settings, Availability), every agent has a status: Available, Away (with an optional reason such as Lunch) or Offline. Automatic assignment, including round robin, AI handover and routing rules, only gives new chats to people who can take them: Available, with Teambox open on a device, not on leave, under their chat limit, and on shift when the organisation enforces shifts.

These endpoints let your own system read who can take chats and set a status, for example from an HR or attendance tool.

Who can take chats

GET/v2.0/agents/availability

Returns every active agent with their status, whether they can take a chat right now and, if not, why, plus open chats against their limit and today's shift state. Scope: agents:read.

curl -X GET "https://api.sendiee.com/v2.0/agents/availability" \
  -H "Authorization: Bearer YOUR_API_KEY"
{
  "success": true,
  "enabled": true,
  "data": [
    {
      "agentId": "6708b2d1c93b2e0012aa1001",
      "name": "Kavya Reddy",
      "email": "[email protected]",
      "status": "available",
      "reason": null,
      "since": "2026-12-01T03:34:00.000Z",
      "canTakeChats": true,
      "notAvailableBecause": null,
      "openChats": 6,
      "chatLimit": 8,
      "teamIds": [
        "6710a1f4c93b2e0012aa7f01"
      ],
      "shift": {
        "state": "on",
        "start": "2026-12-01T03:30:00.000Z",
        "end": "2026-12-01T12:30:00.000Z"
      }
    },
    {
      "agentId": "6708b2d1c93b2e0012aa1002",
      "name": "Sneha Iyer",
      "email": "[email protected]",
      "status": "away",
      "reason": "Lunch",
      "since": "2026-12-01T07:30:00.000Z",
      "canTakeChats": false,
      "notAvailableBecause": "away",
      "openChats": 4,
      "chatLimit": 8,
      "teamIds": [
        "6710a1f4c93b2e0012aa7f01"
      ],
      "shift": {
        "state": "on",
        "start": "2026-12-01T03:30:00.000Z",
        "end": "2026-12-01T12:30:00.000Z"
      }
    }
  ],
  "teams": [
    {
      "teamId": "6710a1f4c93b2e0012aa7f01",
      "name": "Sales",
      "canTakeChats": 1,
      "total": 2,
      "waiting": 0
    }
  ]
}

Agent Availability Object

ParameterTypeDescription
statusstringavailable, away or offline
reasonstringAway reason from your organisation's list, or null
sincestring (ISO 8601)When the status last changed
canTakeChatsbooleantrue when automatic assignment would give this person a new chat right now
notAvailableBecausestringaway, offline, unreachable (Teambox closed on every device), on_leave, holiday, off_shift or full (at their chat limit). null when canTakeChats is true
openChatsnumberChats assigned to them that are not resolved and where the customer wrote in the last 24 hours
chatLimitnumberTheir maximum open chats (their own, else their team's, else the organisation's). null when limits are off
shift.statestringon, late, outside (Available outside their shift), later (starts later today), off or leave

Set an agent's status

PUT/v2.0/agents/:agentId/status

Sets one agent's status. The change is logged with the source api and your key's prefix, the agent sees a notice in Teambox, and the teambox.agent_status_changed automation event fires. Scope: agents:write.

Body Parameters

ParameterTypeDescription
statusstringavailable, away or offline
reasonstringAway only. Must be one of your organisation's Away reasons (Settings, Availability). Otherwise 400 REASON_NOT_ALLOWED
cURL
curl -X PUT "https://api.sendiee.com/v2.0/agents/6708b2d1c93b2e0012aa1002/status" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "status": "away", "reason": "Training" }'
{
  "success": true,
  "data": {
    "agentId": "6708b2d1c93b2e0012aa1002",
    "changed": true,
    "status": "away",
    "reason": "Training",
    "since": "2026-12-01T09:02:11.000Z"
  }
}

Errors

StatusCodeMeaning
400INVALID_STATUSstatus is not available, away or offline
400REASON_NOT_ALLOWEDThe Away reason is not in your organisation's list
404NOT_FOUNDNo active agent with that id in your organisation
409AVAILABILITY_OFFAvailability is turned off for your organisation
429RATE_LIMITEDMore than 30 changes for one agent in a minute

Assigning to a team when nobody is free

POST /v2.0/conversations/assign with a teamId and no agentId picks the next person who can take the chat. When nobody can, it returns 409 NO_AVAILABLE_AGENT as before. Send "queueIfNone": true to put the conversation in the team's queue instead; Teambox hands it to the next person who becomes available.

{
  "success": true,
  "queued": true,
  "data": {
    "_id": "66c3f0a19d2b4e0011ab9911",
    "assignedTeamId": "6710a1f4c93b2e0012aa7f01",
    "assignedAgentId": null,
    "queued": true
  }
}

Automation event

teambox.agent_status_changed fires on every status change, whoever made it: the agent, a manager, this API, or an automatic rule.

Event Data

ParameterTypeDescription
agentIdstringThe agent whose status changed
agentNamestringTheir name
fromstringPrevious status, or null the first time
tostringNew status
reasonstringAway reason, or null
sourcestringself, manager, api, idle, disconnect (Teambox closed everywhere), reconnect, shift_start, shift_end or enable
setByNamestringWho made the change, when a person or API key did
atstring (ISO 8601)When it changed

Try It

Try it — API Playground