![twilio icon](/docs/img/components/icons/60/dHdpbGlv.png)

# Twilio Connector

key: twilio[Source](https://github.com/prismatic-io/components/tree/main/components/twilio)[API Docs](https://www.twilio.com/docs/usage/api)[API Changelog](https://www.twilio.com/en-us/changelog)[Connector Changelog](#changelog)

## Description[​](#description "Direct link to Description")

[Twilio](https://www.twilio.com/) 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[​](#api-documentation "Direct link to API Documentation")

This component was built using the [Twilio Programmable Messaging API](https://www.twilio.com/docs/messaging/api) (API version `2010-04-01`).

## Connections[​](#connections "Direct link to Connections")

### API Key[​](#apikeysecret "Direct link to API Key")

**key: apiKeySecret**

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

#### Prerequisites[​](#prerequisites "Direct link to Prerequisites")

* A Twilio account with access to the [Twilio Console](https://console.twilio.com/)
* Permissions to create API keys for the account

#### Setup Steps[​](#setup-steps "Direct link to Setup Steps")

1. Sign in to the [Twilio Console](https://console.twilio.com/)
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[​](#configure-the-connection "Direct link to 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.

| Input          | Notes                                                  | Example                            |
| -------------- | ------------------------------------------------------ | ---------------------------------- |
| 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[​](#basic "Direct link to 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[​](#prerequisites-1 "Direct link to Prerequisites")

* A Twilio account with access to the [Twilio Console](https://console.twilio.com/)

#### Setup Steps[​](#setup-steps-1 "Direct link to Setup Steps")

1. Sign in to the [Twilio Console](https://console.twilio.com/)
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[​](#configure-the-connection-1 "Direct link to 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](#apikeysecret) is recommended over Basic Authentication. API keys can be revoked independently, and auth tokens generated using API keys are short-lived.

| Input       | Notes                                                                  | Example                            |
| ----------- | ---------------------------------------------------------------------- | ---------------------------------- |
| Auth Token  | The Auth Token from the [Twilio Console](https://console.twilio.com/). |                                    |
| Account SID | The Twilio Account SID (starts with AC).                               | ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |

## Triggers[​](#triggers "Direct link to Triggers")

### New and Updated Records[​](#pollchangestrigger "Direct link to 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**

| Input                | Notes                                                                                                                                                                                                                    | Example      |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |
| 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](https://www.twilio.com/docs/messaging/api/message-resource) 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](#webhook) trigger with Twilio status callbacks.

#### How It Works[​](#how-it-works "Direct link to 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[​](#configuration "Direct link to 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[​](#returned-data "Direct link to Returned Data")

The trigger returns an object with two arrays under `data`:

Example Payload

```json
{
  "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](https://www.twilio.com/docs/messaging/api/message-resource) for the complete field reference.

#### Notes[​](#notes "Direct link to 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](#webhook) trigger.

Example Payload for <!-- -->New and Updated Records[⤓](https://prismatic.io/docs/example-payloads/twilio/triggers/pollChangesTrigger.json "Download example payload")

Loading…

***

### Webhook[​](#webhook "Direct link to Webhook")

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

<!-- -->

A Twilio [webhook](https://www.twilio.com/docs/usage/webhooks) 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[​](#how-it-works-1 "Direct link to 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[​](#returned-data-1 "Direct link to Returned Data")

Example Payload

```json
{
  "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](https://www.twilio.com/docs/usage/webhooks) for the full list of available event fields and statuses.

Example Payload for <!-- -->Webhook[⤓](https://prismatic.io/docs/example-payloads/twilio/triggers/webhook.json "Download example payload")

Loading…

***

## Data Sources[​](#data-sources "Direct link to Data Sources")

### Select Message[​](#selectmessage "Direct link to Select Message")

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

| Input      | Notes                         | Example |
| ---------- | ----------------------------- | ------- |
| Connection | The Twilio connection to use. |         |

Example Payload for <!-- -->Select Message[⤓](https://prismatic.io/docs/example-payloads/twilio/data-sources/selectMessage.json "Download example payload")

Loading…

***

## Actions[​](#actions "Direct link to Actions")

### Get SMS[​](#getsms "Direct link to Get SMS")

Retrieve an SMS message by SID. | **key: getSMS**

| Input       | Notes                                      | Example                            |
| ----------- | ------------------------------------------ | ---------------------------------- |
| Message SID | The unique identifier for the SMS message. | SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
| Connection  | The Twilio connection to use.              |                                    |

Example Payload for <!-- -->Get SMS[⤓](https://prismatic.io/docs/example-payloads/twilio/actions/getSMS.json "Download example payload")

Loading…

***

### List SMS Messages[​](#listmessages "Direct link to List SMS Messages")

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

| Input      | Notes                         | Example |
| ---------- | ----------------------------- | ------- |
| Connection | The Twilio connection to use. |         |

Example Payload for <!-- -->List SMS Messages[⤓](https://prismatic.io/docs/example-payloads/twilio/actions/listMessages.json "Download example payload")

Loading…

***

### Raw Request[​](#rawrequest "Direct link to Raw Request")

Send a raw HTTP request to Twilio. | **key: rawRequest**

| Input                   | Notes                                                                                                                                                                                                                                                                                                                                | Example                                                       |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
| 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[​](#sendsms "Direct link to Send SMS")

Send an SMS message via Twilio. | **key: sendSMS**

| Input      | Notes                                             | Example          |
| ---------- | ------------------------------------------------- | ---------------- |
| 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[⤓](https://prismatic.io/docs/example-payloads/twilio/actions/sendSMS.json "Download example payload")

Loading…

***

## Changelog[​](#changelog "Direct link to Changelog")

### 2026-05-28[​](#2026-05-28 "Direct link to 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[​](#2026-04-30 "Direct link to 2026-04-30")

Various modernizations and documentation updates

### 2026-03-31[​](#2026-03-31 "Direct link to 2026-03-31")

Various modernizations and documentation updates

### 2026-03-16[​](#2026-03-16 "Direct link to 2026-03-16")

Various modernizations and documentation updates

### 2026-02-26[​](#2026-02-26 "Direct link to 2026-02-26")

Added inline data source for messages to enable dynamic dropdown selection
