KnockDocs

How to send SMS messages with Twilio

Here's how to configure Twilio SMS for use with Knock.

We'll walk through a few steps to take in Twilio before jumping into how to configure Twilio within Knock.

Twilio setup

Before you set up your Twilio SMS channel in Knock, you'll need to take the following steps in Twilio.

  1. Sign up for a Twilio account if you haven't already.
  2. 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, but we won't be covering those in this guide.)
  3. If you're Twilio account is in trial mode, you'll need to pre-verify any phone numbers with Twilio that you plan to send to from Knock during testing.

Once you've completed those steps, you're ready to start sending SMS notifications with Knock.

Configure Twilio in Knock

You can follow the steps in our guide on adding a new channel to create your Twilio channel within Knock. Once the channel has been created, you'll need to configure each of your Knock environments to work with Twilio.

Each environment requires a Twilio account ID, an auth token, and a "from" resource within Twilio from which to send messages. This "from" resource can be a Twilio phone number, short code, or messaging service. (If you are using a phone number, keep in mind that all numbers used in Knock must be in E.164 format.)

🔦
API console confusion alert. Keep in mind that to configure Knock, you are looking for your Twilio account ID and auth token (not your API key). You can find these in the Twilio dashboard under "Account > General settings".

Once you've configured your Knock environments with the correct Twilio credentials, you're all set to start using workflows with your new SMS channel. Remember that any recipients you want to notify via SMS will need a phone_number sent to their user record in Knock.