CXone Reporting API v2: Agent State History query returns empty set despite valid parameters

Trying to pull agent state history for the last 24 hours via the CXone Reporting API v2. The endpoint /api/v2/analytics/reporting/data seems to accept the request without validation errors, but the response body comes back with an empty results array. I’ve verified the agentIds exist and were active in that window. The query JSON looks correct based on the docs, but I’m suspecting a timezone offset issue or a specific field mapping problem in the filter object. Here’s the payload I’m sending:

{
 "type": "agent",
 "interval": "PT1H",
 "dateFrom": "2023-10-25T00:00:00Z",
 "dateTo": "2023-10-26T00:00:00Z",
 "filter": [
 {
 "type": "agent",
 "agentIds": ["550e8400-e29b-41d4-a716-446655440000"]
 }
 ],
 "groupBy": ["agent", "state"]
}

The response headers are 200 OK, but no data. If I switch to dateFrom being yesterday’s date in local time without the Z suffix, it breaks validation. Is the API strictly UTC and ignoring local agent timezone settings for the history window? Also tried adding "limit": 10000 but same result. Any ideas on why it’s returning null sets for active agents?

Check your interval field. It needs to be in ISO 8601 duration format, like PT1H, not just a number. Also, make sure dateFrom and dateTo are in UTC. If you’re passing local time, the window might be completely outside your actual data range. The API is strict about that.

"interval": "PT1H",
"dateFrom": "2023-10-27T00:00:00Z",
"dateTo": "2023-10-27T23:59:59Z"