Skip to main content

Twilio WhatsApp Business

This provider sends WhatsApp messages generated using Twilio’s Content Template Builder. It’s designed for sending pre-approved template messages with dynamic variables.

Configuration

Database Setup

Create a new entry in the notify_providers table with the following settings:
FieldValue
channel_type7 (Twilio WhatsApp Business)
is_enabled1

Configuration Fields

TWILIO_WA_ACCOUNT_SID
string
required
Twilio account SID
TWILIO_WA_AUTH_TOKEN
string
required
Twilio auth token
Example Configuration:
{
  "TWILIO_WA_ACCOUNT_SID": "ACXXXXXXXXXXXXXXXXX",
  "TWILIO_WA_AUTH_TOKEN": "someauthtoken"
}

Request Format

Sample Request Body

{
  "providerId": 7,
  "data": {
    "contentSid": "HXXXXXXXXX",
    "from": "MGXXXXXXXX",
    "contentVariables": {
      "1": "Name",
      "2": "52"
    },
    "to": "+919004812051"
  }
}

Request Fields

contentSid
string
required
The Content SID from Twilio Content Template Builder
from
string
required
The Messaging Service SID (starts with MG)
to
string
required
Recipient’s WhatsApp phone number in E.164 format
contentVariables
object
required
Template variables as key-value pairs. Keys are numbered positions, values are strings.
All values in contentVariables must be strings, even for numbers (e.g., "52" not 52).

Dependencies

PackageVersionDescription
twilio^5.8.0Twilio client for messaging

Reference