Voice Calls API
The Voice API allows you to initiate outbound calls, play audio files, and manage call flows programmatically.
Initiate a Call
POST
/callsInitiates a new outbound voice call to a single recipient.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | The phone number to call (E.164 format). |
| audio_url | string | Yes | URL of the audio file to play. |
| callback_url | string | No | Webhook URL for call status updates. |
Example Request
bash
curl -X POST https://api.devsecit.com/v1/calls \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919876543210",
"audio_url": "https://example.com/welcome.mp3",
"callback_url": "https://myapp.com/webhooks/voice"
}'Example Response
json
{
"id": "ca_123456789",
"status": "queued",
"created_at": "2023-10-27T10:00:00Z"
}