Developer Documentation

Telephony REST API & Real-Time Webhooks

SanalPBX provides powerful REST API endpoints and real-time Webhook dispatches to seamlessly integrate with your CRM, ERP, and internal softwares.

1. Authentication (API Key Authentication)

Send the Authorization: Bearer <API_KEY> header with every request.

POST /api/v1/telephony/originate (Click-to-Call)
{
  "extension": "1001",
  "destination": "+905321112233",
  "caller_id": "+908508500321",
  "timeout": 30
}

2. Webhook Notifications (Call Events)

When a call starts (call.initiated), gets answered (call.answered), or a recording is ready (recording.ready), our dispatchers send HTTP POST JSON events to your webhook URL.

Webhook Payload: recording.ready
{
  "event": "recording.ready",
  "call_uuid": "8f41c2a0-95e4-40ac-b272-33e554cb4a00",
  "caller": "+905321112233",
  "extension": "1001",
  "duration": 165,
  "recording_url": "https://storage.sanalpbx.com/records/2026/08/rec_8f41.mp3"
}