Can anyone clarify why POST /api/v2/analytics/interactions/details/query returns 413 Entity Too Large when the date range exceeds 7 days? I am splitting the query into 12-day chunks as per Genesys Docs, but the payload size still triggers the limit. My JSON body includes only dateFrom, dateTo, and a minimal groupBy. Is there a strict byte limit per request regardless of result count?
Make sure you reduce the payload size by removing unnecessary fields and compressing the request body if possible.
import gzip
import json
import requests
url = "https://api.mypurecloud.com/api/v2/analytics/interactions/details/query"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Encoding": "gzip"
}
payload = {
"dateFrom": "2023-10-01T00:00:00.000Z",
"dateTo": "2023-10-07T23:59:59.999Z",
"groupBy": ["id"]
}
compressed_payload = gzip.compress(json.dumps(payload).encode('utf-8'))
response = requests.post(url, headers=headers, data=compressed_payload)
print(response.status_code)
This approach should help bypass the 413 error by significantly reducing the request body size.
the problem here is interactions/details returns raw rows, not aggregates. 90 days of detail data will exceed memory limits regardless of payload size. switch to interactions/summary/query with interval grouping to get aggregated metrics instead. use purecloud.analytics.get_analytics_interactions_summary_query in sdk for this.
The main issue here is that detail queries are inherently inefficient for large date ranges.
Switch to summary queries with interval grouping to handle the aggregation server-side.
const summaryQuery = {
dateFrom: "2023-10-01T00:00:00.000Z",
dateTo: "2023-12-30T00:00:00.000Z",
interval: "P1D",
groupBy: ["mediaType"]
};