Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Installation and Configuration

To limit outbound API requests, by default Twilio for Salesforce will only check for messages every 15 minutes unless the lead or contact is open. In order to receive messages immediately, please follow the steps outlined in "Pushing Inbound Messages and Status Updates to Salesforce" after completing this initial setup.

Once message pushing is configured, messages will arrive in Salesforce within just a few seconds.

Thanks for using Twilio for Salesforce! Installation generally takes just 10-20 minutes. To use Twilio for Salesforce, you will need the following:

  • A Twilio account - sign up here if you don’t have one yet!
    • Are you a nonprofit or social enterprise? After signing up for Twilio, apply to for $500 in Twilio credits (~80,000 text messages) and discounted pricing on Twilio products and services.

Got all those things? Then let's get started!

We recommend reading this entire guide, but for a click-by-click view of the install process, check out this brief video outlining the major configuration steps needed to use the package. Then, seriously, READ THE GUIDE - there are important pointers about using the package for production use cases.

Configuring your Twilio Account

To use Twilio for Salesforce, you will need to find or create the following resources within your Twilio account.

Obtaining your Account SID

This one is easy! Navigate to your Console dashboard and copy the "Account SID" value from the front page. Leave this page open, or copy the value to a text file - you'll need it when you configure the Salesforce package.

Account SID

Creating an API Key / Secret Pair

Next, you'll need to create an API Key and Secret to allow your Salesforce instance to communicate with Twilio. There are a few places you can create and manage these keys within the Twilio console, but let's grab them from the Tools section of the Programmable SMS console, which we'll need to use again in a minute anyway. Once there, create a new API key pair by pressing the plus button.

Create API keys

Give your API key a name - anything you like. This next bit is important though! Make sure you create a "Master" API key!

API keys, naming and type

Click the "Create API Key" button, and you should be shown two long strings which are the API credentials you must provide in your Salesforce configuration so that you can communicate with Twilio. As noted in the UI, you should save these credentials in a secure location/text file, because they will only be shown once!

Keys confirmation

Create a Messaging Service

A Messaging Service is a resource within Twilio that allows API users (like your Salesforce organization) to send and receive SMS messages using one (or many!) virtual Twilio phone numbers. Using Twilio's extra-special Messaging Copilot technology, you can configure your Messaging Service to operate at any scale, or in a variety of countries around the world. To get started, we'll create a messaging service that's powered by one Twilio number.

First, navigate to the Messaging Services section of the Twilio Console. Create a new Messaging Service by clicking the plus (+) button.

messaging services

Give your Messaging Service a name - it can be anything you want. Choose the "Notifications, Two-Way" use case - you can choose another one if you know exactly what you're doing, but don't sweat it if you don't. This setting should be sufficiently versatile for your Salesforce work.

copilot messaging service

After creating your Messaging Service, navigate to the "Numbers" section of its configuration UI.

messaging service numbers

Here, you'll configure a "pool" of virtual Twilio phone numbers from which your users/customers will receive SMS messages. When SMS messages get sent out from Salesforce, those messages will come from one of the numbers in this pool. How many and what kind of numbers you need in this pool will depend greatly on your use case, and how many messages you will need to send per day.

Message Volume Number Pool Needs
Less than 250 messages per day At least one Twilio phone number
250 - 1000 messages per day. At least four Twilio phone numbers
More than 1,000 messages per day Consider a short code (US and Canada), with multiple long codes to use as a fallback based on volume. Contact a Twilio expert to help plan for your needs.
More than 1,000 international messages per day At least one Twilio number, ideally local in the country where you plan to send messages. Check international coverage for SMS here. Contact a Twilio expert to help plan your strategy for international messaging.

For more information on capacity planning, check out our FAQ on the topic.

That's all you'll need on the Twilio side! Let's take a look at how to install and configure the Twilio for Salesforce package.

Installing Twilio for Salesforce

During the preview, you'll need to install the Twilio for Salesforce package outside of the App Exchange flow.

Sign up for the preview to get access to the install link!

Once you get the link, you'll be prompted to install the package in your organization:

Install Package

Follow the prompts to install the package. If you haven't enabled it already, you may need to enable My Domain for your organization to install the package.

Configuring your Twilio Credentials

Next, you'll need to configure your Twilio account credentials using the account SID and API keys you created in the last step. In Lightning Experience, you'll find a new page in the Launcher UI to configure Twilio.

Twilio config in launcher

Go to this page and enter your Twilio account credentials, which you collected or created earlier. After validating your Twilio credentials, select the Messaging Service you created earlier from the dropdown that appears.

Twilio Salesforce Config

Hit save, and you're all set with your Twilio configuration.

Adding users to the Twilio permission sets

The last step before using the Twilio features in your Salesforce install is to add any users who should have access to Twilio functionality to one of the two new permission sets that were added to your org during installation - "Twilio User" and "Twilio Administrator". A "User" will be able to send and view messages, and generally access all the features of the package. An "Administrator" will be able to view and configure Twilio API credentials.

If you need help finding this feature in the Salesforce Setup UI, check out the video at the top of the page.

That's it! You can now start using Twilio for Salesforce to set up appointment reminders, engage with donors, and generally automate all the things.

Next Steps

Now that your Twilio for Salesforce install is all set, it's time to start sending some messages!

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.