Analytics API 500 on custom report fetch with large dataset

The /api/v2/analytics/reporting/get-report-data endpoint is returning a 500 Internal Server Error when the query spans more than 30 days with agent-level granularity. The request payload is valid and works for 7-day windows, but fails consistently at the 30-day mark. The error response body is empty, making it difficult to determine if this is a timeout or a server-side processing failure. Our integration relies on this data for real-time dashboards, so a workaround or alternative endpoint is needed immediately.

I normally fix this by switching to the async request-report endpoint for large datasets.

  1. POST to /api/v2/analytics/reporting/request-report with your query.
  2. Poll the returned reportId until status is completed.
  3. Fetch the CSV via the provided download URL.

This avoids server-side timeout limits inherent to the synchronous GET method.