Legs

Replace a leg's custom data

Replaces the leg's custom_data outright — there is no merge. The new value is carried at the top level of every event published for this leg from the next event onwards, and is released after leg.disconnected. Sending null clears it, the same as DELETE.

put/legs/{id}/custom-data

Request body

{"stackTrail":"components:schemas:SetLegCustomDataRequest:properties:custom_data","oasType":"schema","type":"unknown","description":"New opaque application JSON for the leg. Any JSON value is accepted (object, array, string, number, boolean). Replaces the existing value outright — there is no merge. Sending null clears it, the same as DELETE. Required: omitting the field is rejected with 400. Capped by CUSTOM_DATA_MAX_BYTES (default 1024 bytes, 0 = unlimited)."}

Response

Updated leg view

instance_idstring

Instance identifier

idstring required

Unique leg identifier (UUID)

type'sip_inbound' | 'sip_outbound' | 'webrtc' | 'whatsapp_in' | 'whatsapp_out' | 'websocket_in' | 'websocket_out' | 'moq_in' | 'livekit_publish' | 'livekit_participant' required

Leg type

state'ringing' | 'early_media' | 'connected' | 'held' | 'hung_up' required

Leg state

room_idstring

Room ID if the leg is in a room, empty otherwise

mutedboolean required

Whether the leg is muted (cannot be heard by others)

deafboolean required

Whether the leg is deaf (cannot hear others)

accept_dtmfboolean required

Whether the leg receives DTMF digits broadcast from other legs in the same room. Defaults to true.

heldboolean required

Whether the call is on hold (SIP legs only)

rolestring

Routing role used by the room's audio routing matrix (e.g. "customer", "agent", "supervisor"). Empty string means unroled (full mesh).

app_idstring

Application identifier for event stream filtering.

sip_headersobject

Deprecated: X-* headers from the inbound INVITE. Only present on sip_inbound legs. Use headers for new code; it carries the same map plus surfaces handshake headers for websocket legs.

headersobject

Custom protocol headers exposed by the leg's transport — X-/P- headers from a SIP INVITE, the WebSocket upgrade request, or supplied at outbound dial time.

{"stackTrail":"components:schemas:Leg:properties:custom_data","oasType":"schema","type":"unknown","description":"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)."}

Changes

Changed in 1 of the 68 revisions of this API.1