WebRTC

Last updated September 4, 2026

WebRTC peer connection establishment

# GET /legs/{id}/ice-candidates

Get server-side ICE candidates for a WebRTC leg (trickle ICE)

Parameters

NameInTypeDescription
idpathstringrequiredLeg ID

Responses

200 Buffered ICE candidates
FieldTypeDescription
candidatesarray[object]required
donebooleanrequired
400 Leg is not a WebRTC leg
FieldTypeDescription
instance_idstringoptionalInstance identifier
errorstringrequiredError message
404 Leg not found
FieldTypeDescription
instance_idstringoptionalInstance identifier
errorstringrequiredError message
# POST /legs/{id}/ice-candidates

Send a remote ICE candidate to a WebRTC leg (trickle ICE)

Parameters

NameInTypeDescription
idpathstringrequiredLeg ID

Responses

200 Candidate added
FieldTypeDescription
instance_idstringoptionalInstance identifier
statusstringrequired
400 Invalid JSON or leg is not a WebRTC leg
FieldTypeDescription
instance_idstringoptionalInstance identifier
errorstringrequiredError message
404 Leg not found
FieldTypeDescription
instance_idstringoptionalInstance identifier
errorstringrequiredError message
500 Failed to add ICE candidate
FieldTypeDescription
instance_idstringoptionalInstance identifier
errorstringrequiredError message
# POST /webrtc/offer

Establish a WebRTC leg via SDP offer/answer

Request Body

FieldTypeDescription
sdpstringrequiredSDP offer from the browser
app_idstringoptionalApplication identifier. Carried through to all events emitted for this leg, and matched against the VSI `app_id` filter.
custom_dataanyoptionalOpaque application JSON attached to the leg. Any JSON value is accepted (object, array, string, number, boolean). It is echoed on the leg view and carried at the top level of every event published for this leg, so external state can be correlated without keeping a leg_id lookup table. Capped by CUSTOM_DATA_MAX_BYTES (default 1024 bytes, 0 = unlimited).

Responses

200 SDP answer with leg ID
FieldTypeDescription
leg_idstringrequired
sdpstringrequired
400 Invalid JSON or invalid SDP offer
FieldTypeDescription
instance_idstringoptionalInstance identifier
errorstringrequiredError message
500 Peer connection, track creation, or answer generation failed
FieldTypeDescription
instance_idstringoptionalInstance identifier
errorstringrequiredError message

Schemas

Objects used by the WebRTC endpoints above.

Error

FieldTypeDescription
instance_idstringoptionalInstance identifier
errorstringrequiredError message

ICECandidateInit

FieldTypeDescription
candidatestringrequiredICE candidate string
sdpMidstringoptionalMedia stream identification tag
sdpMLineIndexintegeroptionalIndex of the media description

StatusResponse

FieldTypeDescription
instance_idstringoptionalInstance identifier
statusstringrequired

WebRTCCandidatesResult

FieldTypeDescription
candidatesarray[object]required
donebooleanrequired

WebRTCOfferRequest

FieldTypeDescription
sdpstringrequiredSDP offer from the browser
app_idstringoptionalApplication identifier. Carried through to all events emitted for this leg, and matched against the VSI `app_id` filter.
custom_dataanyoptionalOpaque application JSON attached to the leg. Any JSON value is accepted (object, array, string, number, boolean). It is echoed on the leg view and carried at the top level of every event published for this leg, so external state can be correlated without keeping a leg_id lookup table. Capped by CUSTOM_DATA_MAX_BYTES (default 1024 bytes, 0 = unlimited).

WebRTCOfferResult

FieldTypeDescription
leg_idstringrequired
sdpstringrequired