CXone Analytics API returning empty results for custom interval conversation aggregates

The API call to GET /api/v2/analytics/conversations/aggregate is returning a valid 200 OK status, but the items array in the response body is always empty. I’m trying to build a custom interval report for call duration metrics using the .NET SDK.

Here is the JSON payload I’m constructing for the query:

{
 "interval": "PT1H",
 "dateFrom": "2023-10-01T00:00:00.000Z",
 "dateTo": "2023-10-01T23:59:59.999Z",
 "groupBy": ["queueId"],
 "metrics": ["talkDuration"],
 "view": "conversation"
}

I have verified that the queueId values in the groupBy array match the actual queue IDs in our CXone environment. I also confirmed that there was call volume during this time period by checking the UI reports. The date range is exactly 24 hours, so it shouldn’t be hitting any limit on the number of intervals returned.

The SDK method AnalyticsApi.GetConversationsAggregateAsync doesn’t throw an exception, it just returns the empty list. I’ve tried changing the interval to PT30M and PT5M but the result is the same. Is there a specific permission requirement for the client credentials token used here that I’m missing? Or perhaps the view parameter needs to be something other than conversation for duration metrics?

The date range is likely the issue. The API rejects queries spanning more than 30 days, and even within that, specific queues might not have data for that exact hour. Check the groupBy field. If it’s missing or set to something that doesn’t match your routing setup, you get empty items. Try adding groupBy: ["queue"] to the payload. Also, verify the dateTo is strictly after dateFrom and within the last 30 days. The .NET SDK handles the serialization, but the underlying logic is strict. If the interval is too granular for the volume, it might also return empty. Start with PT24H and a single queue ID to isolate the problem. Here is a working payload structure that usually fixes this:

{
 "interval": "PT24H",
 "dateFrom": "2023-10-01T00:00:00.000Z",
 "dateTo": "2023-10-02T00:00:00.000Z",
 "groupBy": ["queue"],
 "filters": {
 "queueIds": ["your-queue-id-here"]
 },
 "metrics": ["duration", "handleTime"]
}

Make sure the queue ID is correct. If it’s still empty, check the queue’s activity logs.