TeXML REST Commands

Start streaming media from a call.

Starts streaming media from a call to a specific WebSocket address.

post/texml/Accounts/{account_sid}/Calls/{call_sid}/Streams.json

Request

  • Base URL: https://api.telnyx.com/v2
  • URL: https://api.telnyx.com/v2/texml/Accounts/{account_sid}/Calls/{call_sid}/Streams.json
  • Auth: HTTP bearer

Path parameters

account_sidstring required
Example:f5586561-8ff0-4291-a51b-c7dfe4139ff9

The UUID of the Telnyx account that owns the resource, for example f5586561-8ff0-4291-a51b-c7dfe4139ff9. The account_sid path segment is kept for Twilio API compatibility, but the value is a Telnyx account UUID, not a Twilio AC... SID. It must match the account that owns the API key used to authenticate the request, otherwise the endpoint returns 404. The same value is sent as AccountSid in TeXML webhooks.

call_sidstring required

The CallSid that identifies the call to update.

Request body application/x-www-form-urlencoded

StatusCallbackstring uri

Url where status callbacks will be sent.

StatusCallbackMethod'GET' | 'POST'

HTTP method used to send status callbacks.

Track'inbound_track' | 'outbound_track' | 'both_tracks'

Tracks to be included in the stream

Namestring

The user specified name of Stream.

BidirectionalMode'mp3' | 'rtp'

Configures method of bidirectional streaming (mp3, rtp).

BidirectionalCodec'PCMU' | 'PCMA' | 'G722'

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

Urlstring

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

Example request

{
  "StatusCallback": "http://webhook.com/callback",
  "StatusCallbackMethod": "GET",
  "Track": "both_tracks",
  "Name": "My stream",
  "BidirectionalMode": "rtp",
  "BidirectionalCodec": "G722",
  "Url": "wss://www.example.com/websocket"
}

Response

Successful call streaming create response

account_sidstring
call_sidstring
sidstring

Identifier of a resource.

namestring

The user specified name of Stream.

status'in-progress'

The status of the streaming.

date_updatedstring date-time
uristring

The relative URI for this streaming resource.

Example response

{
  "account_sid": "61bf923e-5e4d-4595-a110-56190ea18a1b",
  "call_sid": "v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA",
  "sid": "e9cea0be-7dbd-4b98-98b1-c0089d9d43b0",
  "name": "My stream",
  "status": "in-progress",
  "date_updated": "2023-08-11T19:12:11Z",
  "uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls/v3:KBnLO0ZK3DhKM5s7bE9VluaSmKsOchKht_fUYvxcp8ysbmzCCtpkmA/Streams/b08f0fa1-a32c-4218-b3b5-9cf78941ccac.json"
}

Changes

No operation changes recorded.