Exotel

Usage Instructions

Integrate Exotel cloud telephony into the workflow. Connect a sales rep to a lead, send an IVR call flow to a customer, send DLT-compliant SMS, look up call and SMS records, and check an Indian number for operator and DND status. Can also run workflows when Exotel reports a call or SMS status. Requires an Exotel API key, API token, and Account SID.

Actions

Exotel Connect Two Numbers

Place an outbound call that rings the From number first (for example a sales rep) and, once answered, dials the To number (for example a lead) and connects them through your ExoPhone.

Input

ParameterTypeRequiredDescription
apiKeystringYesExotel API key (the Basic auth username), from Settings > API Settings
apiTokenstringYesExotel API token (the Basic auth password), from Settings > API Settings
accountSidstringYesExotel Account SID, used in every API path
subdomainstringYesRegional API host of the account: "api.exotel.com" (Singapore) or "api.in.exotel.com" (Mumbai)
fromstringYesNumber called first, in E.164 format (e.g. +919900XXXXXX) or a SIP URI (e.g. sip:agent@exotel.com)
tostringYesCustomer number called second, in E.164 format (e.g. +918800XXXXXX)
callerIdstringYesYour ExoPhone (virtual number) shown to both parties
recordbooleanNoWhether to record the conversation
recordingChannelsstringNoRecording channels: "single" (default) or "dual"
recordingFormatstringNoRecording format: "mp3" (default) or "mp3-hq"
waitUrlstringNoURL of a WAV file played to the first party while the second is dialed
callTypestringNoSet to "trans" for transactional calls
timeLimitnumberNoMaximum call duration in seconds (max 14400)
timeOutnumberNoSeconds to ring each called party before treating the leg as unanswered
customFieldstringNoMetadata echoed back in the StatusCallback and to Passthru applets, e.g. a lead or order ID (max 128 characters)
statusCallbackstringNoURL Exotel posts the call status to, such as an Exotel Call Status trigger URL
statusCallbackEventsstringNoEvents that send the extended StatusCallback payload: "terminal", "answered", or "both". Without it the callback carries only CallSid, Status, DateUpdated, and RecordingUrl.
statusCallbackContentTypestringNoEncoding of the StatusCallback POST: "application/json" (default when a StatusCallback is set) or "multipart/form-data"

Output

ParameterTypeDescription
callSidstringUnique call identifier (Sid)
parentCallSidstringParent call Sid
accountSidstringExotel Account SID
statusstringCall status: queued, in-progress, completed, failed, busy, or no-answer
fromstringThe number called first
tostringThe destination number (null when the call goes to a call flow)
phoneNumberSidstringThe ExoPhone used
directionstringCall direction: inbound, outbound-dial, or outbound-api
dateCreatedstringWhen the call request was created
dateUpdatedstringLast status update time
startTimestringWhen the call was sent to the operator
endTimestringWhen the call ended
durationnumberTotal duration in seconds. Updates about 2 minutes after the call ends.
pricestringAmount charged (INR or USD). Updates about 2 minutes after the call ends.
answeredBystringWho answered the call, if reported
recordingUrlstringRecording URL when recording was enabled and the call has ended
uristringAPI path of the call resource

Exotel Connect to Call Flow

Call a number and, once they answer, hand the call to an Exotel call flow (IVR or applet app) built in App Bazaar.

Input

ParameterTypeRequiredDescription
apiKeystringYesExotel API key (the Basic auth username), from Settings > API Settings
apiTokenstringYesExotel API token (the Basic auth password), from Settings > API Settings
accountSidstringYesExotel Account SID, used in every API path
subdomainstringYesRegional API host of the account: "api.exotel.com" (Singapore) or "api.in.exotel.com" (Mumbai)
fromstringYesNumber to call, preferably in E.164 format. Prefix landlines with the STD code.
callerIdstringYesYour ExoPhone (virtual number)
appIdstringYesID of the call flow (app) to connect to, from App Bazaar > My Apps
callTypestringNoSet to "trans" for transactional calls
timeLimitnumberNoMaximum call duration in seconds (max 14400)
timeOutnumberNoSeconds to ring each called party before treating the leg as unanswered
customFieldstringNoMetadata echoed back in the StatusCallback and to Passthru applets, e.g. a lead or order ID (max 128 characters)
statusCallbackstringNoURL Exotel posts the call status to, such as an Exotel Call Status trigger URL
statusCallbackEventsstringNoEvents that send the extended StatusCallback payload: "terminal", "answered", or "both". Without it the callback carries only CallSid, Status, DateUpdated, and RecordingUrl.

