Skip to main content
twilio icon

Twilio Connector

SourceAPI DocsAPI ChangelogConnector Changelog

Description

Twilio is a cloud communications platform for sending SMS text messages and other programmable messaging. This component allows sending SMS messages, retrieving message records, and reacting to Twilio events from within an integration.

API Documentation

This component was built using the Twilio Programmable Messaging API (API version 2010-04-01).

Connections

API Key

key: apiKeySecret

This component authenticates with Twilio using an API key and secret pair generated from the Twilio console.

Prerequisites

  • A Twilio account with access to the Twilio Console
  • Permissions to create API keys for the account

Setup Steps

  1. Sign in to the Twilio Console
  2. In the top-right of the screen, click Account -> API Keys & Tokens
  3. Select Create API Key
  4. Enter a descriptive name for the key and select Standard for Key type
  5. Take note of the API key's SID and Secret (the secret is only shown once)
  6. From the Twilio console, locate the Account SID (it starts with AC)

Configure the Connection

Create a connection of type API Key and enter the following values:

  • Account SID: The Twilio Account SID, which starts with AC (for example, ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
  • API Key SID: The API Key SID created in the previous step, which starts with SK (for example, SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
  • API Key Secret: The secret generated when the API key was created
Store the Secret Securely

The API key secret is only displayed once at creation time. Save it in a secure location before leaving the page.

InputNotesExample
Account SID

The Twilio Account SID (starts with AC).

ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
API Key SID

The API Key SID (starts with SK).

SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
API Key Secret

The API secret generated when the API key was created.

Basic Authentication

key: basic

When a Twilio account is created, an Account String Identifier (Account SID) and Auth Token are generated automatically. The Account SID and Auth Token can be used to authenticate with Twilio and send SMS messages.

Prerequisites

Setup Steps

  1. Sign in to the Twilio Console
  2. From the Account Info panel on the dashboard, locate the Account SID (starts with AC) and the Auth Token
  3. Copy both values for use in the connection configuration

Configure the Connection

Create a connection of type Basic Authentication and enter the following values:

  • Account SID: The Twilio Account SID, which starts with AC
  • Auth Token: The Auth Token shown in the Twilio Console
Consider API Keys instead

For security reasons, the API Key Connection is recommended over Basic Authentication. API keys can be revoked independently, and auth tokens generated using API keys are short-lived.

InputNotesExample
Auth Token

The Auth Token from the Twilio Console.

Account SID

The Twilio Account SID (starts with AC).

ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Triggers

New and Updated Records

Checks for newly sent Twilio messages on a configured schedule. Returned messages appear in the created bucket; the updated bucket is preserved for shape parity but is always empty because Twilio polling does not detect status changes to already-sent messages. | key: pollChangesTrigger

InputNotesExample
Connection

The Twilio connection to use.

From Filter

The sender phone number to filter polled messages by, in E.164 format. Leave blank to include all senders.

+15555551234
Show New Records

When true, newly sent messages are included in the trigger output.

true
Show Updated Records

Reserved for shape consistency with other polling triggers. Twilio polling does not detect status changes to already-sent messages (use the webhook trigger for status callbacks). The 'updated' bucket is always empty.

true
To Filter

The recipient phone number to filter polled messages by, in E.164 format. Leave blank to include all recipients.

+15551234567

This trigger polls Twilio for newly sent SMS messages on a configured schedule.

The trigger fires when new messages are detected since the previous poll. The updated bucket is preserved in the payload shape for parity with other polling triggers, but is always empty because Twilio polling does not detect status changes to already-sent messages. To react to delivery status updates, use the Webhook trigger with Twilio status callbacks.

How It Works

  1. The trigger runs on the configured schedule (for example, every 5 minutes)
  2. On each run, it queries the Twilio Messages API for messages with DateSent greater than the last polled timestamp, applying optional From and To filters
  3. Matching messages are placed in the created bucket; the updated bucket is always returned as an empty array
  4. The trigger persists the last poll timestamp in its state to track which messages have already been processed
  5. When the API result reaches the internal page limit (10,000 messages), the result is marked as truncated and the cursor is advanced to the oldest fetched message's dateSent instead of the current time. This preserves at-least-once semantics, and the next poll resumes from the gap.

Configuration

Configure the following inputs:

  • Connection: The Twilio connection to use (API Key or Basic Authentication)
  • From Filter: Optional sender phone number in E.164 format (for example, +15555551234). Leave blank to include all senders.
  • To Filter: Optional recipient phone number in E.164 format (for example, +15551234567). Leave blank to include all recipients.
  • Show New Records: When enabled (default), newly sent messages are included in the trigger output
  • Show Updated Records: Reserved for shape consistency with other polling triggers. Twilio polling does not detect status changes to already-sent messages, so the updated bucket is always empty regardless of this setting.

Returned Data

The trigger returns an object with two arrays under data:

Example Payload
{
"payload": {
"body": {
"data": {
"created": [
{
"sid": "SM1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d",
"accountSid": "ACa1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"from": "+15558675309",
"to": "+15551234567",
"body": "Your appointment is confirmed for tomorrow at 2:00 PM.",
"status": "queued",
"direction": "outbound-api",
"numSegments": "1",
"numMedia": "0",
"price": "-0.00750",
"priceUnit": "USD",
"dateCreated": "2026-03-15T14:32:10.000Z",
"dateUpdated": "2026-03-15T14:32:10.000Z",
"dateSent": null,
"errorCode": null,
"errorMessage": null,
"apiVersion": "2010-04-01",
"messagingServiceSid": null,
"uri": "/2010-04-01/Accounts/ACa1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/Messages/SM1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d.json",
"subresourceUris": {
"media": "/2010-04-01/Accounts/ACa1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/Messages/SM1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d/Media.json"
}
}
],
"updated": []
}
}
},
"polledNoChanges": false
}

Field names follow the Twilio Node SDK's toJSON() output (camelCase), which differs from the snake_case used in raw API responses. Refer to the Twilio Message resource documentation for the complete field reference.

Notes

  • Polling frequency: A polling interval of 5 minutes or more is recommended to stay well within Twilio API rate limits.
  • Truncation: When the message volume exceeds the 10,000-message internal limit within a single poll window, the cursor is advanced to the oldest fetched message's dateSent and a warning is logged. Subsequent polls will pick up the remaining messages.
  • Status changes are not detected: Only newly sent messages are emitted. For delivery status callbacks (delivered, failed, undelivered), configure a Twilio status callback URL pointing to the Webhook trigger.
Example Payload for New and Updated Records
Loading…

Webhook

Receive and validate webhook requests from Twilio for manually configured webhook subscriptions. | key: webhook

A Twilio webhook can be configured to send information to a flow's webhook URL when events occur (for example, when an SMS message is sent or received).

The webhook configuration takes place when adding or updating contact phone numbers in the Twilio console.

How It Works

This trigger receives webhook requests from Twilio and automatically parses the URL-encoded request body into a JSON object on the payload's body.data field. No additional URL-decoding step is required downstream.

Returned Data

Example Payload
{
"headers": {
"accept": "*/*",
"Content-Type": "application/json; charset=UTF-8",
"User-Agent": "TwilioProxy/1.1",
"Host": "hooks.example.com"
},
"body": {
"data": {
"MessageSid": "SM1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d",
"AccountSid": "ACa1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"From": "+15558675309",
"To": "+15551234567",
"Body": "Example message body",
"MessageStatus": "delivered"
}
}
}

Refer to the Twilio webhook documentation for the full list of available event fields and statuses.

Example Payload for Webhook
Loading…

Data Sources

Select Message

A picklist of recent Twilio SMS messages. | key: selectMessage | type: picklist

InputNotesExample
Connection

The Twilio connection to use.

Example Payload for Select Message
Loading…

Actions

Get SMS

Retrieve an SMS message by SID. | key: getSMS

InputNotesExample
Message SID

The unique identifier for the SMS message.

SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
Connection

The Twilio connection to use.

Example Payload for Get SMS
Loading…

List SMS Messages

List SMS messages from the Twilio account. | key: listMessages

InputNotesExample
Connection

The Twilio connection to use.

Example Payload for List SMS Messages
Loading…

Raw Request

Send a 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

The Twilio connection to use.

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 via Twilio. | key: sendSMS

InputNotesExample
From

The SMS sender's phone number in E.164 format.

5555551234
Message

The text content of the SMS message to send.

Hello from Acme!
To

The SMS recipient's phone number in E.164 format.

5551234567
Connection

The Twilio connection to use.

Example Payload for Send SMS
Loading…

Changelog

2026-05-28

Added New and Updated Records polling trigger for detecting newly sent messages on a configured schedule. New messages are emitted in the created bucket; the updated bucket is always empty since Twilio polling cannot detect status changes to already-sent messages — use the webhook trigger for status callbacks

2026-04-30

Various modernizations and documentation updates

2026-03-31

Various modernizations and documentation updates

2026-03-16

Various modernizations and documentation updates

2026-02-26

Added inline data source for messages to enable dynamic dropdown selection