I’m hitting a wall with the Analytics API when trying to pull voice summaries for a full quarter. I’ve got a Terraform module that spins up a scheduled data export job, but the initial test query is failing hard with a 413 Entity Too Large error.
The payload is pretty standard, but the date range is the culprit. I’m sending a GET request to /api/v2/analytics/voice/summaries with the following query parameters:
{
"query": {
"type": "conversation",
"filter": {
"type": "interval",
"name": "date",
"unit": "day",
"interval": 1,
"rangeStart": "2023-10-01T00:00:00Z",
"rangeEnd": "2023-12-31T23:59:59Z"
}
},
"groupings": ["user"],
"aggregations": [
{
"type": "sum",
"name": "talk_time"
}
]
}
The error response is immediate. No partial data. Just a 413. I know the API has limits on the size of the request body and the complexity of the query, but 90 days shouldn’t be that big, right? Or maybe the number of unique users in that window is blowing up the aggregation size before it even leaves the client?
I’m thinking I need to split this into monthly chunks. Is there a hard limit on the number of days or the number of grouped entities I can request in a single call? If I break it down into three separate 2023-10, 2023-11, and 2023-12 requests and merge the results client-side, will that work? Or is there a specific pagination pattern for analytics queries that I’m missing?
I’ve tried reducing the granularity to week instead of day but that doesn’t match the reporting requirement. Need daily stats.
Any ideas on how to structure this without getting blocked? I’m using the Python SDK currently but might switch to raw HTTP if the SDK isn’t handling the chunking well.