Mandala
Tools

Twilio Voice

Make and manage phone calls

Usage Instructions

Integrate Twilio Voice into the workflow. Make outbound calls and retrieve call recordings.

Tools

twilio_voice_make_call

Make an outbound phone call using Twilio Voice API.

Input

ParameterTypeRequiredDescription
tostringYesPhone number to call (E.164 format, e.g., +14155551234)
fromstringYesYour Twilio phone number to call from (E.164 format)
urlstringNoURL that returns TwiML instructions for the call
twimlstringNoTwiML instructions to execute (alternative to URL). Use square brackets instead of angle brackets, e.g., [Response][Say]Hello[/Say][/Response]
statusCallbackstringNoWebhook URL for call status updates
statusCallbackMethodstringNoHTTP method for status callback (GET or POST)
accountSidstringYesTwilio Account SID
authTokenstringYesTwilio Auth Token
recordbooleanNoWhether to record the call
recordingStatusCallbackstringNoWebhook URL for recording status updates
timeoutnumberNoTime to wait for answer before giving up (seconds, default: 60)
machineDetectionstringNoAnswering machine detection: Enable or DetectMessageEnd

Output

ParameterTypeDescription
successbooleanWhether the call was successfully initiated
callSidstringUnique identifier for the call
statusstringCall status (queued, ringing, in-progress, completed, etc.)
directionstringCall direction (outbound-api)
fromstringPhone number the call is from
tostringPhone number the call is to
durationnumberCall duration in seconds
pricestringCost of the call
priceUnitstringCurrency of the price
errorstringError message if call failed

twilio_voice_list_calls

Retrieve a list of calls made to and from an account.

Input

ParameterTypeRequiredDescription
accountSidstringYesTwilio Account SID
authTokenstringYesTwilio Auth Token
tostringNoFilter by calls to this phone number
fromstringNoFilter by calls from this phone number
statusstringNoFilter by call status (queued, ringing, in-progress, completed, etc.)
startTimeAfterstringNoFilter calls that started on or after this date (YYYY-MM-DD)
startTimeBeforestringNoFilter calls that started on or before this date (YYYY-MM-DD)
pageSizenumberNoNumber of records to return (max 1000, default 50)

Output

ParameterTypeDescription
successbooleanWhether the calls were successfully retrieved
callsarrayArray of call objects
totalnumberTotal number of calls returned
pagenumberCurrent page number
pageSizenumberNumber of calls per page
errorstringError message if retrieval failed

twilio_voice_get_recording

Retrieve call recording information and transcription (if enabled via TwiML).

Input

ParameterTypeRequiredDescription
recordingSidstringYesRecording SID to retrieve
accountSidstringYesTwilio Account SID
authTokenstringYesTwilio Auth Token

Output

ParameterTypeDescription
successbooleanWhether the recording was successfully retrieved
recordingSidstringUnique identifier for the recording
callSidstringCall SID this recording belongs to
durationnumberDuration of the recording in seconds
statusstringRecording status (completed, processing, etc.)
channelsnumberNumber of channels (1 for mono, 2 for dual)
sourcestringHow the recording was created
mediaUrlstringURL to download the recording media file
pricestringCost of the recording
priceUnitstringCurrency of the price
uristringRelative URI of the recording resource
transcriptionTextstringTranscribed text from the recording (if available)
transcriptionStatusstringTranscription status (completed, in-progress, failed)
transcriptionPricestringCost of the transcription
transcriptionPriceUnitstringCurrency of the transcription price
errorstringError message if retrieval failed

Triggers

twilio_voice_webhook

Trigger workflow when phone calls are received via Twilio Voice

Output

ParameterTypeDescription
callSidstringUnique identifier for this call
accountSidstringTwilio Account SID
fromstringCaller's phone number (E.164 format)
tostringRecipient phone number (your Twilio number)
callStatusstringStatus of the call (queued, ringing, in-progress, completed, etc.)
directionstringCall direction: inbound or outbound
apiVersionstringTwilio API version
callerNamestringCaller ID name if available
forwardedFromstringPhone number that forwarded this call
digitsstringDTMF digits entered by caller (from <Gather>)
speechResultstringSpeech recognition result (if using <Gather> with speech)
recordingUrlstringURL of call recording if available
recordingSidstringRecording SID if available
calledstringPhone number that was called (same as "to")
callerstringPhone number of the caller (same as "from")
toCitystringCity of the called number
toStatestringState/province of the called number
toZipstringZip/postal code of the called number
toCountrystringCountry of the called number
fromCitystringCity of the caller
fromStatestringState/province of the caller
fromZipstringZip/postal code of the caller
fromCountrystringCountry of the caller
calledCitystringCity of the called number (same as toCity)
calledStatestringState of the called number (same as toState)
calledZipstringZip code of the called number (same as toZip)
calledCountrystringCountry of the called number (same as toCountry)
callerCitystringCity of the caller (same as fromCity)
callerStatestringState of the caller (same as fromState)
callerZipstringZip code of the caller (same as fromZip)
callerCountrystringCountry of the caller (same as fromCountry)
callTokenstringTwilio call token for authentication
rawstringComplete raw webhook payload from Twilio as JSON string

Notes

  • Category: tools
  • Type: twilio_voice
Twilio Voice