Queue metrics

get/v1/chat/queues/metrics/{ids}
Requires any one of these rolesAbout roles
org.permission.queue.read
Legacyorg.adminorg.user

The API key or user must hold at least one of them. Legacy roles still work; prefer the others for new keys.

Query for queue metrics by a single or multiple queue IDs.

Rate limit

This endpoint is rate limited as a metrics endpoint.

Metrics

  1. Latest Wait Time: The time that the latest customer waited on a queue. note: If a requested queue has no activity for a day, it will return a null latest wait time.
  2. Latest Wait Time Since Queue Entry or Last Unpause: The time that the latest customer waited on a queue, calculated as the shorter of the following two time spans:
    • Seconds from queue entry to queue exit
    • Seconds from last unpause to queue exit
  3. Latest Wait Time Before or After Last Pause: The time that the latest customer waited on a queue, calculated in the following order:
    • If the conversation was not snoozed, then return total queue time
    • If item was snoozed and then un-snoozed, return time from unpause to queue exit
    • If item was snoozed, but exited the queue before being un-snoozed, then return time from queue entry to snooze.
About this resource

Queue metrics

Queue metrics report how long the most recent customer waited in each queue before an agent took the conversation. Use them to show customers an expected wait or to watch queue health from your own tools.

Kustomer measures queue wait time from work items: the time between an item entering a queue and leaving it. This endpoint returns the latest of those measurements for each queue you ask about. It's a snapshot of recent experience, not a forecast, but it's a good basis for messages such as "the current wait is about 3 minutes" in a chat or on a help page. For historical reporting, use Kustomer's reports instead.

The three wait times

Snoozing a conversation pauses its work item, which can make a raw queue time misleading. Each queue returns three variants:

Attribute Meaning
latestWaitTimeSeconds How long the latest customer waited in the queue.
latestWaitTimeSinceQueueEntryOrLastUnpauseSeconds The shorter of: entry to exit, or last unpause to exit. Ignores waiting that happened before the last unpause.
latestWaitTimeBeforeOrAfterLastPauseSeconds The total queue time if the item was never paused; the time from unpause to exit if it was paused and then resumed; or the time from entry to the pause if it left the queue while still paused.

For an item that was never paused, all three are the same. Values are whole seconds, rounded up. A queue with no activity for a day returns null. name is the queue's display name, and the latestWaitTimeWorkItem relationship, when present, points at the work item that was measured.

Choosing the window

rangeFrom limits the measurement to queue activity in the last rangeFrom seconds, up to 86,400 (24 hours). A short window such as 3600 keeps the answer current; a queue with no activity in that window returns null rather than an old value.

Which endpoint to use

To Call
Get the latest wait times for one or more queues GET /v1/chat/queues/metrics/{ids}
Find the queue IDs to ask about GET /v1/routing/queues

Pass up to 80 queue IDs, comma-separated, in the path. IDs that aren't queues in your org are left out of the response. The endpoint is rate limited as a metrics endpoint, so cache the result for a short time rather than calling it on every page view. Any org.user or org.admin key can call it, as can a key with org.permission.queue.read.

Path parameters

idsstringrequired
Example "5f184e74c61792001af42e49,5f184e74c61792001af42e50"

Query parameters

rangeFrominteger
Example 3600

Responses

OK

array<object>required
max items 80