HTTP 400: Invalid request body. The query structure does not match the expected schema.
I am attempting to build a custom interval report using the Analytics Conversations Aggregates endpoint (/api/v2/analytics/conversations/aggregates) from an n8n HTTP node. My goal is to retrieve handle time metrics for a specific queue over the last 24 hours.
The request body I am sending is structured as follows:
{
"query": {
"groupBy": ["queue.id"],
"interval": "P1D",
"startTime": "2023-10-27T00:00:00.000Z",
"endTime": "2023-10-28T00:00:00.000Z",
"metrics": ["handleTime", "wrapupTime"]
},
"filters": {
"queue.id": ["550e8400-e29b-41d4-a716-446655440000"]
}
}
The API consistently returns a 400 error. I have verified the OAuth token is valid and has the analytics:report:read scope. The documentation suggests interval should be ISO 8601 duration, but I suspect the issue might lie in how I am nesting the filters object versus the query object.
Is there a specific schema requirement for the filters array that I am missing? Or is the groupBy field conflicting with the filter structure in this endpoint version?