Skip to main content

Call Center Analytics

Track queue health, agent performance, and customer experience with real-time metrics and historical reports.

Overview​

AfriRoute Analytics exposes two data surfaces:

  • Real-time metrics — live queue depth, wait times, agent status, and service level
  • Historical reports — aggregated KPIs over a date range, exportable as JSON or CSV

Base URL: https://api.afriroute.ai — Auth: Authorization: Bearer $AFRIROUTE_API_KEY

Endpoints​

Real-Time Metrics​

GET /v1/call-center/metrics/realtime
curl https://api.afriroute.ai/api/v1/call-center/metrics/realtime \
-H "Authorization: Bearer $AFRIROUTE_API_KEY"
{
"timestamp": "2026-05-28T09:45:00Z",
"queues": [
{
"queue_id": "queue_support",
"calls_waiting": 5,
"agents_available": 3,
"agents_on_call": 7,
"longest_wait_time": 125,
"average_wait_time": 45,
"abandoned_calls": 2,
"service_level": 87.5
}
],
"agents": [
{
"agent_id": "agent_sarah_k",
"status": "on_call",
"calls_handled_today": 23,
"average_handle_time": 280
}
]
}

Historical Report​

GET /v1/call-center/reports
ParamTypeRequiredDescription
start_datestringYesISO date, inclusive
end_datestringYesISO date, inclusive
metricsstringNoComma list: aht,fcr,csat,abandon_rate,service_level
group_bystringNohour, day, week, agent, queue
formatstringNojson (default) or csv
const url = new URL('https://api.afriroute.ai/api/v1/call-center/reports');
url.search = new URLSearchParams({
start_date: '2026-05-01',
end_date: '2026-05-28',
metrics: 'aht,fcr,csat,abandon_rate',
group_by: 'day'
});

const res = await fetch(url, {
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY' }
});
console.log(await res.json());
import requests

r = requests.get(
'https://api.afriroute.ai/api/v1/call-center/reports',
headers={'Authorization': 'Bearer $AFRIROUTE_API_KEY'},
params={
'start_date': '2026-05-01',
'end_date': '2026-05-28',
'metrics': 'service_level,csat',
'group_by': 'agent'
}
)
print(r.json())
{
"period": { "start": "2026-05-01", "end": "2026-05-28" },
"group_by": "day",
"rows": [
{
"date": "2026-05-28",
"calls_handled": 412,
"average_handle_time": 268,
"first_call_resolution": 0.81,
"csat": 4.4,
"abandon_rate": 0.06,
"service_level": 0.88
}
]
}

Key Metrics​

MetricDefinition
AHTAverage handle time, including talk and wrap-up
FCRFirst call resolution rate
CSATCustomer satisfaction score (1–5)
Service Level% of calls answered within target threshold
Abandon Rate% of callers who hang up before being answered

Best Practices​

  • Poll real-time metrics no more than once per 5 seconds; use them for wallboards, not billing.
  • Pull historical reports for billing and SLA review rather than aggregating real-time data yourself.
  • Export CSV for finance and BI tools; keep JSON for programmatic dashboards.
  • Track abandon rate alongside service level — a low service level usually drives abandonment up.

Error Handling​

CodeDescriptionAction
INVALID_DATE_RANGEend_date before start_dateSwap the dates
RANGE_TOO_LARGESpan exceeds 365 daysSplit into multiple requests
UNKNOWN_METRICUnsupported metric nameUse a value from the metrics table

Last Updated: May 2026