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
| Param | Type | Required | Description |
|---|---|---|---|
start_date | string | Yes | ISO date, inclusive |
end_date | string | Yes | ISO date, inclusive |
metrics | string | No | Comma list: aht,fcr,csat,abandon_rate,service_level |
group_by | string | No | hour, day, week, agent, queue |
format | string | No | json (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
| Metric | Definition |
|---|---|
| AHT | Average handle time, including talk and wrap-up |
| FCR | First call resolution rate |
| CSAT | Customer 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
| Code | Description | Action |
|---|---|---|
INVALID_DATE_RANGE | end_date before start_date | Swap the dates |
RANGE_TOO_LARGE | Span exceeds 365 days | Split into multiple requests |
UNKNOWN_METRIC | Unsupported metric name | Use a value from the metrics table |
Related Links
Last Updated: May 2026