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.
Off by default
GET /v2.0/agents/availability returns enabled: false and setting a status returns 409 AVAILABILITY_OFF. Nothing about assignment changes.Who can take chats
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
| Parameter | Type | Description |
|---|---|---|
| status | string | available, away or offline |
| reason | string | Away reason from your organisation's list, or null |
| since | string (ISO 8601) | When the status last changed |
| canTakeChats | boolean | true when automatic assignment would give this person a new chat right now |
| notAvailableBecause | string | away, offline, unreachable (Teambox closed on every device), on_leave, holiday, off_shift or full (at their chat limit). null when canTakeChats is true |
| openChats | number | Chats assigned to them that are not resolved and where the customer wrote in the last 24 hours |
| chatLimit | number | Their maximum open chats (their own, else their team's, else the organisation's). null when limits are off |
| shift.state | string | on, late, outside (Available outside their shift), later (starts later today), off or leave |
Set an agent's 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
| Parameter | Type | Description |
|---|---|---|
| status | string | available, away or offline |
| reason | string | Away only. Must be one of your organisation's Away reasons (Settings, Availability). Otherwise 400 REASON_NOT_ALLOWED |
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
| Status | Code | Meaning |
|---|---|---|
| 400 | INVALID_STATUS | status is not available, away or offline |
| 400 | REASON_NOT_ALLOWED | The Away reason is not in your organisation's list |
| 404 | NOT_FOUND | No active agent with that id in your organisation |
| 409 | AVAILABILITY_OFF | Availability is turned off for your organisation |
| 429 | RATE_LIMITED | More than 30 changes for one agent in a minute |
Status is not presence
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
| Parameter | Type | Description |
|---|---|---|
| agentId | string | The agent whose status changed |
| agentName | string | Their name |
| from | string | Previous status, or null the first time |
| to | string | New status |
| reason | string | Away reason, or null |
| source | string | self, manager, api, idle, disconnect (Teambox closed everywhere), reconnect, shift_start, shift_end or enable |
| setByName | string | Who made the change, when a person or API key did |
| at | string (ISO 8601) | When it changed |