/v2/accounts/{account_sid}/legs/{leg_sid}/actions
https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions
Authorization: Basic <BASE64_APIKEY_APITOKEN>
Content-Type: application/json
{
"action_custom_param": "answer_call",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Answer></Answer></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "answer_call",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Answer></Answer></Flow>"
}'
{
"action_custom_param": "test_dial",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Dial contactUri=\"9791111865\" exophone=\"02048566335\" networkType=\"pstn\" absorbDtmf=\"true\"></Dial></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "test_dial",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Dial contactUri=\"9791111865\" exophone=\"02048566335\" networkType=\"pstn\" absorbDtmf=\"true\"></Dial></Flow>"
}'
{
"action_custom_param": "collect_digits",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Gather numDigits=\"4\" timeoutInSec=\"10\" finishOnKey=\"#\"></Gather></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "collect_digits",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Gather numDigits=\"4\" timeoutInSec=\"10\" finishOnKey=\"#\"></Gather></Flow>"
}'
{
"action_custom_param": "hangup_call",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Hangup></Hangup></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "hangup_call",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Hangup></Hangup></Flow>"
}'
{
"action_custom_param": "hold_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Hold></Hold></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "hold_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Hold></Hold></Flow>"
}'
{
"action_custom_param": "join_bridge",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><JoinBridge bridgeSid=\"BRIDGE_SID\" absorbDtmf=\"true\"></JoinBridge></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "join_bridge",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><JoinBridge bridgeSid=\"BRIDGE_SID\" absorbDtmf=\"true\"></JoinBridge></Flow>"
}'
{
"action_custom_param": "leave_bridge",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><LeaveBridge></LeaveBridge></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "leave_bridge",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><LeaveBridge></LeaveBridge></Flow>"
}'
{
"action_custom_param": "mute_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Mute direction=\"out\"></Mute></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "mute_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Mute direction=\"out\"></Mute></Flow>"
}'
Nested media actions only.
{
"action_custom_param": "play_sequence",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><PlaySequence><StartPlay>https://example.com/audio.wav</StartPlay><Say>Hello</Say></PlaySequence></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "play_sequence",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><PlaySequence><StartPlay>https://example.com/audio.wav</StartPlay><Say>Hello</Say></PlaySequence></Flow>"
}'
{
"action_custom_param": "refer_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Refer legEventEndpoint=\"grpc://host:port\"></Refer></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "refer_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Refer legEventEndpoint=\"grpc://host:port\"></Refer></Flow>"
}'
{
"action_custom_param": "say_text",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Say>Hello</Say></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "say_text",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><Say>Hello</Say></Flow>"
}'
{
"action_custom_param": "send_digits",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><SendDigits duration=\"100\" between=\"500\">1234#</SendDigits></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "send_digits",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><SendDigits duration=\"100\" between=\"500\">1234#</SendDigits></Flow>"
}'
{
"action_custom_param": "start_monitoring",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartMonitoring monitoringLegSid=\"LEG_SID\" rxAudio=\"muted\"></StartMonitoring></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "start_monitoring",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartMonitoring monitoringLegSid=\"LEG_SID\" rxAudio=\"muted\"></StartMonitoring></Flow>"
}'
{
"action_custom_param": "start_play",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartPlay>https://example.com/audio.wav</StartPlay></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "start_play",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartPlay>https://example.com/audio.wav</StartPlay></Flow>"
}'
{
"action_custom_param": "start_recording",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartRecording direction=\"both\" format=\"wav\" storageType=\"https\" storageURL=\"https://example.com/upload\"></StartRecording></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "start_recording",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartRecording direction=\"both\" format=\"wav\" storageType=\"https\" storageURL=\"https://example.com/upload\"></StartRecording></Flow>"
}'
{
"action_custom_param": "start_stream",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartStream streamType=\"bidirectional\" streamUrl=\"wss://example.com/stream\"></StartStream></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "start_stream",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StartStream streamType=\"bidirectional\" streamUrl=\"wss://example.com/stream\"></StartStream></Flow>"
}'
{
"action_custom_param": "stop_monitoring",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopMonitoring></StopMonitoring></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "stop_monitoring",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopMonitoring></StopMonitoring></Flow>"
}'
{
"action_custom_param": "stop_play",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopPlay></StopPlay></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "stop_play",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopPlay></StopPlay></Flow>"
}'
{
"action_custom_param": "stop_recording",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopRecording></StopRecording></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "stop_recording",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopRecording></StopRecording></Flow>"
}'
{
"action_custom_param": "stop_say",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopSay></StopSay></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "stop_say",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopSay></StopSay></Flow>"
}'
{
"action_custom_param": "stop_stream",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopStream streamSid=\"STREAM_SID\"></StopStream></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "stop_stream",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><StopStream streamSid=\"STREAM_SID\"></StopStream></Flow>"
}'
{
"action_custom_param": "unhold_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><UnHold></UnHold></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "unhold_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><UnHold></UnHold></Flow>"
}'
{
"action_custom_param": "unmute_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><UnMute direction=\"out\"></UnMute></Flow>"
}
curl --location 'https://cpaas-api.in.exotel.com/v2/accounts/{account_sid}/legs/{leg_sid}/actions' \
--header 'Authorization: Basic <BASE64_APIKEY_APITOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"action_custom_param": "unmute_leg",
"exoml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Flow><UnMute direction=\"out\"></UnMute></Flow>"
}'