Output

ParameterTypeDescription
callSidstringUnique call identifier (Sid)
parentCallSidstringParent call Sid
accountSidstringExotel Account SID
statusstringCall status: queued, in-progress, completed, failed, busy, or no-answer
fromstringThe number called first
tostringThe destination number (null when the call goes to a call flow)
phoneNumberSidstringThe ExoPhone used
directionstringCall direction: inbound, outbound-dial, or outbound-api
dateCreatedstringWhen the call request was created
dateUpdatedstringLast status update time
startTimestringWhen the call was sent to the operator
endTimestringWhen the call ended
durationnumberTotal duration in seconds. Updates about 2 minutes after the call ends.
pricestringAmount charged (INR or USD). Updates about 2 minutes after the call ends.
answeredBystringWho answered the call, if reported
recordingUrlstringRecording URL when recording was enabled and the call has ended
uristringAPI path of the call resource

Exotel Get Call

Get the status, duration, price, and recording URL of one call by its Sid, optionally with per-leg details.

Input

ParameterTypeRequiredDescription
apiKeystringYesExotel API key (the Basic auth username), from Settings > API Settings
apiTokenstringYesExotel API token (the Basic auth password), from Settings > API Settings
accountSidstringYesExotel Account SID, used in every API path
subdomainstringYesRegional API host of the account: "api.exotel.com" (Singapore) or "api.in.exotel.com" (Mumbai)
callSidstringYesSid of the call, as returned when the call was placed
includeDetailsbooleanNoInclude leg-level details (conversation duration and per-leg status)

Output

ParameterTypeDescription
callSidstringUnique call identifier (Sid)
parentCallSidstringParent call Sid
accountSidstringExotel Account SID
statusstringCall status: queued, in-progress, completed, failed, busy, or no-answer
fromstringThe number called first
tostringThe destination number (null when the call goes to a call flow)
phoneNumberSidstringThe ExoPhone used
directionstringCall direction: inbound, outbound-dial, or outbound-api
dateCreatedstringWhen the call request was created
dateUpdatedstringLast status update time
startTimestringWhen the call was sent to the operator
endTimestringWhen the call ended
durationnumberTotal duration in seconds. Updates about 2 minutes after the call ends.
pricestringAmount charged (INR or USD). Updates about 2 minutes after the call ends.
answeredBystringWho answered the call, if reported
recordingUrlstringRecording URL when recording was enabled and the call has ended
uristringAPI path of the call resource
detailsjsonLeg-level details, present only when Include Details is on
↳ conversationDurationnumberSeconds both parties were connected
↳ leg1StatusstringStatus of the first leg
↳ leg2StatusstringStatus of the second leg
↳ legsarrayPer-leg durations
↳ idnumberLeg number (1 or 2)
↳ onCallDurationnumberSeconds the leg was on the call

Exotel List Calls

List call records (bulk Call Details) filtered by date range, numbers, status, direction, duration, or price, with cursor pagination. Covers up to 6 months of history, at most 1 month per request.

Input

ParameterTypeRequiredDescription
apiKeystringYesExotel API key (the Basic auth username), from Settings > API Settings
apiTokenstringYesExotel API token (the Basic auth password), from Settings > API Settings
accountSidstringYesExotel Account SID, used in every API path
subdomainstringYesRegional API host of the account: "api.exotel.com" (Singapore) or "api.in.exotel.com" (Mumbai)
callSidsstringNoOne call Sid or a comma-separated list (max 100)
startDatestringNoOnly calls created at or after this time, as YYYY-MM-DD HH:mm:ss
endDatestringNoOnly calls created at or before this time, as YYYY-MM-DD HH:mm:ss
tostringNoCalled number(s) in E.164 format, up to 5 comma-separated
fromstringNoCalling number(s) in E.164 format, up to 5 comma-separated
statusstringNoCall status: completed, failed, busy, or no-answer
directionstringNoCall direction: inbound, outbound-dial, or outbound-api
phoneNumberstringNoExoPhone(s) the calls used, up to 5 comma-separated
durationFilterstringNoDuration range, e.g. "gte:10s;lte:45s" or "eq:30s"
priceFilterstringNoPrice range, e.g. "gte:0.10;lte:1.0"
pageSizenumberNoRecords per page (default 50, max 100)
sortBystringNoSort order: "DateCreated:asc" or "DateCreated:desc" (default)
afterstringNoCursor for the next page (nextCursor from a previous call)
beforestringNoCursor for the previous page (prevCursor from a previous call)
recordingUrlValiditynumberNoMinutes the pre-signed recording URLs stay valid (5 to 60)

