Skip to main content

Twilio integration

Send SMS, MMS, voice, and WhatsApp, look up numbers, run Verify OTP flows, and react to inbound SMS and calls on Twilio.

What it does

The Twilio integration lets your agency run a client's messaging and voice program from inside a workflow. Connect a client's Twilio account once and your workflows can send SMS, MMS, and WhatsApp messages, place outbound calls, look up phone-number details, run Verify one-time-passcode flows, post messages into Twilio Conversations, and read message and call history. Two triggers start a workflow the moment an SMS or a voice call arrives on a Twilio phone number.

Twilio connects with an Account SID and Auth Token, not an OAuth sign-in. Every trigger and action is currently in beta.

Connect a Twilio account

Twilio uses API-key credentials, so you paste two values rather than authorizing through a redirect.

  1. Open Connections

    Open your workspace in TaskJuice and go to Connections.
  2. Start the Twilio connection

    Choose Twilio and click Connect.
  3. Sign in to the Twilio Console

    In a new tab, sign in to the Twilio Console at console.twilio.com as the client, or as your agency if the client has delegated credentials to you.

  4. Copy your Account SID and Auth Token

    Under Account Info, copy the Account SID (it starts with AC) and the Auth Token.

  5. Save the connection

    Paste both values into TaskJuice and save the connection. The Auth Token is stored encrypted and is never shown again in the browser.

The connection form has exactly two fields.

FieldTypeRequiredDefaultDescription
accountSidtextYesnoneYour Twilio Account SID (starts with AC).
authTokentext (sensitive)YesnoneYour Twilio Auth Token from the Twilio Console. Stored encrypted.

The Auth Token is the master credential for the entire Twilio account. Treat it like a password: store it only in TaskJuice and rotate it from the Twilio Console if it is ever exposed.

Rotating the Auth Token re-keys inbound verification

TaskJuice verifies inbound SMS and call webhooks with your Auth Token. When you rotate the token in the Twilio Console, update the TaskJuice connection right away, or inbound signature verification will start failing.

Triggers

Both triggers are webhook-based and single-event: one inbound POST from Twilio starts one workflow activation. Both require a connection and verify the request signature before activating. Both are in beta.

TriggerSlugFires when
Incoming SMStwilio/incoming-smsAn SMS message is received on a Twilio phone number.
Incoming Calltwilio/incoming-callA voice call is received on a Twilio phone number.

Incoming SMS payload

FieldTypeAlways presentDescription
MessageSidstringYesUnique id of the inbound message.
AccountSidstringYesThe receiving account's SID.
FromstringYesSender's phone number.
TostringYesRecipient (your Twilio) number.
BodystringYesText body of the message.
NumMediastringNoCount of media items, as a string.
FromCitystringNoSender city, if Twilio has geo data.
FromStatestringNoSender state, if available.
FromCountrystringNoSender country, if available.
ToCitystringNoRecipient city, if available.
ToStatestringNoRecipient state, if available.
ToCountrystringNoRecipient country, if available.

Incoming Call payload

FieldTypeAlways presentDescription
CallSidstringYesUnique id of the inbound call.
AccountSidstringYesThe receiving account's SID.
FromstringYesCaller's phone number.
TostringYesCalled (your Twilio) number.
CallStatusstringYesCall status, for example ringing or in-progress.
DirectionstringNoCall direction (inbound).
CallerNamestringNoCaller name, if available.
FromCitystringNoCaller city, if available.
FromStatestringNoCaller state, if available.
FromCountrystringNoCaller country, if available.
ToCitystringNoCalled-number city, if available.
ToStatestringNoCalled-number state, if available.
ToCountrystringNoCalled-number country, if available.

Point your Twilio number at TaskJuice

Each trigger publishes a TaskJuice webhook URL. Set your Twilio phone number's Messaging or Voice webhook to that URL, either manually in the Twilio Console under the number's Messaging or Voice configuration, or programmatically with the Configure Phone Number Webhooks action.

Twilio signs each request by computing an HMAC-SHA1 over the request URL plus the alphabetically sorted POST parameters and sending the base64 digest in the X-Twilio-Signature header. TaskJuice verifies that signature with your Auth Token before activating the workflow. No extra shared-secret header is required.

