v53

OpenAPI 3.1.0raw.githubusercontent.com2026-08-041,1941,9384.1 MB
Call Commands

Streaming start

Start streaming the media from a call to a specific WebSocket address or Dialogflow connection in near-realtime. Audio will be delivered as base64-encoded RTP payload (raw audio), wrapped in JSON payloads.

Please find more details about media streaming messages specification under the link.

post/calls/{call_control_id}/actions/streaming_start

Path parameters

call_control_idstring required

Unique identifier and token for controlling the call

Request body

client_statestring

Use this field to add state to every subsequent webhook. It must be a valid Base-64 encoded string.

command_idstring

Use this field to avoid duplicate commands. Telnyx will ignore any command with the same command_id for the same call_control_id.

enable_dialogflowboolean

Enables Dialogflow for the current call. The default value is false.

stream_auth_tokenstring

An authentication token to be sent as part of the WebSocket connection. Maximum length is 4000 characters.

stream_bidirectional_codec'PCMU' | 'PCMA' | 'G722' | 'OPUS' | 'AMR-WB' | 'L16'

Indicates codec for bidirectional streaming RTP payloads. Used only with stream_bidirectional_mode=rtp. Case sensitive.

stream_bidirectional_mode'mp3' | 'rtp'

Configures method of bidirectional streaming (mp3, rtp).

stream_bidirectional_sampling_rate8000 | 16000 | 22050 | 24000 | 48000

Audio sampling rate.

stream_bidirectional_target_legs'both' | 'self' | 'opposite'

Specifies which call legs should receive the bidirectional stream audio.

stream_codec'PCMU' | 'PCMA' | 'G722' | 'OPUS' | 'AMR-WB' | 'L16' | 'default'

Specifies the codec to be used for the streamed audio. When set to 'default' or when transcoding is not possible, the codec from the call will be used.

stream_track'inbound_track' | 'outbound_track' | 'both_tracks'

Specifies which track should be streamed.

stream_urlstring

The destination WebSocket address where the stream is going to be delivered.

Example request

{
  "client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
  "command_id": "891510ac-f3e4-11e8-af5b-de00688a4901",
  "dialogflow_config": {
    "analyze_sentiment": false,
    "partial_automated_agent_reply": false
  },
  "enable_dialogflow": false,
  "stream_track": "both_tracks",
  "stream_url": "wss://www.example.com/websocket"
}

Response

Successful response upon making a call control command.

Example response

{
  "data": {
    "result": "ok"
  }
}