Skip to main content

Connect Number to Call Flow

Call a phone number and connect them to an applet/IVR flow after they answer. Unlike Connect Two Numbers, this API uses a flow URL instead of a To number.

HTTP Request​

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

Regional Endpoints​

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 first.
CallerIdYesStringYour ExoPhone/virtual number.
UrlYesStringFlow URL: http://my.exotel.com/{your_sid}/exoml/start_voice/{app_id}
CallTypeNoStringtrans for transactional calls.
TimeLimitNoIntegerMax call duration in seconds. Max: 14400 (4 hours).
TimeOutNoIntegerRing timeout in seconds.
StatusCallbackNoStringWebhook URL for call status updates.
StatusCallbackEventsNoArrayterminal, answered, or both.
CustomFieldNoStringMetadata passed to the applet via Passthru.
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=+919876543210' \
-d 'CallerId=0XXXXXX4890' \
-d 'Url=http://my.exotel.com/<your_sid>/exoml/start_voice/<app_id>' \
-d 'CallType=trans' \
-d 'StatusCallback=https://yoururl.com/callback'

Response​

{
"Call": {
"Sid": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"ParentCallSid": null,
"DateCreated": "2017-03-03 12:30:24",
"DateUpdated": "2017-03-03 12:30:27",
"AccountSid": "your_sid",
"To": null,
"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,
"Uri": "/v1/Accounts/your_sid/Calls.json/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"RecordingUrl": null
}
}
note

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

Try It​