# Twilio (SMS)

Connect your organization's [**Twilio**](https://www.twilio.com) account and 42min sends
your [workflow SMS](/help/workflows/sms) from your Twilio phone number or Messaging
Service. Twilio bills the texts to your Twilio account; 42min adds no charge. You set it
up on the [**Integrations**](/360/integrations) page, under **Messaging**.

## What it does

- **Connect** with your Twilio **Account SID** and **Auth Token**. 42min checks them
  with Twilio before saving (a suspended or closed Twilio account is refused) and stores
  them encrypted.
- **Pick the sender**: one of your SMS-capable **phone numbers**, or a **Messaging
  Service** whose sender pool can send SMS.
- **Send SMS steps** from your [workflows](/help/workflows/overview): **SMS to
  invitee** and **SMS to host**.
- **Send a test SMS** to check everything works.
- **Track delivery**: 42min checks each text's status with Twilio, and shows it in
  [Sent messages](/help/team-and-admin/sent-messages).
- **Honor STOP replies**: when an invitee replies STOP to your number, 42min stops
  texting them about that booking.

## Before you start

- **You need a sender in Twilio**: a phone number with SMS capability, or a Messaging
  Service that has one (or a short code or alphanumeric sender) in its pool. See
  Twilio's guide on
  [getting a phone number](https://help.twilio.com/articles/223135247-How-to-Search-for-and-Buy-a-Twilio-Phone-Number-from-Console).
- **Texting US numbers needs registration.** US carriers accept texts only from an
  A2P 10DLC registered number or Messaging Service, or a verified toll-free number.
- **Trial accounts are limited.** A Twilio trial account texts only numbers verified in
  that account, and Twilio adds a trial notice to each text.

## How to connect

Connecting is **admin-only**.

<Screenshot
  src="/help/screenshots/integrations/messaging-tiles.png"
  alt="The Messaging section of the 42min Integrations page: a SendPulse tile marked 'Recommended', a Twilio tile, and a dimmed Infobip tile marked 'Coming soon', each with a Connect button"
  caption="Integrations → Messaging: Twilio is the middle tile; click its Connect button to start."
/>

1. Open the [Twilio Console](https://console.twilio.com/) and copy the **Account SID**
   and **Auth Token** from its home page.
2. In 42min, open [**Integrations**](/360/integrations), find **Twilio** under
   **Messaging**, and click **Connect**.
3. Paste the Account SID and Auth Token and confirm. If Twilio rejects them, check you
   copied both values in full (the Account SID starts with `AC`).
4. Choose the **Sender**. The list has two groups, **Phone numbers** and **Messaging
   Services**. If both are empty, your account has nothing that can send SMS yet.
5. Leave **Use Twilio to send SMS** ticked (it's ticked for you when no other provider
   sends your SMS) and save.

<Screenshot
  src="/help/screenshots/integrations/connect-twilio.png"
  alt="The Connect Twilio window: a hint with an 'Open the Twilio Console' link, Account SID and Auth Token fields, and Cancel and Connect buttons"
  caption="The Connect Twilio window: paste the Account SID and Auth Token from your Twilio Console home page."
/>

<Screenshot
  src="/help/screenshots/integrations/twilio-sender.png"
  alt="The 'Twilio is connected' step of the connect window: a Sender dropdown showing a phone number, a ticked 'Use Twilio to send SMS' checkbox, and Close and Save buttons"
  caption="After Connect: pick the Sender (the dropdown groups Phone numbers and Messaging Services), keep Use Twilio to send SMS ticked, and Save."
/>

The Twilio tile then shows **Connected**, the sender, a **Use to send SMS** checkbox,
and a link to **Settings**.

## Settings

The Twilio [**settings**](/360/integrations/twilio) page has three parts:

<Screenshot
  src="/help/screenshots/integrations/twilio-settings.png"
  alt="The Twilio Integration settings page: a Connection card with status, connected by, Account SID ending, balance, Update keys and Disconnect; an SMS sending card with the Sender dropdown and 'Use to send SMS'; and a 'Send a test SMS' card with a Mobile phone field"
  caption="The Twilio settings page: Connection (with your balance, Update keys and Disconnect), SMS sending, and Send a test SMS."
/>

- **Connection**: who connected it, the last four characters of the Account SID, the
  status, the last error (if any), and your live Twilio **balance**. **Update keys**
  swaps in a new Auth Token or account (checked before the old keys are replaced), and
  **Disconnect** removes the connection.
- **SMS sending**: the **Sender** and **Use to send SMS**.
- **Send a test SMS**: enter a mobile number (prefilled with yours from your
  [profile](/help/account/profile-settings)) and send. Twilio charges it like any other
  SMS. You can send 5 test SMS every 10 minutes.

## One provider at a time

Your organization sends all its SMS through one provider. If you also connect
[SendPulse](/help/integrations/sendpulse), ticking **Use to send SMS** on one tile
unticks it on the other. Both connections stay saved, so you can switch back at any
time.

## STOP replies

Twilio blocks texts to anyone who has replied STOP to your sender. When that happens,
42min turns off SMS for that invitee's booking (and the later meetings of a recurring
series), the same as if they had clicked **Stop texts** on their cancel or reschedule
page. Their remaining SMS steps for that booking are skipped with `no SMS consent`.

## Common pitfalls

- **A Messaging Service is missing from the list.** Only services whose sender pool can
  send SMS are offered. Add an SMS-capable number to the service in Twilio.
- **Texts to US numbers fail.** The number or Messaging Service isn't registered for
  A2P 10DLC (or the toll-free number isn't verified). The Twilio error shows on the
  **Failed** status in Sent messages.
- **Texts fail with Twilio error 21610.** The recipient replied STOP to your sender.
  42min stops texting them about that booking. Nothing needs fixing on your side.
- **Connection broken.** Twilio stopped accepting the saved keys (for example, the Auth
  Token was rotated). Open **Settings** and **Update keys**. SMS steps are skipped
  until then.
- **Disconnecting.** 42min deletes the saved keys; nothing changes in your Twilio
  account. If Twilio was sending your SMS, workflow SMS steps are skipped until you
  connect a provider again.
