I’m trying to pull real-time queue stats from CXone using the /api/v2/reporting/queues/stats endpoint. The request returns a 200 OK, but the data array is always empty, even though agents are clearly logged in and active in the queues. I’m passing the correct interval and group-by parameters in the JSON body. Any idea why the payload would be null?
You’re hitting the same wall I did last month. The v2 reporting endpoint doesn’t stream live state; it aggregates historical buckets. If your interval is too granular or recent, you’ll get empty arrays because the data hasn’t been processed into the warehouse yet. For true real-time stats, you need to switch to the analytics API instead.
Try this endpoint:
GET /api/v2/analytics/queues/realtime
It’s a bit trickier to query. You need to pass the queue IDs in the body as an array of strings. Here’s a quick cURL example:
curl -X GET "https://api.mypurecloud.com/api/v2/analytics/queues/realtime" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{"queues": [{"id": "your-queue-id-here"}]}'
Make sure your token has the analytics:view scope. The response will give you current agent counts, wait times, and interaction queues. It’s not perfect-there’s a 1-2 second lag-but it’s the only way to get live data without polling the notification websocket. The reporting API is strictly for historical analysis, so stop using it for live dashboards. It will always return empty for current seconds.