Trying to build a query that aggregates handle time grouped by queue and media type. The documentation states: “To aggregate data, you must specify the groupBy field in the query body and ensure the metric supports this grouping.”
Here is the JSON payload I’m sending to POST /api/v2/analytics/conversations/details/query:
{
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-10-02T00:00:00.000Z",
"groupBy": ["queue", "mediaType"],
"metrics": ["handleTime"]
}
The response returns a 400 Bad Request. The error message says: “The metric ‘handleTime’ cannot be grouped by ‘mediaType’ in this context.”
I’ve checked the metric definitions and handle time seems standard. Is there a specific constraint on mixing queue and media type in the groupBy array? The docs don’t explicitly list forbidden combinations for this endpoint. I’ve tried removing mediaType and it works fine with just queue. Adding it back breaks it immediately. Not sure if this is a known limitation or if I’m missing a required filter.