Output

ParameterTypeDescription
callsarrayMatching calls, newest first unless sorted otherwise
↳ callSidstringCall Sid
↳ statusstringCall status
↳ fromstringCalling number
↳ tostringCalled number
↳ directionstringCall direction
↳ dateCreatedstringWhen the call was created
↳ durationnumberDuration in seconds
↳ pricestringAmount charged
↳ recordingUrlstringRecording URL, if recorded
totalnumberTotal calls matching the filters
pageSizenumberRecords per page
firstPageUristringAPI path of the first page
prevPageUristringAPI path of the previous page
nextPageUristringAPI path of the next page
nextCursorstringPass as After to fetch the next page (null on the last page)
prevCursorstringPass as Before to fetch the previous page

Exotel Send SMS

Send one SMS from an ExoPhone or approved Sender ID. SMS to Indian numbers must carry the DLT Entity ID and match a DLT-approved template, or operators block it.

Input

ParameterTypeRequiredDescription
apiKeystringYesExotel API key (the Basic auth username), from Settings > API Settings
apiTokenstringYesExotel API token (the Basic auth password), from Settings > API Settings
accountSidstringYesExotel Account SID, used in every API path
subdomainstringYesRegional API host of the account: "api.exotel.com" (Singapore) or "api.in.exotel.com" (Mumbai)
fromstringYesExoPhone or DLT-registered Sender ID (header), e.g. EXOTEL
tostringYesRecipient mobile number, preferably in E.164 format
bodystringYesMessage text, max 2000 characters. For India it must match the approved DLT template exactly, with only the {#var#} positions filled in.
dltEntityIdstringNoDLT entity registration ID. Mandatory for SMS to Indian numbers.
dltTemplateIdstringNoDLT-approved template ID the body matches. If omitted, Exotel looks up the matching template on your dashboard.
smsTypestringNotransactional (OTP or service implicit), transactional_opt_in (service explicit), or promotional. If omitted, Exotel uses the matching template.
encodingTypestringNo"plain" (default, auto-detected) or "unicode"
prioritystringNo"normal" (default) or "high". Use high only for OTP, bank, or delivery SMS.
shortenUrlbooleanNoShorten URLs in the body. A paid feature that must be enabled on the account.
customFieldstringNoYour reference, e.g. an order ID, echoed back in the delivery callback
statusCallbackstringNoURL Exotel posts delivery status to, such as an Exotel SMS Status trigger URL
bindingChainDetailsstringNoTelemarketer aggregators in India only: comma-separated <PE_ID>,<YOUR_TM_ID>

Output

ParameterTypeDescription
smsSidstringUnique SMS identifier (Sid)
accountSidstringExotel Account SID
fromstringSender, as <ExoPhone>/<SenderID>
tostringRecipient number
bodystringMessage content
statusstringHigh-level status: queued, sending, submitted, sent, failed-dnd, or failed
detailedStatusstringHuman-readable status, e.g. DELIVERED_TO_HANDSET
detailedStatusCodestringExotel numeric status code, e.g. 20005
directionstringoutbound-api, outbound-call, outbound-reply, or incoming
smsUnitsnumberSMS units consumed (null until the final state)
dateCreatedstringWhen the request was received
dateUpdatedstringLast status update time
dateSentstringWhen the SMS was delivered
pricestringAmount charged, once final
uristringAPI path of the SMS resource

Exotel Get SMS

Get the delivery status of one SMS by its Sid, including the detailed status code (e.g. DELIVERED_TO_HANDSET).

Input

ParameterTypeRequiredDescription
apiKeystringYesExotel API key (the Basic auth username), from Settings > API Settings
apiTokenstringYesExotel API token (the Basic auth password), from Settings > API Settings
accountSidstringYesExotel Account SID, used in every API path
subdomainstringYesRegional API host of the account: "api.exotel.com" (Singapore) or "api.in.exotel.com" (Mumbai)
smsSidstringYesSid of the SMS, as returned when it was sent

Output

ParameterTypeDescription
smsSidstringUnique SMS identifier (Sid)
accountSidstringExotel Account SID
fromstringSender, as <ExoPhone>/<SenderID>
tostringRecipient number
bodystringMessage content
statusstringHigh-level status: queued, sending, submitted, sent, failed-dnd, or failed
detailedStatusstringHuman-readable status, e.g. DELIVERED_TO_HANDSET
detailedStatusCodestringExotel numeric status code, e.g. 20005
directionstringoutbound-api, outbound-call, outbound-reply, or incoming
smsUnitsnumberSMS units consumed (null until the final state)
dateCreatedstringWhen the request was received
dateUpdatedstringLast status update time
dateSentstringWhen the SMS was delivered
pricestringAmount charged, once final
uristringAPI path of the SMS resource

Exotel Get Number Metadata

Look up the telecom circle, operator, number type (mobile or landline), and DND status of an Indian phone number.

Input

ParameterTypeRequiredDescription
apiKeystringYesExotel API key (the Basic auth username), from Settings > API Settings
apiTokenstringYesExotel API token (the Basic auth password), from Settings > API Settings
accountSidstringYesExotel Account SID, used in every API path
subdomainstringYesRegional API host of the account: "api.exotel.com" (Singapore) or "api.in.exotel.com" (Mumbai)
phoneNumberstringYesIndian phone number to look up, e.g. 09876543210

Output

ParameterTypeDescription
phoneNumberstringThe number, reformatted by Exotel
circlestringTwo-character telecom circle code, e.g. MH
circleNamestringTelecom circle name, e.g. Maharashtra
typestringMobile or Landline
operatorstringOperator code, e.g. A for Airtel
operatorNamestringOperator name
dndstringDND (Do Not Disturb) status: Yes, No, or Unavailable

Triggers

A Trigger is a block that starts a workflow when an event happens in this service.

Exotel Call Status

Trigger workflow when Exotel reports a call status (answered or ended) through a StatusCallback or Passthru applet

Output

ParameterTypeDescription
callSidstringUnique call identifier (CallSid)
statusstringCall status: completed, failed, busy, or no-answer (in-progress on answered events)
eventTypestringterminal or answered. Sent only when Status Callback Events was set.
fromstringCalling number (From, or CallFrom on a Passthru request)
tostringCalled number (To, or CallTo on a Passthru request)
phoneNumberSidstringThe ExoPhone used
directionstringinbound, outbound-dial, or outbound-api
dateCreatedstringWhen the call request was created
dateUpdatedstringLast status update (YYYY-MM-DD HH:mm:ss)
startTimestringWhen the call started
endTimestringWhen the call ended
durationnumberTotal call duration in seconds, when Exotel includes Duration
conversationDurationnumberSeconds both parties were connected
recordingUrlstringRecording URL, when recording was enabled
customFieldstringThe Custom Field sent with the original call, e.g. a lead or order ID
legsjsonPer-leg attempts, each { onCallDuration, status, answeredBy }. status is completed, busy, failed, no-answer, canceled, or null; answeredBy is Human, Machine, NotSure, or NA.
currentTimestringRequest time, sent only by the Passthru applet
rawjsonThe complete payload Exotel sent

Exotel SMS Status

Trigger workflow when Exotel reports a delivery status change for an outbound SMS

Output

ParameterTypeDescription
smsSidstringUnique SMS identifier (SmsSid)
accountSidstringExotel Account SID
fromstringSender ID or ExoPhone used
tostringRecipient number
statusstringDelivery status, e.g. sent, delivered, or failed
detailedStatusstringDetailed status, e.g. DELIVERED_TO_HANDSET or FAILED_DND
detailedStatusCodestringExotel numeric status code, e.g. 20005
smsUnitsnumberSMS units consumed
dateSentstringWhen the SMS was sent
dateUpdatedstringWhen the status changed
customFieldstringThe Custom Field sent with the SMS, e.g. an order ID
rawjsonThe complete payload Exotel sent