Retrieving real-time queue metrics via Statistics API returns empty arrays

Problem
We need to pull live queue metrics for our Pacific region dashboards. The admin UI shows the waiting count and available agents just fine, but the custom integration keeps returning empty arrays. The goal is to hit the real-time statistics endpoint and parse the queue observation data without polling every two seconds.

Code
We’re making a POST request to /api/v2/analytics/queues/realtime/query with a basic JSON payload. The request looks like this:

{
 "interval": "realtime",
 "dateFrom": "2024-05-14T00:00:00.000Z",
 "dateTo": "2024-05-14T23:59:59.999Z",
 "groupBy": ["queueId"],
 "select": ["waitingCount", "agentsAvailable"],
 "where": "queueId IN ('a1b2c3d4-e5f6-7890-abcd-ef1234567890')"
}

Error
The server responds with a 200 OK, but the actual data payload’s just an empty list. No exception thrown. The authentication token is valid since we use the same bearer header for other /api/v2/ calls. We’ve tried adjusting the dateFrom and dateTo values, but the result stays blank. Sometimes the waitingCount field shows up as null instead of zero. The queue definitely has agents logged in right now.

Question
Is there a specific formatting requirement for the where clause when targeting queue observation data? The documentation mentions using queueId, but the real-time endpoint might expect a different entity identifier. We don’t see any filtering errors in the response headers. The interval parameter is set to realtime, which should be correct for live observation. Any idea why the select fields aren’t populating? We’ve checked the queue permissions and the API user has analyst read access. The payload structure looks standard enough. Still getting that empty array back.