Legs

Originate an outbound SIP call

post/legs

Request body

type'sip' required

Leg type

uristring required

SIP URI to dial

fromstring

Caller ID — sets the user part of the SIP From header (e.g. "+15551234567", "alice")

privacystring

SIP Privacy header value (e.g. "id", "none")

ring_timeoutinteger

Seconds to wait for answer; 0 = no timeout

max_durationinteger

Maximum call duration in seconds after connect. Automatically hung up when reached. 0 or omitted = no limit.

codecsstring[]

Codec preference order

headersobject

Custom SIP headers to include in the outbound INVITE (e.g. X-Correlation-ID)

room_idstring

Room ID to auto-add the leg to once media is ready (early_media or connected). If the room does not exist, it is automatically created.

webhook_urlstring uri

Route all events for this leg exclusively to this URL instead of global webhooks.

webhook_secretstring

HMAC-SHA256 signing secret for the per-leg webhook.

Response

Leg created

instance_idstring

Instance identifier

idstring required

Unique leg identifier (UUID)

type'sip_inbound' | 'sip_outbound' | 'webrtc' 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)

heldboolean required

Whether the call is on hold (SIP legs only)

sip_headersobject

X-* headers from the inbound INVITE. Only present on sip_inbound legs.

Changes