In this article, you’ll use the Queue Events endpoint to calculate acceptance rate for omnichannel queues. Acceptance rate measures the proportion of work items offered to a queue and then accepted for processing. You can use these results in your own reporting tools.

What you need

  • A Zendesk account with admin access.
  • One of the following plans:
    • Zendesk Suite: Professional, Enterprise, or Enterprise Plus
    • Zendesk Support: Professional or Enterprise
  • Omnichannel routing turned on with at least one custom queue
  • API authentication configured for your Zendesk account (such as an API token)

About the Queue Events endpoint

The /api/v2/queue_events endpoint provides event-level records related to work items entering and leaving queues across messaging, talk, and support.

Queue events are retained for the past 90 days only.

Filtering results

The table below shows the request query parameters you can use to filter queue events to calculate the acceptance rate. For the full list of supported parameters and returned fields, see Queue Events.

FieldDescription
channelMust be “MESSAGING” for measuring acceptance rate
queue_idUnique id for the queue
ticket_idUnique id for support or messaging tickets
call_idUnique id for voice tickets
work_item_idUnique id for the work items
start_timeStart of the time window to return events, specified as Unix epoch time in seconds
end_timeEnd of the time window to return events, specified as Unix epoch time in seconds

All timestamp fields and time-based parameters are in UTC ISO 8601 format.

To measure the acceptance rate, you'll:

  1. Fetch the raw data
  2. Count the number of offered and accepted events
  3. Calculate the acceptance rate

Fetching the raw data

First, retrieve queue events for your period of interest and channel. For messaging acceptance rate, filter results to channel=MESSAGING. Use the start_time and end_time request parameters to set the period you want to measure.

Example request:

curl -G 'https://{subdomain}.zendesk.com/api/v2/queue_events' \  --data-urlencode "channel=MESSAGING" \  --data-urlencode "start_time={start_time}" \  --data-urlencode "end_time={end_time}" \  -v -u "{email_address}/token:{api_token}"

Example response (truncated):

{  "queue_data": [    {      "channel": "MESSAGING",      "routing_state_change_reason": "OFFERED",      "outbound_reason": "ACCEPTED",      "event_occurred_at": "2024-06-10T09:30:00Z",      "queue_id": "01KXKC6EZ93E7EPHSF1000001",      "work_item_id": "wi827346aa"    }  ]}

Counting offered and accepted events

Next, from the same set of retrieved events (for example, channel=MESSAGING within your selected time window), count offered and accepted events using the following filters:

  • Number of messages offered: Count number of events where routing_state_change_reason = OFFERED.
  • Number of messages accepted: Count number of events where outbound_reason = ACCEPTED.

You can calculate these counts for the overall dataset, or break them down by queue using queue_id.

Calculating acceptance rate

Then calculate acceptance rate using the following formula:

Acceptance Rate = (Number Accepted / Number Offered) × 100

If Number Offered is 0, acceptance rate is undefined.

To calculate acceptance rate by day, group events by the date portion of event_occurred_at. For example, YYYY-MM-DD. For each day, calculate the offered and accepted counts, then apply the acceptance rate formula shown above.