Account Groups Availability

Agent availability information (channel statuses and capacity) on single account-group level

JSON format

Account Groups Availability are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
account_idintegertruetrueZendesk account id
channel_group_statusesobjecttruetrueThe number of agents in each state by individual channel
group_idintegerfalsetrueZendesk group id
unified_statesobjecttruefalseThe number of agents in each unified state across channels, only for Unified Agent State enabled accounts
versionintegertruetrueVersion from the data source

Get Account Groups Availability API

  • GET /api/v2/account_groups/availability/{group_id}

Returns channel statuses and capacity information for the given group.

Channel Statuses information: the number of agents in each channel state (e.g. support:online, talk:away, chat:offline) in the group.

Capacity information: the total max capacity and total consumed capacity per channel for the group.

For accounts with Unified Agent Status enabled, the API will return Unified Statuses information in addition.

Unified Statuses information: the number of agents in each unified state (e.g. online, away, offline, transfers_only, any_custom_state) in the group.

Allowed For

  • Admins

Parameters

NameTypeInRequiredDescription
group_idintegerPathtrueZendesk Group ID

Code Samples

Curl
curl -v -u {email_address}:{password} \    'https://example.zendesk.com/api/v2/account_groups/availability/123' \    --header 'Content-Type: application/json'
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/account_groups/availability/"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")
	client := &http.Client {}	res, err := client.Do(req)	if err != nil {		fmt.Println(err)		return	}	defer res.Body.Close()
	body, err := io.ReadAll(res.Body)	if err != nil {		fmt.Println(err)		return	}	fmt.Println(string(body))}
Java
import com.squareup.okhttp.*;OkHttpClient client = new OkHttpClient();HttpUrl.Builder urlBuilder = HttpUrl.parse("https://support.zendesk.com/api/v2/account_groups/availability/")		.newBuilder();
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://support.zendesk.com/api/v2/account_groups/availability/',  headers: {	'Content-Type': 'application/json',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requests
url = "https://support.zendesk.com/api/v2/account_groups/availability/"headers = {	"Content-Type": "application/json",}
response = requests.request(	"GET",	url,	headers=headers)
print(response.text)
Ruby
require "net/http"uri = URI("https://support.zendesk.com/api/v2/account_groups/availability/")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|	http.request(request)end

Example response(s)

200 OK
// Status 200 OK
{  "account_id": 123,  "channel_group_statuses": {    "chat": {      "state_counts": {        "away": 1,        "disconnected": 0,        "offline": 1,        "online": 0,        "transfers_only": 0      },      "total_consumed_capacity": 0,      "total_max_capacity": 15    },    "messaging": {      "state_counts": {        "away": 1,        "disconnected": 0,        "offline": 2,        "online": 0,        "transfers_only": 0      },      "total_consumed_capacity": 1,      "total_max_capacity": 15    },    "support": {      "state_counts": {        "away": 1,        "offline": 1,        "online": 1,        "transfers_only": 0      },      "total_consumed_capacity": 0,      "total_max_capacity": 30    },    "talk": {      "state_counts": {        "away": 1,        "offline": 1,        "online": 0,        "transfers_only": 0      },      "total_consumed_capacity": 0,      "total_max_capacity": 2    }  },  "group_id": 456,  "unified_states": {    "any_custom_state": 1,    "away": 1,    "offline": 1  },  "version": 111}
400 Bad Request
// Status 400 Bad Request
{  "errors": [    {      "code": "MissingParameterException",      "status": 400,      "title": "Missing parameter groupId"    }  ]}
403 Forbidden
// Status 403 Forbidden
{  "errors": [    {      "code": "HttpForbiddenException",      "status": 403,      "title": "Forbidden"    }  ]}
410 Gone
// Status 410 Gone
{  "errors": [    {      "code": "GroupDeletedException",      "status": 410,      "title": "Target Deleted"    }  ]}
500 Internal Server Error
// Status 500 Internal Server Error
{  "errors": [    {      "code": "Internal Server Error",      "status": 500,      "title": "An error occurred"    }  ]}