WebRTC
Last updated October 13, 2026
WebRTC peer connection establishment
Get server-side ICE candidates for a WebRTC leg (trickle ICE)
Parameters
| Name | In | Type | | Description |
|---|
id | path | string | required | Leg ID |
Responses
200
Buffered ICE candidates| Field | Type | | Description |
|---|
candidates | array[object] | required | |
done | boolean | required | |
400
Leg is not a WebRTC leg| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
404
Leg not found| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
Send a remote ICE candidate to a WebRTC leg (trickle ICE)
Parameters
| Name | In | Type | | Description |
|---|
id | path | string | required | Leg ID |
Responses
200
Candidate added| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
status | string | required | |
400
Invalid JSON or leg is not a WebRTC leg| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
404
Leg not found| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
500
Failed to add ICE candidate| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
Restart ICE on a WebRTC leg
Applies a new SDP offer carrying fresh ICE credentials (browser restartIce()) to the existing leg and returns the answer. The leg id, media session and room membership are kept. Trickle the new candidates through /legs/{id}/ice-candidates after the answer arrives.
Parameters
| Name | In | Type | | Description |
|---|
id | path | string | required | Leg ID |
Request Body
| Field | Type | | Description |
|---|
sdp | string | required | |
Responses
200
SDP answer| Field | Type | | Description |
|---|
leg_id | string | required | |
sdp | string | required | |
400
Invalid JSON, invalid SDP offer, offer does not change ICE credentials, or leg is not a WebRTC leg| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
404
Leg not found| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
500
Failed to create answer| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
Establish a WebRTC leg via SDP offer/answer
Request Body
| Field | Type | | Description |
|---|
sdp | string | required | SDP offer from the browser |
app_id | string | optional | Application identifier. Carried through to all events emitted for this leg, and matched against the VSI `app_id` filter. |
custom_data | any | optional | Opaque 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| Field | Type | | Description |
|---|
leg_id | string | required | |
sdp | string | required | |
400
Invalid JSON or invalid SDP offer| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
500
Peer connection, track creation, or answer generation failed| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
Schemas
Objects used by the WebRTC endpoints above.
| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
error | string | required | Error message |
| Field | Type | | Description |
|---|
candidate | string | required | ICE candidate string |
sdpMid | string | optional | Media stream identification tag |
sdpMLineIndex | integer | optional | Index of the media description |
| Field | Type | | Description |
|---|
instance_id | string | optional | Instance identifier |
status | string | required | |
| Field | Type | | Description |
|---|
candidates | array[object] | required | |
done | boolean | required | |
| Field | Type | | Description |
|---|
sdp | string | required | |
| Field | Type | | Description |
|---|
sdp | string | required | SDP offer from the browser |
app_id | string | optional | Application identifier. Carried through to all events emitted for this leg, and matched against the VSI `app_id` filter. |
custom_data | any | optional | Opaque 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). |
| Field | Type | | Description |
|---|
leg_id | string | required | |
sdp | string | required | |