My configuration keeps failing… I am trying to build a custom interval report using POST /api/v2/analytics/conversations/aggregates/query from a Zapier custom action but receive a 400 Bad Request. The payload structure seems correct according to the docs but the error response is generic.
You need to stop sending the query as a JSON body. The analytics endpoint strictly requires the query definition in the request body. Zapier’s custom action builder often defaults to a GET-like structure or ignores the body for POST requests, which triggers the 400 error because the parser expects a specific JSON payload.
Switch the request type to POST.
Ensure the JSON payload is sent in the Body section of your Zapier step, not as query parameters.
Ensure the dateRange object is structured correctly within the JSON body as per the schema.
The documentation implies a body for complex queries, and the actual API spec for aggregates confirms it is body-based. Here is the correct curl equivalent to verify the structure before hardcoding it into Zapier:
This looks like a parameter serialization issue common in low-code integrations.
The analytics aggregates endpoint expects the query parameters in the request body, not as URL-encoded query strings. Zapier often mishandles this encoding for POST requests.
Use this curl structure to validate the correct syntax: curl -X POST "https://api.mypurecloud.com/api/v2/analytics/conversations/aggregates/query" -H "Authorization: Bearer <token>" -H "Content-Type: application/json" -d '{"dateRange": {"start": "2023-01-01T00:00:00.000Z", "end": "2023-01-02T00:00:00.000Z"}, "groupBy": ["queue"]}'.
Check your Zapier step configuration because the platform strictly rejects JSON bodies for this GET endpoint. The parser ignores the body entirely, causing the 400 error. Move dateRange and groupBy to the Query Params section. This aligns with the previous suggestion and ensures proper URL encoding for the analytics API.