Calculating Service Level from /api/v2/analytics/conversations/queues/summary intervals

We’re trying to move away from the pre-built Service Level reports in Genesys Cloud because they don’t give us the granularity we need for our custom SLA dashboards. The plan is to pull raw interval data using the JS SDK and calculate the percentage locally.

I’m querying /api/v2/analytics/conversations/queues/summary with a 15-minute interval. The response gives me answered, abandoned, and waitTime metrics, but I’m stuck on how to map those to the standard SLA formula: (Calls answered within SLA / Total answered calls) * 100.

The tricky part is the waitTime. The API returns mean, median, 90th, 95th, etc. None of these tell me exactly how many calls were answered under a specific threshold, say 20 seconds. I can’t just use the mean. If I use the 95th percentile, that’s a single data point, not a count.

Here’s the snippet I’m working with:

const analyticsApi = new PlatformClient.AnalyticsApi();
const response = await analyticsApi.getAnalyticsConversationsQueuesSummary({
 interval: 'PT15M',
 view: 'Routed',
 entityIds: [queueId],
 select: ['answered', 'abandoned', 'waitTime.mean', 'waitTime.90th']
});

Is there a way to bucket the wait times in the query itself? I checked the groupings parameter, but it seems to only group by date or entity, not by metric value ranges.

If I have to do it in Node.js, I’d need the raw list of wait times for every call in that interval. The summary API doesn’t seem to expose individual call records unless I switch to the detail view, which is way too heavy for real-time processing.

Am I missing a specific metric in the summary view that acts as a ‘count under threshold’? Or do I really have to estimate using percentiles? The last thing I want is to build a dashboard that shows 90% SLA when the actual number is 82% because we used the mean.