Skip to main content

Twilio Component

Send SMS messages through Twilio

Component key: twilio

Description

Twilio is a platform that allows you to send SMS text messages. You can use the Twilio component to send messages to your end users or to your team.

Connections

Twilio API Key Connection

This component authenticates with Twilio using API key/secret pairs that can be generated from Twilio's app console. To create a Twilio API key and secret pair:

  • Go to the Twilio console
  • On the top-right of the screen click Account -> API Keys & Tokens
  • Select Create API Key
  • Give your key a name and select Standard for Key type
  • Take note of the API key's SID and Secret - you will enter those in a moment

Now, when you create an integration that uses Twilio, a "Twilio API Key Connection" will automatically be generated. Enter your API Key SID (starts with "SK..."), and its Secret. Go back to your Twilio console to find your Account SID (starts with "AC..."), and enter that as well.

InputNotesExample
Account SID

Your account SID (starts with AC)

ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
API Key SID

An API Key SID (starts with SK)

SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
API Key Secret

The API secret that was generated when an API key was created

Twilio Auth Token Connection

When you create a Twilio account, an Account String Identifier (Account SID) and Auth Token are generated. You can use the account SID and auth token to authenticate with Twilio and to send SMS messages.

Consider API Keys instead

For security reasons, we recommend using an API Key Connection instead. API keys can be revoked and auth tokens generated using API keys are short-lived.

InputNotesExample
Auth Token

Can be found on https://console.twilio.com/

Account SID

Your account SID (starts with AC)

ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Triggers

Webhook

Receive and validate webhook requests from Twilio for webhooks you configure. | key: webhook

You can configure a Twilio webhook to send information to a flow's webhook URL upon sending a text message.

The webhook configuration takes place when adding/updating contact phone numbers.

{
"payload": {
"headers": {
"accept": "*/*",
"Content-Type": "application/json; charset=UTF-8",
"User-Agent": "TwilioProxy/1.1",
"Host": "hooks.example.com"
},
"body": {},
"rawBody": {
"data": {
"type": "Buffer",
"data": [
69,
120,
97,
109,
112,
108,
101
]
}
},
"queryParameters": null,
"webhookUrls": {
"Flow 1": "https://hooks.example.com/trigger/EXAMPLEG"
},
"webhookApiKeys": {
"Flow 1": [
"abc-123"
]
},
"customer": {
"id": "customer-example-id",
"externalId": "customer-example-external-id",
"name": "John Doe"
},
"pathFragment": "",
"invokeUrl": "",
"executionId": "",
"startedAt": "",
"globalDebug": false
}
}

Actions

Get SMS

Get an SMS message | key: getSMS

InputNotesExample
Message SID
Connection

{
"data": {
"body": "Testing",
"numSegments": "1",
"direction": "outbound-api",
"from": "+12345678901",
"to": "+10987654321",
"dateUpdated": "2025-05-14T22:42:25.000Z",
"price": null,
"errorMessage": null,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.json",
"accountSid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"numMedia": "0",
"status": "queued",
"messagingServiceSid": null,
"sid": "SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"dateSent": null,
"dateCreated": "2025-05-14T22:42:25.000Z",
"errorCode": null,
"priceUnit": "USD",
"apiVersion": "2010-04-01",
"subresourceUris": {
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/Media.json"
}
}
}

List SMS messages

Lists SMS messages | key: listMessages

InputNotesExample
Connection

Raw Request

Send raw HTTP request to Twilio | key: rawRequest

InputNotesExample
Data

The HTTP body payload to send to the URL.

{"exampleKey": "Example Data"}
File Data

File Data to be sent as a multipart form upload.

[{key: "example.txt", value: "My File Contents"}]
File Data File Names

File names to apply to the file data inputs. Keys must match the file data keys above.

Form Data

The Form Data to be sent as a multipart form upload.

[{"key": "Example Key", "value": new Buffer("Hello World")}]
Header

A list of headers to send with the request.

User-Agent: curl/7.64.1
Max Retry Count

The maximum number of retries to attempt. Specify 0 for no retries.

0
Method

The HTTP method to use.

Query Parameter

A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2.

Response Type

The type of data you expect in the response. You can request json, text, or binary data.

json
Retry On All Errors

If true, retries on all erroneous responses regardless of type. This is helpful when retrying after HTTP 429 or other 3xx or 4xx errors. Otherwise, only retries on HTTP 5xx and network errors.

false
Retry Delay (ms)

The delay in milliseconds between retries. This is used when 'Use Exponential Backoff' is disabled.

0
Timeout

The maximum time that a client will await a response to its request

2000
Connection
URL

Input the path only (/Accounts/$TWILIO_ACCOUNT_SID/Messages.json), The base URL is already included (https://api.twilio.com/2010-04-01). For example, to connect to https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Messages.json, only /Accounts/$TWILIO_ACCOUNT_SID/Messages.json is entered in this field.

/Accounts/$TWILIO_ACCOUNT_SID/Messages.json
Use Exponential Backoff

Specifies whether to use a pre-defined exponential backoff strategy for retries. When enabled, 'Retry Delay (ms)' is ignored.

false

Send SMS

Send an SMS message | key: sendSMS

InputNotesExample
From

The SMS sender's phone number.

5555551234
Message

The message body of the SMS message.

Hello from Acme!
To

The SMS recipient's phone number.

5551234567
Connection

{
"data": {
"body": "Testing",
"numSegments": "1",
"direction": "outbound-api",
"from": "+12345678901",
"to": "+10987654321",
"dateUpdated": "2025-05-14T22:42:25.000Z",
"price": null,
"errorMessage": null,
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb.json",
"accountSid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"numMedia": "0",
"status": "queued",
"messagingServiceSid": null,
"sid": "SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"dateSent": null,
"dateCreated": "2025-05-14T22:42:25.000Z",
"errorCode": null,
"priceUnit": "USD",
"apiVersion": "2010-04-01",
"subresourceUris": {
"media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/Media.json"
}
}
}