Analytics API aggregation query groups by queue and media type

Building a query to aggregate conversation data grouped by queue and media type. The API rejects the request with a 400 Bad Request. The JSON payload looks correct based on the docs, but the response says invalid group by fields. Here is the payload being sent:

{
 "viewId": "conv-aggregates",
 "groupBy": ["queue.id", "mediaType"],
 "timeInterval": "2023-01-01T00:00:00Z/2023-01-02T00:00:00Z",
 "metrics": ["wrapupCode"]
}

The error message doesn’t specify which field is wrong. Checked the schema, both fields exist. Using the JS SDK getanalyticsreportconversationaggregates. Is there a specific format required for the groupBy array values?

The groupBy fields need to match the view’s schema exactly. For conv-aggregates, use queue.id and mediaType, but you’re missing the required timeInterval format in some SDK versions. Double-check if your client is serializing the ISO string correctly. Also, wrapupCode might not be aggregatable in that specific view. Check the view definition first.