# App Installation and Setup

https://www.youtube.com/watch?v=-AS4EMCv\_cU

## How to get the app

Start your [free trial of Twilio for Salesforce](https://pages.twilio.com/salesforce). The trial package includes 30 free seats for 30 days.

* **Need a volume discount?** [Contact sales for more information](https://www.twilio.com/en-us/help/sales).
* **Not sure how many users you need for your project?** See "[How many licenses do I need?](/docs/salesforce/faq#how-many-licenses-do-i-need)" in the FAQ.

## Twilio for Salesforce prerequisites

* A Twilio account —[sign up here](https://www.twilio.com/try-twilio) if you don't have one yet. If you're installing Twilio for Salesforce in multiple environments, we recommend creating separate [Twilio projects](https://help.twilio.com/hc/en-us/articles/360011132374-Getting-Started-with-Twilio-Projects-and-Subaccounts) for each organization.
* Administrative access to a Salesforce with a supported edition: Enterprise, Unlimited, Force.com, Developer, or Performance.
* [MyDomain](https://help.salesforce.com/articleView?id=domain_name_overview.htm\&type=5) configured for your Salesforce instance.

Twilio for Salesforce installation takes 10-20 minutes. Let's get started.

## Install the app and configure your setup

### 1. Install Twilio for Salesforce from the AppExchange

Install Twilio for Salesforce using the links [available on this page](https://pages.twilio.com/salesforce-ty). When prompted, select **Install for All Users** :

![Twilio for Salesforce package details with Add Users button highlighted.](https://docs-resources.prod.twilio.com/d309ec58803ff3f98ad589bc0e5d9108b8fc567135317cad0970057fadfdd92c.png)

Once the package has finished installing, search for `Twilio Configuration` from the Salesforce App Launcher. You should then see this page:

![Get Twilio Configuration from the Salesforce App Launcher.](https://docs-resources.prod.twilio.com/2ced83657847fb0876c92e2322a5d75a2452cec171f6b3dec8fb8c0c778a2376.png)

> \[!WARNING]
>
> Twilio is only able to provide support for the **latest** version of the
> application. Because this product is in Beta, support is limited to the latest
> version of the product. To view the current app version, please visit [Twilio
> for Salesforce Changelog](/docs/salesforce/changelog).

### 2. Obtain your Twilio Account SID and Auth Token

1. From the **Twilio Configuration** page in Salesforce, click on the **Create Account** or **Log In** buttons to go to the Twilio Console.
2. You'll be asked to log in — this will take you to your Account dashboard. Scroll down to the **Account Info** section.
3. Copy the **Account SID** and **Auth Token** values from the front page of the Console:

   ![Twilio account info with SID, auth token, and phone number details.](https://docs-resources.prod.twilio.com/822ec83289c7bb6288d8526a7bb7827cd6ccb9c22f9649c8387cc1a2376264b4.png)
4. Back in Salesforce, paste your Account SID and Auth Token into Salesforce, then click on **Validate Credentials** :

   ![Twilio connect panel with fields for Account SID and Auth Token.](https://docs-resources.prod.twilio.com/80497cefcad59192efcb6e28c09cc7c874fcef8105b3cc0403930f7905a152c6.png)
5. You'll see a confirmation message like this:

   ![Twilio account connection confirmed with account SID and auth token.](https://docs-resources.prod.twilio.com/f35b12921a29ee8d825e92288b1d776ca0d5ae164b1657bca434bf5e64652f80.png)

> \[!NOTE]
>
> If you need to configure Twilio with multiple Salesforce instances or
> environments, we recommend creating a separate [Twilio
> Account](https://help.twilio.com/hc/en-us/articles/360011132374-Getting-Started-with-Twilio-Projects-and-Subaccounts)
> for each instance. Each instance will have its own Account SID and Auth Token.

### 3. Create a messaging service

A messaging service is a pool of Twilio phone numbers that are enabled with software to prevent text encoding issues, provide international phone numbers, and scale messaging capacity. Twilio for Salesforce uses a messaging service to provide phone numbers for three types of SMS:

* SMS sent from Salesforce users that don't have a personal phone number assigned.
* Campaign SMS sent from the Campaigns Lightning Component.
* Notifications sent from the **Send SMS** Process Builder action.

1. To create a messaging service, [open the **Messaging Services** page in the Twilio Console](https://www.twilio.com/console/sms/services).
2. Click on **Create new Messaging Service** :

   ![Messaging Services page with Create Messaging Service button for SMS and WhatsApp.](https://docs-resources.prod.twilio.com/5fc3aeb64f15df099c72e18a9a5bd927dd821651cbf1532a804b67d250c0f6ef.png)
3. Give your messaging service a name that makes sense for your project: for example, `Connect to Salesforce`. When you're ready, click the blue **Create Messaging Service** button to establish your new messaging service:

   ![Messaging Service setup with step 1 highlighted, naming service 'Connect to Salesforce'.](https://docs-resources.prod.twilio.com/084cb795243a8ab1920fdace5ef53d52df44233ae043a50e10403a2157e224a2.png)

If you already have phone numbers ready and a TwiML Bin that will manage the webhook that will be used to relay messages to Salesforce, you can proceed through the messaging service setup wizard. For this guide, we assume that you don't, so just click the **Skip Setup** button for now. We'll work through each of these setup stages separately.

### 4. Add phone numbers to your messaging service

1. In the Console's left-hand sidebar, click on **Explore Products** , scroll to the **Super Network** section, click on **Numbers** , then on the **Buy a number** button.
2. Use the phone numbers interface to search for a number and then click on **Buy** to purchase it:

   ![Twilio for Salesforce configure app — buy a phone number.](https://docs-resources.prod.twilio.com/907fa712118412a6607841a7456f917f3b18393c85291ab03bfe97e3f254844e.png)
3. Now return to your messaging service — click on **Services** under **Messaging** in the Console's left-hand sidebar. You'll see your message service listed by name — click on it and then click on **Sender Pool** in the sidebar.
4. Click the **Add Senders** button:

   ![Sender Pool page in Twilio for Salesforce with add senders button.](https://docs-resources.prod.twilio.com/bffe62e37b6ffcbe2cedb0ede68053b0634e158cc30be2b792a15a7a8c72ed83.png)
5. In the **Add Senders** panel, make sure the **Sender Type** is **Phone Number** and click **Continue** :

   ![Add sender's phone number for two-way messaging with Twilio in Salesforce.](https://docs-resources.prod.twilio.com/b40a74817f13549e616fd296f69952004ab3f732d7a143fa81ce60dfd95ee76a.png)
6. Now select the number you just bought, and click the **Add Phone Number** button:

   ![Add senders screen in Twilio for Salesforce with phone number selection options.](https://docs-resources.prod.twilio.com/a74f6239624f2c7540826ce1da696b5b59e249b2e940cfb4f0fdd5b5ea7bb5e4.png)

### 5. Select your messaging service in Salesforce

Return to the **Twilio Configuration** page in Salesforce and refresh the page. You can now be able to select your messaging service from the **Select Message Service** popup menu. Do so then click **Validate Credentials** :

![Connect to Salesforce and validate.](https://docs-resources.prod.twilio.com/9f01496d96f38a3aa24ed54803d533cc85292a355a2055be505e8e63844dc498.png)

Once your Twilio Account SID, Auth Token, and messaging service have been validated, you'll see the full list of configuration options appear on the **Twilio Configuration** page:

![Twilio Configuration page showing account connection and license purchase options.](https://docs-resources.prod.twilio.com/76c2a5cf364bdddcfd208d0d4cd6fd1930957535e7dffe39cd3bd1addb16b774.png)

### 6. Add Lightning components to Salesforce layouts

You can add Twilio for Salesforce's Lightning components to your layout using Salesforce's Lightning App Builder. Open the Lightning App Builder by opening a record (Leads, Contacts, Person Accounts, Cases, or Campaigns), clicking on the configuration gear icon, and then selecting **Edit Page** .

You can then use the Lightning App Builder to add components, such as Twilio's Two-Way Messages, to the page:

![Lightning App Builder showing Twilio Two Way Messages component added to Contact Record Page.](https://docs-resources.prod.twilio.com/de4beeffaa926d0c632ba65352f21f74e6801854485153f4c1407645fc9a9d0a.png)

Click **Save** in the top-right corner of the Lightning App Builder and then follow the instructions to deploy your layout to users.

> \[!NOTE]
>
> When you've completed this guide, you might like to check out our guides to these Lightning components:
>
> * [The 1:1 SMS Component](/docs/salesforce/one-one-sms-messaging-contacts)
> * [The SMS Inbox Component](/docs/salesforce/sms-inbox)
> * [The SMS Campaign Component](/docs/salesforce/sending-bulk-sms-messages-campaign-members)

### 7. Add users to the Twilio permission sets

The last step before using the Twilio features in your Salesforce install is to add users.

Anyone who should have access to Twilio functionality should be divided between the two new permission sets that were added to your organization during installation: **Twilio User** and **Twilio Administrator** .

* A User can 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.

To add these permission sets in Salesforce:

1. Go to **Setup** then search for `Permission Sets` in the find field, then click on the permission set you'd like to provision:

   ![Salesforce Permission Sets page showing user assignment options.](https://docs-resources.prod.twilio.com/4a4751d1eed2eea1198e17986b8ff94890e545cb0f209e70c1e41c44e31beeaa.png)
2. On the **Permission Set** page, click on **Manage Assignments** :

   ![Salesforce setup page showing Twilio Administrator permission set with Manage Assignments highlighted.](https://docs-resources.prod.twilio.com/46132faae36dc5ebf6ac7a9e311fca5443986368b5f5131dc6473bacf0ab7870.png)
3. Click on the user you would like to assign to the permission set:

   ![Select a user.](https://docs-resources.prod.twilio.com/b7632e8016e2859a441069a1ba449a0554eafc74d5762d945fbee1ffdf32560b.png)

If you're in a sandbox environment, you don't need to do anything further — [you can jump ahead past the next step](#next-steps-with-twilio-and-salesforce). If you're in a production organization, however, you'll need to configure Salesforce licenses for the users who'll need access. We'll show you how to do that now, but if you are a sandbox user, jump to the next step.

### 8. Production only: add users to licenses

In production instances of Salesforce, you'll need to provision your users with licenses. The [trial package](https://pages.twilio.com/salesforce) includes 30 free seats for 30 days. For more pricing options, [contact sales](https://www.twilio.com/en-us/help/sales).

1. You can do this by going to **Twilio App in Salesforce > Twilio Configuration > Purchase Licenses** and then clicking on **Configure Licenses** :

   ![License configuration with active status, cost per seat $15, monthly cost $45, and configure licenses button.](https://docs-resources.prod.twilio.com/c4ddb428646833a92fe1eb0e8b97e99e4a5a2f859666ad45d39a807b6fe08b91.png)
2. Click on **Add Users** , and then select the users who you would like to have access to the package:

   ![Add Users.](https://docs-resources.prod.twilio.com/04e47eb14a7fa19889991b854366dd9d5d525f96a3f071753e1d2ffb0ed1cdc3.png)
3. You do not need to provision every user in your organization, only those who will be using Twilio functionality:

![Select users for Twilio Salesforce package, with Jacob Talbot highlighted and added.](https://docs-resources.prod.twilio.com/1bd24ae7c94ff19d649a002d1233a92b1b227c07d4ab366f9d563c4aef67edf9.png)

That's it — you're done!

## Next steps with Twilio and Salesforce

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

Here are some more Twilio for Salesforce tutorials to help you make the most of your installation:

* [Send automated SMS messages from Process Builder](/docs/salesforce/sending-sms-messages-process-builder).
* [Send bulk SMS messages to campaign members](/docs/salesforce/sending-bulk-sms-messages-campaign-members).
* [Message contacts one on one from their Salesforce record page](/docs/salesforce/one-one-sms-messaging-contacts).
