Skip to main content

Twilio SMS

Twilio enables sending SMS through its API, allowing developers to programmatically send and receive text messages worldwide.

Configuration

Database Setup

Create a new entry in the notify_providers table with the following settings:
FieldValue
channel_type5 (Twilio SMS)
is_enabled1

Configuration Fields

TWILIO_SMS_ACCOUNT_SID
string
required
Twilio SMS account SID
TWILIO_SMS_AUTH_TOKEN
string
required
Twilio SMS auth token
TWILIO_SMS_NUMBER
string
required
Twilio registered phone number
Example Configuration:
{
  "TWILIO_SMS_ACCOUNT_SID": "ACapiKeyMsg",
  "TWILIO_SMS_AUTH_TOKEN": "some-auth-token",
  "TWILIO_SMS_NUMBER": "+15005550006"
}

Request Format

Sample Request Body

{
  "providerId": 5,
  "data": {
    "to": "+15005550006",
    "message": "Your appointment is coming up on March 21 at 2PM"
  }
}

Request Fields

to
string
required
Recipient’s phone number in E.164 format
message
string
required
The SMS message content

Dependencies

PackageVersionDescription
twilio^5.8.0Twilio client for SMS and voice

Reference