Actions

The integration ships 14 actions, all in beta, all requiring a connection. Where a field reads "From Phone Number (dropdown)," TaskJuice loads your account's incoming Twilio numbers into a picker so you select instead of pasting an SID. Verify Service dropdowns work the same way for your Twilio Verify services. Both pickers load up to 200 entries.

Messaging

twilio/send-sms sends an SMS to a phone number.

FieldTypeRequiredDefaultDescription
fromdropdownYesnoneFrom Phone Number, picked from your account's numbers.
TostringYesnoneRecipient in E.164 format, for example +15551234567.
BodystringYesnoneMessage text, up to 1600 characters.
MediaUrlstringNononeA media URL; supplying it sends an MMS.
StatusCallbackstringNononeURL to receive delivery-status updates.

Output: sid, status, to, from, body, date_created, price, error_code (string or null).

twilio/send-mms sends a multimedia message with an image or media attachment.

FieldTypeRequiredDefaultDescription
fromdropdownYesnoneFrom Phone Number, picked from your account's numbers.
TostringYesnoneRecipient in E.164 format.
MediaUrlstringYesnoneURL of the media file to send.
BodystringNononeText to send alongside the media.

Output: sid, status, to, from, num_media, date_created.

twilio/send-whatsapp sends a WhatsApp message via Twilio. The From here is free text, not a dropdown.

FieldTypeRequiredDefaultDescription
TostringYesnoneRecipient in whatsapp:+15551234567 format.
FromstringYesnoneYour WhatsApp-enabled Twilio sender, in whatsapp:+14155238886 format.
BodystringYesnoneMessage text.
MediaUrlstringNononeA media URL to attach.

Output: sid, status, to, from, body.

twilio/get-message retrieves details of a specific SMS or MMS message.

FieldTypeRequiredDefaultDescription
messageSidstringYesnoneMessage SID (starts with SM).

Output: sid, status, to, from, body, date_created, date_sent, price, error_code (string or null), error_message (string or null).

twilio/list-messages lists SMS and MMS messages with optional filters.

FieldTypeRequiredDefaultDescription
TostringNononeFilter by recipient number.
FromstringNononeFilter by sender number.
DateSentstringNononeFilter by date in YYYY-MM-DD format.
PageSizenumberNo50Results per page, up to 1000.

Output: messages[] (each with sid, status, to, from, body, date_sent) plus next_page_uri (string or null).

twilio/send-conversation-message sends a message in a Twilio Conversation.

FieldTypeRequiredDefaultDescription
conversationSidstringYesnoneConversation SID (starts with CH).
BodystringYesnoneMessage text.
AuthorstringNononeIdentity of the message author.

Output: sid, conversation_sid, body, author, date_created.

Voice

twilio/make-call initiates an outbound phone call. Supply either inline TwiML or a TwiML URL, not both.

FieldTypeRequiredDefaultDescription
fromdropdownYesnoneFrom Phone Number, picked from your account's numbers.
TostringYesnoneCallee in E.164 format.
TwimlstringNononeInline TwiML instructions.
UrlstringNononeURL that returns TwiML.
StatusCallbackstringNononeURL to receive call-status updates.
TimeoutnumberNo60Seconds to wait for an answer.

Output: sid, status, to, from, direction, date_created.

twilio/get-call retrieves details of a specific phone call.

FieldTypeRequiredDefaultDescription
callSidstringYesnoneCall SID (starts with CA).

Output: sid, status, to, from, direction, duration, start_time, end_time, price.

twilio/list-recordings lists call recordings with optional filters.

FieldTypeRequiredDefaultDescription
CallSidstringNononeFilter by call SID.
DateCreatedstringNononeFilter by date in YYYY-MM-DD format.
PageSizenumberNo50Results per page, up to 1000.

Output: recordings[] (each with sid, call_sid, duration, date_created, status) plus next_page_uri (string or null).

Phone numbers

twilio/list-phone-numbers lists incoming phone numbers on the account.

