Analytics API aggregation query failing on queue + media type grouping

I’m running into a 400 Bad Request when trying to fetch aggregated interaction counts grouped by queue and media type. The endpoint is /api/v2/analytics/interactions/queues/summary. I need the data for a dashboard that breaks down volume by voice vs webchat per queue, but the API keeps rejecting my query structure.

Here’s the JSON payload I’m sending via Faraday in a Rails service object:

{
 "dateFrom": "2023-10-01T00:00:00Z",
 "dateTo": "2023-10-08T00:00:00Z",
 "groupings": [
 {
 "type": "string",
 "field": "queue.id"
 },
 {
 "type": "string",
 "field": "mediaType"
 }
 ],
 "metrics": [
 { "id": "interactions.count" }
 ]
}

The error response is pretty vague:

{
 "code": "badRequest",
 "message": "Invalid grouping configuration",
 "errors": []
}

I’ve checked the docs, and mediaType is listed as a valid grouping field for queue interactions. I also tried using mediaType.name instead of just mediaType, but that didn’t help. The queue.id grouping works fine on its own. It’s only when I add the second grouping that it blows up.

I’m using the Ruby SDK genesyscloud_analytics gem, version 2.1.0, but I’m making the raw HTTP call to debug this. The auth token is valid, and I have the analytics:view scope.

Is there a specific limitation on combining queue and mediaType groupings? Or is the field name different? I’ve also tried conversation.mediaType but that’s for conversations, not interactions. The docs are a bit thin on multi-grouping examples for this specific endpoint.

Any ideas what’s wrong with the grouping array structure? I’ve spent two hours tweaking this and it’s still failing. The Sidekiq job is retrying, which is annoying.