Skip to main content

Outgoing Call to a Call Flow

Make an outbound call and connect the recipient to an IVR flow or applet instead of another phone number. The From number is called first, and once they answer, they are routed to the specified call flow.

Endpoint​

POST /v1/Accounts/<your_sid>/Calls/connect

Regional URLs​

RegionURL
Singaporehttps://<api_key>:<api_token>@api.exotel.com/v1/Accounts/<your_sid>/Calls/connect
Mumbaihttps://<api_key>:<api_token>@api.in.exotel.com/v1/Accounts/<your_sid>/Calls/connect

Request Parameters​

ParameterRequiredTypeDescription
FromYesStringThe phone number to call. Preferably in E.164 format. For landlines, prefix with STD code.
CallerIdYesStringYour ExoPhone (virtual number) from the Exotel dashboard.
UrlYesStringThe call flow URL. Format: http://my.exotel.com/{your_sid}/exoml/start_voice/{app_id} where app_id is the flow/applet ID.
CallTypeNoStringSet to trans for transactional calls.
TimeLimitNoIntegerMaximum call duration in seconds. Max: 14400 (4 hours).
TimeOutNoIntegerRing timeout in seconds for both call legs.
StatusCallbackNoStringWebhook URL that receives CallSid, Status, RecordingUrl, DateUpdated when the call completes.
CustomFieldNoStringCustom data passed to Passthru or Greeting applets.
info

The Url parameter should point to a call flow (applet) configured in your Exotel dashboard. The app_id is the flow ID found in App Bazaar > My Apps.

Code Examples​

curl -X POST 'https://<your_api_key>:<your_api_token>@api.exotel.com/v1/Accounts/<your_sid>/Calls/connect' \
-d 'From=09876543210' \
-d 'CallerId=0XXXXXX4890' \
-d 'Url=http://my.exotel.com/<your_sid>/exoml/start_voice/926'

Response​

{
"Call": {
"Sid": "80bfbec2d78bbbf10fb851f4fa165211",
"ParentCallSid": null,
"DateCreated": "2017-03-03 12:30:24",
"DateUpdated": "2017-03-03 12:30:27",
"AccountSid": "your_sid",
"To": "0XXXXX40682",
"From": "09876543210",
"PhoneNumberSid": "0XXXXXX4890",
"Status": "in-progress",
"StartTime": "2017-03-03 12:30:27",
"EndTime": null,
"Duration": null,
"Price": null,
"Direction": "outbound-api",
"AnsweredBy": null,
"ForwardedFrom": null,
"CallerName": null,
"Uri": "/v1/Accounts/your_sid/Calls.json/80bfbec2d78bbbf10fb851f4fa165211",
"RecordingUrl": null
}
}
note

When using a flow URL, the To field in the response will be the ExoPhone since the destination is a flow rather than a phone number. The call proceeds to the applet after the From party answers.

note

A 200 OK response means the request was accepted — it does not confirm the call was successfully delivered. Use StatusCallback or the Call Details API to verify the final call status.

Try It​