Analytics API aggregation grouping by queue and media type

Trying to pull some granular stats on our support queues. I need to group by both queue and media_type in a single query using the Genesys Cloud Analytics API. I’m hitting the /api/v2/analytics/queues/summary endpoint.

Here’s the payload I’m sending:

{
 "interval": "P1D",
 "dateFrom": "2023-10-01T00:00:00.000Z",
 "dateTo": "2023-10-02T00:00:00.000Z",
 "groupBy": ["queue", "media_type"],
 "metrics": ["offerCount", "answerCount"]
}

The request returns a 200 OK, but the response structure is flat. I’m getting a list of queues, and inside each queue object, there’s a list of metrics. But the media_type isn’t actually grouping the data. It just returns totals for the queue regardless of whether it’s voice or chat.

I tried adding media_type to the filter array instead, but that just filters the whole result set down to one type. I need the breakdown per queue. The docs for the summary endpoint are pretty light on multi-dimensional grouping examples.

Is there a specific way to nest the groupBy parameters, or do I need to use the historical data endpoint instead? Feels like I’m missing a syntax trick here.

The groupBy array in that endpoint is strict. You can’t just mix entities and attributes like that. The API expects groupBy to contain only the entity types you want to slice by, usually just ["queue"] for this specific endpoint.

If you need to see the breakdown by media type inside that result, you don’t add it to groupBy. You add it to the metrics object as a sub-aggregation or rely on the fact that the summary returns metrics per media type if you request them specifically.

Actually, for a true cross-tab of Queue x Media Type, the summary endpoint is messy. It’s better to use the /api/v2/analytics/details endpoint or stick to summary but ensure your metrics definition is correct.

Here is the payload that actually works for getting a queue summary with voice and chat metrics separated:

{
 "dateFrom": "2023-10-01T00:00:00.000Z",
 "dateTo": "2023-10-02T00:00:00.000Z",
 "groupBy": ["queue"],
 "metrics": [
 {
 "id": "answerRate",
 "filter": "mediaType=voice"
 },
 {
 "id": "answerRate",
 "filter": "mediaType=chat"
 },
 {
 "id": "abandonRate",
 "filter": "mediaType=voice"
 }
 ],
 "interval": "P1D"
}

Note the filter inside the metric definition. That’s how you isolate media types. Adding media_type to groupBy returns a 400 bad request because the endpoint schema doesn’t support grouping by attribute at that level.

If you really need a flat table of Queue + Media Type rows, switch to /api/v2/analytics/details and set groupBy to ["queue", "mediaType"]. The summary endpoint is designed for high-level aggregates, not granular cross-tabs.