FieldTypeRequiredDefaultDescription
PhoneNumberstringNononeFilter by phone number.
FriendlyNamestringNononeFilter by friendly name.

Output: incoming_phone_numbers[] (each with sid, phone_number, friendly_name, sms_url, voice_url, capabilities).

twilio/lookup-phone-number looks up information about a phone number using the Twilio Lookup v2 API.

FieldTypeRequiredDefaultDescription
phoneNumberstringYesnoneNumber to look up, in E.164 format.
FieldsstringNononeComma-separated data packages, for example line_type_intelligence,caller_name.

Output: phone_number, country_code, national_format, valid (boolean), calling_country_code, caller_name (object or null), line_type_intelligence (object or null).

twilio/configure-phone-number-webhooks updates webhook URLs for an incoming phone number.

FieldTypeRequiredDefaultDescription
phoneNumberSidstringYesnonePhone Number SID (starts with PN).
SmsUrlstringNononeSMS webhook URL.
SmsMethodenumNononeGET or POST.
VoiceUrlstringNononeVoice webhook URL.
VoiceMethodenumNononeGET or POST.
StatusCallbackstringNononeStatus callback URL.
StatusCallbackMethodenumNononeGET or POST.

Output: sid, phone_number, friendly_name, sms_url, voice_url, status_callback.

Verify

twilio/start-verification sends a verification code through Twilio Verify.

FieldTypeRequiredDefaultDescription
serviceSiddropdownYesnoneVerify Service, picked from your account's services.
TostringYesnonePhone number or email to verify.
ChannelenumYesnoneOne of sms, call, email, whatsapp.

Output: sid, status, to, channel, valid (boolean), date_created.

twilio/check-verification checks a verification code submitted by the user.

FieldTypeRequiredDefaultDescription
serviceSiddropdownYesnoneVerify Service, picked from your account's services.
TostringYesnonePhone number or email that was verified.
CodestringYesnoneThe code the user entered.

Output: sid, status, to, channel, valid (boolean), date_created.

Errors

When a Twilio call fails, TaskJuice maps the provider's HTTP status to a stable error code so your workflow can branch on it. Any response that does not map to a specific code surfaces as the generic UPSTREAM_REQUEST_FAILED.

HTTP statusError codeRetryableWhat to do
400VALIDATION_ERRORNoFix the request, for example a malformed E.164 number or a body over 1600 characters.
401AUTH_EXPIREDNoReconnect the Twilio account; the Account SID or Auth Token is invalid or rotated.
404NOT_FOUNDNoConfirm the SID exists, for example the Message, Call, or Phone Number SID.
429RATE_LIMITEDYesTwilio is throttling. TaskJuice retries with backoff.
500PROVIDER_ERRORYesTwilio had a server error. TaskJuice retries.

Known limitations

  • Twilio connects with API-key credentials, not OAuth. There is no Connect-and-authorize redirect; you paste your Account SID and Auth Token. Every REST call authenticates with HTTP Basic, using the Account SID as the username and the Auth Token as the password.
  • Inbound verification relies on the Twilio request signature. Incoming SMS and Incoming Call triggers verify the X-Twilio-Signature header before activating, using your Auth Token. Because the Auth Token is also the signing key, rotating it in the Twilio Console means you must update the TaskJuice connection promptly, or inbound webhooks will fail verification.
  • Every Twilio trigger and action is in beta.
  • Send SMS accepts up to 1600 characters in Body. Split longer content across multiple sends.
  • Phone numbers for SMS, MMS, and voice must be in E.164 format, for example +15551234567. WhatsApp uses the whatsapp:+... prefixed form for both To and From.
  • Send WhatsApp Message does not use the phone-number dropdown. You type the whatsapp:+... sender yourself, and it must be a WhatsApp-enabled Twilio sender.
  • List Messages and List Recordings return one page per call. Each pages at up to 1000 results (default 50) and returns a next_page_uri for the following page.
  • There is no bulk-send action. To message many recipients, drive Send SMS from a Loop node over your recipient list.
  • The geo fields on both triggers (FromCity, FromState, FromCountry, and their To equivalents) appear only when Twilio has location data for the number. Treat them as optional.
Was this helpful?