Get live phone occupancy for users
curl --request GET \
--url http://localhost:8080/availability-statuses/users/phone-states \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/availability-statuses/users/phone-states"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/availability-statuses/users/phone-states', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/availability-statuses/users/phone-states",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/availability-statuses/users/phone-states"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/availability-statuses/users/phone-states")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/availability-statuses/users/phone-states")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"user_id": 0,
"state": "idle"
}
]{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Availability Statuses
User phone states
Read current phone occupancy across teams to distinguish idle agents, ringing offers, active calls and wrap-up in staffing monitors.
GET
/
availability-statuses
/
users
/
phone-states
Get live phone occupancy for users
curl --request GET \
--url http://localhost:8080/availability-statuses/users/phone-states \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8080/availability-statuses/users/phone-states"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8080/availability-statuses/users/phone-states', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/availability-statuses/users/phone-states",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8080/availability-statuses/users/phone-states"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:8080/availability-statuses/users/phone-states")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/availability-statuses/users/phone-states")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"user_id": 0,
"state": "idle"
}
]{
"statusCode": 123,
"message": "<string>",
"error": "<string>"
}Send
When states overlap,
user_ids as a comma-separated list of up to 100 positive user IDs. The response contains only members of the API key’s workspace, ordered by user ID. Unknown IDs and users outside that workspace are omitted. The request requires agent-availability:read and does not change availability or assignments.
| State | Meaning |
|---|---|
on_call | Handling an active customer call, consultation or conference, including an accepted conference invitation that is connecting. |
ringing | Receiving a current ring offer or transfer invitation, or placing a call that is connecting. |
wrap_up | The agent’s wrap-up period is still active. |
idle | None of these phone activities currently occupies the agent. |
on_call takes precedence over ringing, then wrap_up. State applies across all teams: someone handling one team’s call must not be counted as free in another team.
Idle does not mean eligible for a new call. Also check the agent’s online status, Available for calls, availability on the relevant team, and calling connection. An active session alone does not prove that a phone call is still connected.
Refresh the data while showing a live monitor. If a request fails, a user is omitted, or the last sample becomes stale, show Unknown instead of counting the agent as available. Existing availability flags describe configured status and must not substitute for current phone occupancy.Authorizations
Query Parameters
Response
Default Response
Was this page helpful?