Is there a clean way to pull agent utilization metrics broken down into 30-minute buckets using the Analytics API? We’re trying to build a real-time dashboard in our custom agent desktop wrapper, and the default hourly granularity just isn’t granular enough for our QA team. They want to see spikes in talk time during specific half-hour windows.
I’ve been poking around the /api/v2/analytics/agents/summary endpoint. The documentation mentions a groupBy parameter, but it seems limited to interval and group. When I try to set the interval to PT30M (ISO 8601 duration for 30 minutes), the response comes back empty or throws a 400 Bad Request with a vague validation error about unsupported time units.
Here’s the payload I’m sending via axios in our Node.js backend:
const response = await axios.post(
`${baseUrl}/api/v2/analytics/agents/summary`,
{
dateFrom: '2023-10-27T00:00:00.000Z',
dateTo: '2023-10-27T23:59:59.999Z',
query: {
type: 'agent',
groupBy: ['interval'],
interval: 'PT30M', // This seems to be the culprit
metrics: [
'tHandle',
'tAcw',
'tHold'
]
}
},
{
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
}
);
The error response is just {"code":"badRequest","message":"Validation failed"}. No specifics on what field is wrong. I tried changing it to PT1H and it works fine, so the endpoint is definitely reachable and the auth is good. I also tried using the groupBy array with ['interval', 'agentId'] but that didn’t help.
Is 30-minute intervals simply not supported in the summary endpoint? Or is there a different endpoint I should be hitting, like the detail endpoint? The detail endpoint feels way too heavy for just a quick utilization check, but I’m running out of options. Any pointers on the correct syntax or a workaround would be appreciated.