Queue Events

The Queue Events API provides routing queue activity data for work items, such as tickets entering and leaving queues. This information supports queue monitoring and analytics across messaging, voice, and email channels

Data Retention

In accordance with the data retention policy, the Queue Events API maintains data for a maximum of 90 days. Only events from the past 90 days can be accessed through the API.

JSON format

Queue Events are represented as JSON objects with the following properties:

NameTypeRead-onlyMandatoryDescription
call_idstringtruefalseThe id of the voice ticket. Only present if the channel is TALK
channelstringtruefalseThe channel name. Valid values: MESSAGING, SUPPORT, TALK
current_channel_queue_sizeintegertruefalseCurrent channel queue size
end_queue_timestringtruefalseTime when the work item left the queue, formatted as "YYYY-MM-DD'T'hh:mm:ss" in UTC. Only present on OUTBOUND events
event_occurred_atstringtruefalseTimestamp when the work item change event occurred
event_typestringtruefalseType of the work item change event. Valid values: TYPE_UNKNOWN, INBOUND, OUTBOUND, ROUTING_STATE_CHANGE
hourly_channel_queue_size_secondsintegertruefalseUsed to calculate the minimum, maximum, and average queue size
inbound_reasonstringtruefalseReason for the inbound work item. Allowed values: INBOUND_UNKNOWN, NEW, TRANSFERRED_IN, ASSIGNED, null. Only present on INBOUND events
outbound_reasonstringtruefalseReason for the outbound work item. Allowed values: OUTBOUND_UNKNOWN, TRANSFERRED_OUT, ACCEPTED, ASSIGNED, null. Only present on OUTBOUND events
previous_channel_queue_sizeintegertruefalsePrevious channel queue size
queue_event_idstringtruefalseA unique id that is automatically assigned
queue_idstringtruefalseUnique id for the queue
routing_state_change_reasonstringtruefalseReason for the routing state change of the work item. Allowed values: ROUTING_STATE_CHANGE_UNKNOWN, OFFERED, null
source_queue_idstringtruefalseThe id of the source queue. Only present on TRANSFERRED_IN events
start_queue_timestringtruefalseTime when the work item entered the queue, formatted as "YYYY-MM-DD'T'hh:mm:ss" in UTC
target_queue_idstringtruefalseThe id of the target queue. Only present on TRANSFERRED_OUT events
ticket_idintegertruefalseThe id of the email or messaging ticket
work_item_idstringtruefalseThe ticket_id or call_id based on the channel

List Queue Events

  • GET /api/v2/queue_events

Returns a list of queue events.

Allowed For

  • Admins

Pagination and Polling

The list of queue events returned by this request is paginated using queue_event_id and event_occurred_at as cursors. The next_page_url is provided in the response to enable fetching the next page of results. This ensures efficient handling of large datasets when optional parameters result in a significant number of events being returned.

Parameters

NameTypeInRequiredDescription
call_idstringQueryfalseUnique id for voice tickets
channelstringQueryfalseThe channel name. Valid values: MESSAGING, SUPPORT, TALK
end_timeintegerQueryfalseA Unix epoch time, in seconds. Default value is the current time
event_typestringQueryfalseThe type of event associated with the work item. Valid values: TYPE_UNKNOWN, INBOUND, OUTBOUND, ROUTING_STATE_CHANGE
page_sizeintegerQueryfalseThe number of items returned per page. Default is 10. Maximum of 100
queue_idstringQueryfalseUnique id for the queue
start_timeintegerQueryfalseA Unix epoch time, in seconds. Default value is 90 days ago
ticket_idintegerQueryfalseUnique id for support or messaging tickets
work_item_idstringQueryfalseUnique id for the work item

Code Samples

