CXone OData v2 agent state history query failing

Trying to pull agent state history for the last 24 hours using the CXone Reporting API v2. The endpoint is /api/v2/analytics/reporting/query. My JSON payload looks correct, but I keep hitting a 400 Bad Request. Not sure what’s wrong with the time filter. Here is the request body:

{
 "queries": [
 {
 "timeGrouping": "PT1H",
 "startTime": "2023-10-27T00:00:00Z",
 "endTime": "2023-10-28T00:00:00Z",
 "data": [{"type": "agent", "grouping": "id"}]
 }
 ]
}

The error message just says Invalid query parameters. What am I missing?