https://api.cloudtalk.io/v1 shows what each user in your company is doing right now and lets you set the status they picked, the way an admin can in the Dashboard. Use it for a wallboard, to pause a user’s queue calls from your workforce tool, or to set a note such as “Back at 14:00”.
Requests authenticate with an API key, like the rest of the CloudTalk API. The key acts as a company admin, and no header names a user. For live updates, subscribe to the
user.status_changed webhook rather than polling.Quick start
1
List the status types users can pick
id and an actAs of online, idle or offline. You can set a type whose actAs is online or idle.2
Read who is available
3
Set a user Idle with a note
source: "api".Operations
List user statuses returns
{ "data": [...], "pagination": { "limit": 20, "next": "..." }, "requestId": "..." }: pass pagination.next as ?cursor= for the next page. The status types come in one response, { "data": [...], "requestId": "..." }.
How a status is worked out
Three inputs are checked in this order, and the first that applies wins:- Whether the user is signed in on any device. If not,
statusisoffline. - Whether the user is on a call (
on_call) or in after-call work (after_call_work). - The status type the user picked, through its
actAs:online,idleoroffline.
status shows the result. statusType and customText show what was picked, which is kept during calls and while the user is signed out.
Setting a status
PUTreplaces the whole picked status. LeavingcustomTextout, or sendingnull, clears the note.- The user must be signed in on at least one device, otherwise
409 USER_STATUS.USER_NOT_SIGNED_IN. Offline cannot be set: it follows the user’s real connection (422 USER_STATUS.OFFLINE_NOT_ALLOWED). - An Idle type pauses the user’s queue calls and an Online type resumes them.
- If the user is on a call,
statusTypechanges now andstatusstayson_calluntil the call ends. - The change sends
user.status_changed. Sending the same values again changes nothing and sends nothing. sourcebecomesapiand stays so until the user or an admin picks a status.- The Phone and the mobile app show the change at once.
Errors
Requests are rate limited per company. Over the limit you get429 with X-CloudTalkAPI-Limit, X-CloudTalkAPI-Remaining and X-CloudTalkAPI-ResetTime, and no error body.
Errors from the service share one shape, { "error": { "code", "message", "target" }, "requestId" }. Branch on code. A 401 comes from the gateway instead, as { "code", "message" } with no error object. message is for people and can change. target names the field, parameter or header at fault when there is one. Quote requestId when you contact support: every answer also carries it in the X-Transaction-ID header. A user id that is malformed or belongs to another company gets 404 USER_STATUS.USER_NOT_FOUND, and so does a user with no status activity on Get.