Skip to main content

Create a Leg

Create a new call leg to an endpoint.

HTTP Request​

POST /v2/accounts/<account_sid>/legs

Required Parameters​

ParameterTypeDescription
contact_uriStringPhone number or SIP URI
exophoneStringOutbound number/SIP URI
leg_event_endpointStringgRPC endpoint for events

Optional Parameters​

ParameterTypeDefaultDescription
network_typeStringpstnpstn or voip
custom_paramString—User-defined parameter
time_limitInteger14400Max duration in seconds (4 hours)
timeoutInteger30Connection timeout in seconds
setup_timeoutInteger30Initialization timeout
ring_timeoutInteger30Ringing timeout
requested_dc_codeString—Data center preference
requested_nso_codeString—Network switching office preference
reference_leg_sidString—Co-locate with existing leg
amd_enableBooleanfalseEnable answering machine detection
async_amdBooleanfalseAsynchronous machine detection
priorityStringnormalnormal or high

Response​

{
"leg_sid": "leg_unique_id",
"created_at": "2024-01-15T10:30:00Z",
"account_sid": "account_id",
"contact_uri": "+919999999999",
"network_type": "pstn",
"exophone": "+918888888888"
}