Discrepancy in Service Level calculation using Analytics API interval data vs UI

Hey everyone, I’ve run into a really strange issue with the service level percentage calculation when aggregating raw interval data from the /api/v2/analytics/conversations/details/query endpoint.

Background

I am building a custom reporting dashboard in Kotlin that pulls conversation details to compute real-time service levels. The platform UI shows a Service Level of 92% for a specific queue over the last hour. However, my aggregation logic yields 84.5%. I am using the com.genesyscloud.platform.client SDK to fetch the data with intervalSize set to 15m and expanding the details parameter.

Issue

The documentation implies that Service Level is the percentage of answered conversations that were answered within the service level time. My current logic iterates through the intervals array, summing answered and answeredWithinSL counts.

val totalAnswered = intervals.sumOf { it.metrics.answered }
val answeredWithinSL = intervals.sumOf { it.metrics.answeredWithinSL }
val calculatedSL = (answeredWithinSL.toDouble() / totalAnswered) * 100

The numerator answeredWithinSL seems correct, but the denominator totalAnswered in the API response appears to include conversations that were abandoned after being in queue but before being answered, or perhaps there is a mismatch in how answered is defined versus the UI’s internal metric. The UI seems to exclude certain edge cases that the raw interval data includes.

Troubleshooting

  • Verified OAuth scopes: analytics:conversations:read is present.
  • Checked queueId matches exactly between the UI filter and the API query.
  • Compared answered vs completed metrics; completed yields even lower percentages.

Is there a specific field in the interval payload I should be using for the denominator, or is there a known discrepancy in how the Analytics API defines answered for SL calculations compared to the standard dashboard widgets?