CXone OData v2 Queue Stats returning empty entities

Trying to pull real-time queue stats via the CXone OData API. The GET request to /api/v2/analytics/queues/real-time returns a 200 OK, but the entities array is always empty. I’ve verified the date range and query params match the docs exactly.

Checked the auth token and it has the right scope. Any idea why the data isn’t populating? Here’s the basic fetch call I’m using.

You’re probably running into the same issue I hit last month. The real-time analytics endpoint is notoriously picky about the groupBy parameter. If you don’t explicitly define how you want the data aggregated, the API returns an empty array instead of throwing a 400 error. It’s a silent failure that drives people crazy.

The default behavior expects a group by dimension. For queue stats, you usually want to group by queueId. If you leave that off, the engine doesn’t know how to slice the data, so it gives you nothing. Also, double-check your interval. Real-time data is sampled every 15 seconds. If your start and end times are too far apart or don’t align with the sampling window, you might get gaps.

Here’s the working curl command that finally pulled data for me. Notice the groupBy=queueId in the query string. That’s the key.

curl -X GET "https://api.mypurecloud.com/api/v2/analytics/queues/real-time?interval=PT5M&groupBy=queueId&where=queueId IN ('your-queue-id-here')" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"

If you’re using Terraform to manage your queue IDs, make sure you’re pulling the actual ID from the state, not the name. The genesyscloud_routing_queue resource outputs the ID, which you can pass directly into your API call script.

resource "genesyscloud_routing_queue" "main_queue" {
 name = "Support Queue"
 # ... other config
}

output "queue_id" {
 value = genesyscloud_routing_queue.main_queue.id
}

Copy that output into your where clause. It’s also worth checking if the queue actually has activity. Real-time stats only show queues with recent interactions. If it’s been quiet for 15 minutes, the entity might just be missing because there’s no data to report. Try triggering a test call or chat to the queue and run the request again. It usually pops up right after the interaction starts.