CXone Reporting API v2: Querying agent state history for last 24 hours

Hey everyone,

I’m trying to pull agent state history for the last 24 hours using the CXone Reporting API v2. We need this data to audit adherence metrics for our WFM reports.

Here’s the endpoint I’m hitting:
GET /api/v2/reporting/agents/{agentId}/states?startTime=2023-10-25T10:00:00Z&endTime=2023-10-26T10:00:00Z

I’m getting a 200 OK response, but the items array in the JSON payload is empty. The agent was definitely active during this window. I’ve double-checked the agentId and the timezone.

Here’s a snippet of the response:

{
 "items": [],
 "count": 0,
 "pageSize": 1000
}

I’m using Python with requests. Is there a specific filter or parameter I’m missing? The documentation mentions grouping, but I’m not sure how that applies here.

Any help is appreciated. I’m stuck on why no data is coming back.