Start streaming raw audio from a live call to a WebSocket URL.
curl --request POST \
--url https://api.vobiz.ai/api/v1/Account/{auth_id}/Call/{call_uuid}/Stream/ \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"service_url": "wss://your-server.com/ws"
}
'{
"stream_id": "str_XXXXXXXXXX",
"message": "Stream started"
}Documentation Index
Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt
Use this file to discover all available pages before exploring further.
POST https://api.vobiz.ai/api/v1/Account/{auth_id}/Call/{call_uuid}/Stream/
stream_id.
X-Auth-ID - Your account Auth IDX-Auth-Token - Your account Auth TokenContent-Type: application/jsonwss:// in production.| Field | Type | Required | Description |
|---|---|---|---|
auth_id | string | Yes | Your Vobiz authentication ID. |
call_uuid | string | Yes | UUID of the active call to attach the stream to. |
| Field | Type | Required | Description |
|---|---|---|---|
service_url | string | Yes | WebSocket URL (wss:// or ws://) to which Vobiz forwards the call audio. Must be reachable from the public internet. |
audio_track | string | No | Track of the call to fork to the WebSocket. One of “inbound”, “outbound”, “both”. Default: “inbound”. When bidirectional is true, only “inbound” is supported. |
bidirectional | boolean | No | If true, the WebSocket may send audio back into the call using playAudio events. Default: false. |
content_type | string | No | Audio encoding format. Options: “audio/x-l16;rate=8000”, “audio/x-l16;rate=16000”, “audio/x-l16;rate=24000”, or “audio/x-mulaw;rate=8000”. Default: “audio/x-l16;rate=8000”. |
stream_timeout | integer | No | Maximum stream duration in seconds. Vobiz automatically stops the stream when this limit is reached. Default: 86400 (24 hours). |
status_callback_url | string | No | URL invoked when the stream status changes (connected, stopped, timeout, failed). |
status_callback_method | string | No | HTTP method for status_callback_url. One of “GET”, “POST”. Default: “POST”. |
extra_headers | string | No | Comma-separated list of additional HTTP headers (header:value) sent when opening the WebSocket connection. Useful for auth tokens. |
audio/x-mulaw at 8000 Hz for maximum compatibility with telephony carriers and the lowest bandwidth usage.status_callback_url with the following events:
| Event | Description |
|---|---|
Stream connected | Audio streaming has started and audio is being forwarded to the WebSocket. |
Stream stopped | Streaming was stopped intentionally via the API or XML. |
Stream timeout | The configured stream_timeout duration was reached. |
Stream failed | The WebSocket connection failed or was dropped unexpectedly. |
bidirectional=true, your WebSocket server can send audio back to the call by sending a JSON message:
{
"event": "playAudio",
"media": {
"contentType": "audio/x-l16",
"sampleRate": "8000",
"payload": "<base64-encoded-audio>"
}
}
| Field | Values |
|---|---|
contentType | audio/x-l16, audio/x-mulaw |
sampleRate | 8000, 16000 |
payload | Base64-encoded raw audio |
stream_id.
{
"message": "audio streaming started",
"stream_id": "728e273b-9c2c-4902-8509-2f88224cd3d5"
}
curl -X POST 'https://api.vobiz.ai/api/v1/Account/{auth_id}/Call/{call_uuid}/Stream/' \
-H 'X-Auth-ID: {auth_id}' \
-H 'X-Auth-Token: {auth_token}' \
-H 'Content-Type: application/json' \
-d '{
"service_url": "wss://your-server.com/ws",
"bidirectional": true,
"audio_track": "both",
"content_type": "audio/x-l16;rate=16000",
"status_callback_url": "https://your-server.com/stream-status"
}'
Your Vobiz account Auth ID
Your Vobiz account Auth Token
Your account Auth ID
"MA_XXXXXX"
Stream started
Was this page helpful?
curl --request POST \
--url https://api.vobiz.ai/api/v1/Account/{auth_id}/Call/{call_uuid}/Stream/ \
--header 'Content-Type: application/json' \
--header 'X-Auth-ID: <api-key>' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"service_url": "wss://your-server.com/ws"
}
'{
"stream_id": "str_XXXXXXXXXX",
"message": "Stream started"
}