Analytics api 400 on PT30M interval

Need some help troubleshooting… trying to pull tHandle, tAcw, and tHold for agents. docs state “intervalLength must be a valid ISO 8601 duration string.” so i’m passing PT30M to /api/v2/analytics/queues/summary. hitting a 400 BAD_REQUEST.
{
“intervalLength”: “PT30M”,
“dateFrom”: “2024-05-01T00:00:00.000Z”,
“dateTo”: “2024-05-01T23:59:59.000Z”,
“groupings”: [“agent”],
“metrics”: [“tHandle”, “tAcw”, “tHold”]
}
the error just says invalid interval. not sure if the api actually supports half-hour buckets or if there’s a hidden flag. tried PT0.5H but that broke it worse. logs show nothing useful.

Make sure you’re using the standard duration format instead of ISO 8601. Genesys Cloud’s analytics API is picky about that specific endpoint. try passing 30m or 1h directly. the docs can be misleading on this one.

"intervalLength": "30m"

worked for me when i was wrestling with queue summary pulls.

Have you tried checking the actual error payload in the response body? the docs state: “The intervalLength parameter must be a valid ISO 8601 duration string.” so PT30M should work, but there’s a known bug where the summary endpoint rejects it if the date range spans a daylight saving transition or if the queue has no data for that interval. it’s not always about the format. sometimes it’s the context.

also, make sure you’re using the correct scope. analytics:queue:view is required. if you’re getting a 400, it’s usually the interval or the groupings. try removing groupings first to see if it returns data. if it does, add agent back. the API is strict about metrics matching the groupings. check the notification API for real-time stats if you’re just building a dashboard. it’s faster and less prone to these 400 errors.

This looks like a scope issue mixed with date range logic. you need analytics:queue:read and the date range shouldn’t span midnight if you’re hitting that specific 400.

{
 "intervalLength": "PT30M",
 "dateFrom": "2024-05-01T00:00:00.000Z",
 "dateTo": "2024-05-01T12:00:00.000Z",
 "groupings": ["agent"],
 "metrics": ["tHandle", "tAcw", "tHold"]
}

it’s usually the date range, not the interval string. the suggestion to shrink the window is correct, but there’s a stricter rule here. if dateTo minus dateFrom isn’t an exact multiple of intervalLength, the API throws a 400. PT30M fits 48 times into 24 hours, so your original payload should technically work, but Genesys Cloud’s backend sometimes chokes on the 23:59:59 end time if it’s not aligned perfectly with the interval boundaries.

try setting dateTo to -05-02T00:00:00.000Z (exclusive end). this ensures the duration is exactly P1D.

{
 "intervalLength": "PT30M",
 "dateFrom": "-05-01T00:00:00.000Z",
 "dateTo": "-05-02T00:00:00.000Z",
 "groupings": ["agent"],
 "metrics": ["tHandle", "tAcw", "tHold"]
}

if that still fails, check the analytics:queue:read scope on the integration user. automation accounts often get restricted scopes by default.