Trying to build a custom interval report for voice conversations using the Analytics API. The standard SDK method analyticsApi.postAnalyticsConversationsAggregates keeps throwing a 400 Bad Request. The payload looks correct according to the schema, but the backend rejects it.
Here’s the query body:
{
"dateRange": {
"start": "2023-10-01T00:00:00.000Z",
"end": "2023-10-02T00:00:00.000Z"
},
"groupBy": ["timeInterval"],
"timeInterval": {
"durationMs": 3600000
},
"filter": {
"type": "and",
"clauses": [
{
"path": "mediaTypes",
"operator": "in",
"value": ["voice"]
}
]
},
"metrics": ["totalHandleTime"]
}
The error response says dateRange.start is invalid. I’ve tried ISO 8601 with and without milliseconds, and even epoch milliseconds. Nothing works. Is the API expecting a specific timezone offset or a different format entirely? The docs are vague on this.