Assign a chat
POST /v1/contacts/{id}/assign
Gives the contact’s chat to an agent or a team. Send agent_id or team_id, not both, or {"agent_id": null} to give it to nobody.
Needs chats:write.
Path parameters
Section titled “Path parameters”id string · uuid
The contact’s ID.
Exactly one of agent_id (an agent’s ID, or null to unassign the
chat) and team_id.
agent_id string · uuid · nullable
The agent to give the chat to, from GET /v1/agents. null unassigns the chat.
team_id string · uuid
The team to hand the chat to, from GET /v1/teams. Needs transfers in your plan.
Headers
Section titled “Headers”How it works
Section titled “How it works”To an agent
Section titled “To an agent”The agent takes the chat over from the bot. The bot and AI stay quiet until the agent is unassigned, or the chat is closed or reopened. A chat waiting in a queue or with a team goes to the agent.
To a team
Section titled “To a team”The chat goes to the team, and the team’s routing picks an agent. This works at any hour, and the customer gets no out-of-hours message.
To nobody
Section titled “To nobody”Send {"agent_id": null}. The chat’s agent is cleared, and the bot answers the customer again, unless a team has the chat.
Repeating a request
Section titled “Repeating a request”Assigning a chat to where it already is changes nothing and still returns 200. chat.assigned is sent only if something changed.
Returns
Section titled “Returns”200 The chat object. The chat as it is now. contact is null unless your key also has contacts:read.
Errors
Section titled “Errors”Besides the ones every request can get:
invalid_fieldYou sent both agent_id and team_id, or neither, or the agent or team isn’t in your workspace, or the agent can’t take chats.feature_not_in_planYou sent a team_id, and transfers aren’t on your plan. error.details.feature is transfers.idempotency_mismatchThe Idempotency-Key was used before for a different request, or by another of your API keys.