VonyxDocs

Place a call

One request dials a number and streams the call audio to your agent.

View this page as Markdown

Place an outbound call from your Vonyx number. Once the call connects, its audio streams to and from your agent over a WebSocket.

POST https://api.vocalstack.site/v1/calls
Content-Type: application/json

Example

curl -X POST https://api.vocalstack.site/v1/calls \
  -H 'Content-Type: application/json' \
  -d '{
    "did": "91XXXXXXXXXX",
    "phone_number": "91XXXXXXXXXX",
    "websocket_url": "wss://your-agent.example.com/ws",
    "webhook_url": "https://your-server.example.com/call-status",
    "sample_rate": 8000,
    "ws_audio_format": "audio/x-l16"
  }'

Request

PropTypeDefault
did
string
-
phone_number
string
-
websocket_url
string
-
sample_rate
8000 | 16000
-
webhook_url
string
-
ws_audio_format
'audio/x-l16' | 'audio/x-mulaw'
audio/x-l16
ws_protocol
'elevenlabs'
-

Any other field is rejected with 400.

Response

{
  "status": 200,
  "message": "Call initiated",
  "data": {
    "call_id": "8b1f6a2e-4c3d-4e5f-9a7b-1c2d3e4f5a6b",
    "status": "success"
  }
}

Keep data.call_id. Status webhooks carry the same value as CallUUID.

Allow 30 seconds

The request can take about 25 seconds while it waits for a free line. Set your client timeout to at least 30 seconds.

On this page