Call Center API Reference
Complete reference for the AfriRoute Call Center voice APIs: calls, agents, queues, IVR, transfers, conferencing, monitoring, recordings, and analytics.
Overview
All endpoints share a common base URL and authentication scheme.
- Base URL:
https://api.afriroute.ai - Auth:
Authorization: Bearer $AFRIROUTE_API_KEY - Content type:
application/json - Rate limit: 100 requests/second per key
Calls
Make an Outbound Call
POST /v1/voice/call
| Field | Type | Required | Description |
|---|---|---|---|
from | string | Yes | Caller ID number (E.164) |
to | string | Yes | Destination number (E.164) |
agent_id | string | No | Agent to connect on answer |
record | boolean | No | Record the call |
custom_data | object | No | Metadata echoed in webhooks |
curl -X POST https://api.afriroute.ai/api/v1/voice/call \
-H "Authorization: Bearer $AFRIROUTE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": "+251116000000",
"to": "+251911234567",
"agent_id": "agent_sarah_k",
"record": true
}'
{ "call_id": "call_abc123", "status": "initiated", "started_at": "2026-05-28T09:30:00Z" }
Get Call
GET /v1/voice/call/:call_id
Hang Up
POST /v1/voice/call/:call_id/hangup
Transfers & Conference
Transfer
POST /v1/voice/transfer
await fetch('https://api.afriroute.ai/api/v1/voice/transfer', {
method: 'POST',
headers: { 'Authorization': 'Bearer $AFRIROUTE_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify({
call_id: 'call_abc123',
transfer_type: 'warm', // warm | cold
destination: 'agent_john_m'
})
});
Conference
POST /v1/voice/conference
import requests
requests.post(
'https://api.afriroute.ai/api/v1/voice/conference',
headers={'Authorization': 'Bearer $AFRIROUTE_API_KEY'},
json={
'name': 'Customer Escalation',
'participants': ['+251911234567', 'agent_sarah_k', 'sup_mary'],
'record': True
}
)
Agents
| Method | Path | Description |
|---|---|---|
| POST | /v1/voice/agent/login | Log an agent in |
| POST | /v1/voice/agent/status | Update availability |
| GET | /v1/voice/agent/:agent_id/context | Customer screen pop |
| POST | /v1/voice/agent/logout | Log an agent out |
Queues
| Method | Path | Description |
|---|---|---|
| POST | /v1/voice/queue | Create a queue |
| GET | /v1/voice/queue | List queues |
| GET | /v1/voice/queue/:queue_id | Queue status |
| PATCH | /v1/voice/queue/:queue_id | Update a queue |
IVR & Routing
| Method | Path | Description |
|---|---|---|
| POST | /v1/voice/ivr | Create an IVR |
| PATCH | /v1/voice/ivr/:ivr_id | Update an IVR |
| POST | /v1/voice/numbers/:number/assign | Attach a number to an IVR/queue |
| POST | /v1/voice/routing/rules | Define a routing rule |
| POST | /v1/voice/routing/business-hours | Set business hours |
| POST | /v1/voice/routing/simulate | Test routing |
Monitoring & Recordings
| Method | Path | Description |
|---|---|---|
| POST | /v1/voice/monitor | Start listen/whisper/barge |
| PATCH | /v1/voice/monitor/:monitor_id | Switch mode |
| DELETE | /v1/voice/monitor/:monitor_id | Stop monitoring |
| GET | /v1/voice/recording/:recording_id | Fetch a recording |
{
"recording_id": "rec_xyz789",
"call_id": "call_abc123",
"duration": 245,
"file_url": "https://recordings.afriroute.ai/xyz789.mp3",
"transcription": { "available": true, "language": "en" }
}
Analytics
| Method | Path | Description |
|---|---|---|
| GET | /v1/call-center/metrics/realtime | Live queue/agent metrics |
| GET | /v1/call-center/reports | Historical KPI reports |
Webhooks
AfriRoute posts events to your configured callback URL. Verify the X-AfriRoute-Signature HMAC-SHA256 header.
| Event | Description |
|---|---|
call.initiated | Outbound call started |
call.answered | Call connected |
call.completed | Call ended |
agent.status_changed | Agent presence changed |
recording.ready | Recording available |
Error Handling
| Code | HTTP | Description |
|---|---|---|
UNAUTHORIZED | 401 | Missing/invalid API key |
NOT_FOUND | 404 | Resource does not exist |
RATE_LIMITED | 429 | Exceeded 100 req/s |
VALIDATION_ERROR | 422 | Invalid request body |
Related Links
Last Updated: May 2026