Hey team,
I’m trying to build a custom report that pulls conversation aggregates by 15-minute intervals. I’m hitting the POST /api/v2/analytics/conversations/aggregate/query endpoint.
The request works fine if I just group by conversationType. But the moment I add interval to the groupBy array, the API throws a 400 Bad Request. The error message is pretty generic: Invalid groupBy definition.
Here’s the JSON payload I’m sending:
{
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-10-01T23:59:59.999Z",
"groupBy": [
"interval",
"conversationType"
],
"interval": {
"type": "minute",
"size": 15
},
"metrics": [
"conversationDuration",
"conversationCount"
]
}
I’ve checked the docs and the interval object looks correct. The dateFrom and dateTo are definitely within a valid range (less than a year apart). I’m using the Python SDK genesyscloud.analytics_api but the issue persists when I call it via Postman directly, so it’s not an SDK quirk.
Is there a specific requirement for the interval groupBy that I’m missing? Or does the API require a different structure for custom intervals versus standard daily/weekly buckets?
Any help is appreciated. I’m stuck on this for a client dashboard.