I’m trying to pull live queue metrics using the CXone Reporting API. The endpoint is GET https://<org-id>.mypurecloud.com/api/v2/analytics/queues/realtime with pageSize=100. The response comes back with a 200 OK, but the entities array is completely empty even though agents are currently logged in and handling calls. Is there a specific filter or scope I’m missing in the query string?
The empty entities array usually isn’t a scope issue. It’s almost always a filter mismatch. The real-time analytics API requires you to specify exactly which queues you want data for. If you just send pageSize=100 with no other parameters, the engine returns nothing because it doesn’t know what to query.
You need to pass the queueIds parameter. You can get these from the Queue Management API first. Here’s how I usually structure the request:
GET /api/v2/analytics/queues/realtime?queueIds=abc-123,def-456&pageSize=100
Make sure those IDs are actual queue identifiers, not names. Also, check your OAuth token scopes. You’ll need analytics:queue:read. If you’re still seeing empty results, try adding interval to the query string. Sometimes the real-time bucket hasn’t populated yet for the current second, so requesting a slightly wider window helps.
GET /api/v2/analytics/queues/realtime?queueIds={id}&interval=2023-10-27T10:00:00Z/2023-10-27T10:01:00Z
It’s a bit verbose but it works reliably.