SMS
Twilio

How to send SMS messages with Twilio

Setup guide for SMS notifications with Twilio and Knock.

Knock integrates with Twilio to send SMS notifications to your recipients.

Features

  • Delivery tracking
  • Bounce Support
  • Knock link tracking
  • Per environment configuration
  • Sandbox mode

Getting started

You can create a new Twilio channel in the dashboard under the Integrations > Channels section. From there, you'll need to take some steps in Twilio before you can configure your Twilio channel within Knock.

1

Sign up for Twilio

Sign up for a Twilio account if you haven't already.

2

Get a Twilio phone number

Get your first SMS-enabled phone number in Twilio. You'll use this as the "From" phone number in your channel configuration within Knock.

(We also support Twilio short codes and messaging services.)

3

Verify phone numbers (trial accounts only)

If your Twilio account is in trial mode, you'll need to pre-verify any phone numbers that you plan to send SMS messages to during testing with Knock.

4

Configuring Twilio in Knock

Now that you have your Twilio phone number, account ID and auth token, you're ready to configure your Twilio channel in the Knock dashboard under the Integrations > Channels section.

Channel configuration

The following channel settings should be configured per environment. Navigate to Integrations > Channels in your dashboard, select your Twilio channel, then click "Manage configuration" under the environment that you'd like to configure.

Fields marked with an * are required.

Knock settings

Sandbox modeboolean
Whether to enable sandbox mode for your Twilio channel.
Knock link trackingboolean
Whether to enable Knock link-click tracking.

Provider settings for Twilio

Account IDstring*
The account ID from Twilio.
Auth tokenstring*
The auth token from Twilio.
Fromenum*
The method used to send your SMS messages. One of Phone number, Short code, or Messaging Service SID.
Phone numberstring*
The phone number to send messages from. Required when From is set to Phone number.
Short codestring*
The short code to send messages from. Required when From is set to Short code.
Messaging Service SIDstring*
The Messaging Service SID to send messages from. Required when From is set to Messaging Service SID.

Set optional per-environment conditions for this channel. These conditions are evaluated each time a workflow run encounters a step that uses this channel in the configured environment. If the conditions are not met, the step will be skipped.

Recipient data requirements

In order to send an SMS notification you'll need a valid phone_number property set on your recipient.

Delivery tracking

Delivery tracking for Twilio can result in the following status updates to your message:

  • The message delivery is confirmed and Knock updates the message to delivered
  • The message was not delivered due to bad recipient(s) and Knock updates the message to bounced
  • The message was not delivered due to an error reported by Twilio and Knock updates the message to undelivered