cURL
curl -G 'https://{subdomain}.zendesk.com/api/v2/queue_events' \  --data-urlencode  "queue_id={queue_id}" \  --data-urlencode "channel={channel}" \  --data-urlencode "ticket_id={ticket_id}" \  --data-urlencode "call_id={call_id}" \  --data-urlencode "start_time={start_time}" \  --data-urlencode "end_time={end_time}" \  --data-urlencode "event_type={event_type}" \  --data-urlencode "page_size={page_size}" \  -v -u {email_address}/token:{api_token}
Go
import (	"fmt"	"io"	"net/http")
func main() {	url := "https://support.zendesk.com/api/v2/queue_events?call_id=8802706929789&channel=MESSAGING&end_time=1630003600&event_type=INBOUND&page_size=10&queue_id=01K0XKC6EZ93E7EPH5F10OOOO1&start_time=1630000000&ticket_id=12345&work_item_id=wi827346aa"	method := "GET"	req, err := http.NewRequest(method, url, nil)
	if err != nil {		fmt.Println(err)		return	}	req.Header.Add("Content-Type", "application/json")	req.Header.Add("Authorization", "Basic <auth-value>") // Base64 encoded "{email_address}/token:{api_token}"
	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/queue_events")		.newBuilder()		.addQueryParameter("call_id", "8802706929789")		.addQueryParameter("channel", "MESSAGING")		.addQueryParameter("end_time", "1630003600")		.addQueryParameter("event_type", "INBOUND")		.addQueryParameter("page_size", "10")		.addQueryParameter("queue_id", "01K0XKC6EZ93E7EPH5F10OOOO1")		.addQueryParameter("start_time", "1630000000")		.addQueryParameter("ticket_id", "12345")		.addQueryParameter("work_item_id", "wi827346aa");String userCredentials = "your_email_address" + "/token:" + "your_api_token";String basicAuth = "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
Request request = new Request.Builder()		.url(urlBuilder.build())		.method("GET", null)		.addHeader("Content-Type", "application/json")		.addHeader("Authorization", basicAuth)		.build();Response response = client.newCall(request).execute();
Nodejs
var axios = require('axios');
var config = {  method: 'GET',  url: 'https://support.zendesk.com/api/v2/queue_events',  headers: {	'Content-Type': 'application/json',	'Authorization': 'Basic <auth-value>', // Base64 encoded "{email_address}/token:{api_token}"  },  params: {    'call_id': '8802706929789',    'channel': 'MESSAGING',    'end_time': '1630003600',    'event_type': 'INBOUND',    'page_size': '10',    'queue_id': '01K0XKC6EZ93E7EPH5F10OOOO1',    'start_time': '1630000000',    'ticket_id': '12345',    'work_item_id': 'wi827346aa',  },};
axios(config).then(function (response) {  console.log(JSON.stringify(response.data));}).catch(function (error) {  console.log(error);});
Python
import requestsfrom requests.auth import HTTPBasicAuth
url = "https://support.zendesk.com/api/v2/queue_events?call_id=8802706929789&channel=MESSAGING&end_time=1630003600&event_type=INBOUND&page_size=10&queue_id=01K0XKC6EZ93E7EPH5F10OOOO1&start_time=1630000000&ticket_id=12345&work_item_id=wi827346aa"headers = {	"Content-Type": "application/json",}email_address = 'your_email_address'api_token = 'your_api_token'# Use basic authenticationauth = HTTPBasicAuth(f'{email_address}/token', api_token)
response = requests.request(	"GET",	url,	auth=auth,	headers=headers)
print(response.text)
Ruby
require "net/http"require "base64"uri = URI("https://support.zendesk.com/api/v2/queue_events")uri.query = URI.encode_www_form("call_id": "8802706929789", "channel": "MESSAGING", "end_time": "1630003600", "event_type": "INBOUND", "page_size": "10", "queue_id": "01K0XKC6EZ93E7EPH5F10OOOO1", "start_time": "1630000000", "ticket_id": "12345", "work_item_id": "wi827346aa")request = Net::HTTP::Get.new(uri, "Content-Type": "application/json")email = "your_email_address"api_token = "your_api_token"credentials = "#{email}/token:#{api_token}"encoded_credentials = Base64.strict_encode64(credentials)request["Authorization"] = "Basic #{encoded_credentials}"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
{  "has_more": true,  "next_page_url": "https://{subdomain}.zendesk.com/api/v2/queue_events?start_time=1773155955&start_time_cursor=1773407754&queue_event_id_cursor=01KKKNDP4G5JE0HSGQCY135FNT&page_size=10",  "page_size": 10,  "queue_data": [    {      "call_id": "0",      "channel": "MESSAGING",      "current_channel_queue_size": 1,      "end_queue_time": null,      "event_occurred_at": "2026-03-13T13:04:19",      "event_type": "INBOUND",      "hourly_channel_queue_size_seconds": 3340,      "inbound_reason": "TRANSFERRED_IN",      "outbound_reason": null,      "previous_channel_queue_size": 0,      "queue_event_id": "01KKKMRF2A1T88QQH4QVPBS2VK",      "queue_id": "01KBHCQ19PJB4806V4PJ088YBQ",      "routing_state_change_reason": null,      "source_queue_id": "01K6YTM8TEH8Q8C51DXE0Z4KJA",      "start_queue_time": "2026-03-13T13:04:19",      "target_queue_id": null,      "ticket_id": 399,      "work_item_id": "399"    },    {      "call_id": "0",      "channel": "MESSAGING",      "current_channel_queue_size": 0,      "end_queue_time": "2026-03-13T13:04:19",      "event_occurred_at": "2026-03-13T13:04:19",      "event_type": "OUTBOUND",      "hourly_channel_queue_size_seconds": -3340,      "inbound_reason": null,      "outbound_reason": "TRANSFERRED_OUT",      "previous_channel_queue_size": 1,      "queue_event_id": "01KKKMRF2RJ08TGPMBYJZQP3NW",      "queue_id": "01K6YTM8TEH8Q8C51DXE0Z4KJA",      "routing_state_change_reason": null,      "source_queue_id": null,      "start_queue_time": "2026-03-13T13:03:17",      "target_queue_id": "01KBHCQ19PJB4806V4PJ088YBQ",      "ticket_id": 399,      "work_item_id": "399"    },    {      "call_id": "0",      "channel": "MESSAGING",      "current_channel_queue_size": 1,      "end_queue_time": null,      "event_occurred_at": "2026-03-13T13:07:15",      "event_type": "ROUTING_STATE_CHANGE",      "hourly_channel_queue_size_seconds": 0,      "inbound_reason": null,      "outbound_reason": null,      "previous_channel_queue_size": 1,      "queue_event_id": "01KKKMXTSKD0531TN5BV6RRFJ0",      "queue_id": "01K6YTM8TEH8Q8C51DXE0Z4KJA",      "routing_state_change_reason": "OFFERED",      "source_queue_id": null,      "start_queue_time": null,      "target_queue_id": null,      "ticket_id": 400,      "work_item_id": "400"    },    {      "call_id": "0",      "channel": "MESSAGING",      "current_channel_queue_size": 0,      "end_queue_time": "2026-03-13T13:07:53",      "event_occurred_at": "2026-03-13T13:07:53",      "event_type": "OUTBOUND",      "hourly_channel_queue_size_seconds": -3127,      "inbound_reason": null,      "outbound_reason": "ACCEPTED",      "previous_channel_queue_size": 1,      "queue_event_id": "01KKKMYZNZ0H2TV0HZ2TVF85J5",      "queue_id": "01K6YTM8TEH8Q8C51DXE0Z4KJA",      "routing_state_change_reason": null,      "source_queue_id": null,      "start_queue_time": "2026-03-13T13:07:15",      "target_queue_id": null,      "ticket_id": 400,      "work_item_id": "400"    },    {      "call_id": "0",      "channel": "MESSAGING",      "current_channel_queue_size": 1,      "end_queue_time": null,      "event_occurred_at": "2026-03-13T13:15:54",      "event_type": "INBOUND",      "hourly_channel_queue_size_seconds": 2645,      "inbound_reason": "NEW",      "outbound_reason": null,      "previous_channel_queue_size": 0,      "queue_event_id": "01KKKNDP4G5JE0HSGQCY135FNT",      "queue_id": "01K6YTM8TEH8Q8C51DXE0Z4KJA",      "routing_state_change_reason": null,      "source_queue_id": null,      "start_queue_time": "2026-03-13T13:15:54",      "target_queue_id": null,      "ticket_id": 401,      "work_item_id": "401"    }  ]}
400 Bad Request
// Status 400 Bad Request
{  "error": "Invalid channel Name is: <channel>\n"}
401 Unauthorized
// Status 401 Unauthorized
{  "error": "Could not authenticate the request. Doorman auth response code:<response_code>"}
500 Internal Server Error
// Status 500 Internal Server Error
{  "error": "Unhandled error:[error message]"}