Skip to main content

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
FieldTypeRequiredDescription
fromstringYesCaller ID number (E.164)
tostringYesDestination number (E.164)
agent_idstringNoAgent to connect on answer
recordbooleanNoRecord the call
custom_dataobjectNoMetadata 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​

MethodPathDescription
POST/v1/voice/agent/loginLog an agent in
POST/v1/voice/agent/statusUpdate availability
GET/v1/voice/agent/:agent_id/contextCustomer screen pop
POST/v1/voice/agent/logoutLog an agent out

Queues​

MethodPathDescription
POST/v1/voice/queueCreate a queue
GET/v1/voice/queueList queues
GET/v1/voice/queue/:queue_idQueue status
PATCH/v1/voice/queue/:queue_idUpdate a queue

IVR & Routing​

MethodPathDescription
POST/v1/voice/ivrCreate an IVR
PATCH/v1/voice/ivr/:ivr_idUpdate an IVR
POST/v1/voice/numbers/:number/assignAttach a number to an IVR/queue
POST/v1/voice/routing/rulesDefine a routing rule
POST/v1/voice/routing/business-hoursSet business hours
POST/v1/voice/routing/simulateTest routing

Monitoring & Recordings​

MethodPathDescription
POST/v1/voice/monitorStart listen/whisper/barge
PATCH/v1/voice/monitor/:monitor_idSwitch mode
DELETE/v1/voice/monitor/:monitor_idStop monitoring
GET/v1/voice/recording/:recording_idFetch 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​

MethodPathDescription
GET/v1/call-center/metrics/realtimeLive queue/agent metrics
GET/v1/call-center/reportsHistorical KPI reports

Webhooks​

AfriRoute posts events to your configured callback URL. Verify the X-AfriRoute-Signature HMAC-SHA256 header.

EventDescription
call.initiatedOutbound call started
call.answeredCall connected
call.completedCall ended
agent.status_changedAgent presence changed
recording.readyRecording available

Error Handling​

CodeHTTPDescription
UNAUTHORIZED401Missing/invalid API key
NOT_FOUND404Resource does not exist
RATE_LIMITED429Exceeded 100 req/s
VALIDATION_ERROR422Invalid request body

Last Updated: May 2026