Analytics API 413 Error on 90-Day Query

Can anyone clarify the best way to split a 90-day audit log query that keeps hitting a 413 Entity Too Large error? I’m using the Python SDK to call /api/v2/analytics/details/query and the JSON payload just gets too big for a single POST request.

{'entity': 'audit:log', 'intervalStart': '2023-10-01', 'intervalEnd': '2023-12-31'}

thanks

# split 90 days into 7-day chunks to dodge the 413
(0...90).step(7).each do |offset|
 start = Date.today - (90 - offset)
 end_date = start + 6
 client.post_analytics_details_query({ entity: 'audit:log', intervalStart: start.to_s, intervalEnd: end_date.to_s })
end

Have you tried chunking the date range instead of blasting a single 90-day payload? The API chokes on that size, so breaking it into weekly batches usually clears the 413 error. works like a charm in my rails middleware.

Have you tried batching those 7-day chunks? the 413 isn’t just about date range, it’s about payload size. audit logs are heavy. if you’re still hitting limits, shrink the window to 3 days or drop non-essential fields. i usually see this when pulling full event details.