Overview
Connect your AI agent to WhatsApp Business via Twilio’s WhatsApp API, enabling customers to reach you through the world’s most popular messaging platform.Requirements
Before setting up WhatsApp, you’ll need:- Twilio Account: Active account with WhatsApp Business API enabled
- WhatsApp-Enabled Number: Twilio phone number with WhatsApp capabilities
- Twilio Credentials:
- Account SID
- Auth Token
- WhatsApp Business Profile: Approved business profile on Twilio
Setup Instructions
Step 1: Enable WhatsApp on Twilio
- Log in to your Twilio Console
- Navigate to Messaging → Try it out → Send a WhatsApp message
- Follow Twilio’s WhatsApp setup wizard
- Get your WhatsApp-enabled phone number
Step 2: Create the Channel
- Navigate to Agents → Your Agent → Channels
- Click “Create Channel”
- Select “WhatsApp (Twilio)” as the channel type
Step 3: Configure WhatsApp Settings
Enter the following information:- Phone Number: Your Twilio WhatsApp number in E.164 format (e.g.,
+14155552671) - Display Name: Business name shown to customers (optional)
- Twilio Account SID: Found in your Twilio console
- Twilio Auth Token: Found in your Twilio console
Step 4: Save Configuration
Click “Save” to create the WhatsApp channel.Phone Number Format
WhatsApp phone numbers must be in E.164 format:- Format:
+[country code][number] - Include the
whatsapp:prefix when using Twilio API - Example:
whatsapp:+14155552671
Configuration Options
| Option | Description | Required |
|---|---|---|
| Phone Number | Twilio WhatsApp number (E.164 format) | Yes |
| Display Name | Business name shown to customers | No |
| Twilio Account SID | Your Twilio Account SID | Yes |
| Twilio Auth Token | Your Twilio Auth Token | Yes |
WhatsApp Business Features
Message Templates
WhatsApp requires pre-approved message templates for outbound messages:- Create templates in Twilio Console
- Submit for WhatsApp approval
- Use approved templates for notifications
Rich Media Support
- Images: Send and receive image files
- Documents: PDF, DOC, and other file formats
- Location: Share location information
- Quick Replies: Interactive button messages
Business Profile
Ensure your WhatsApp Business Profile includes:- Business name
- Business description
- Profile photo
- Business category
- Contact information
Twilio WhatsApp Guide
Complete WhatsApp setup and template configuration
Managing the Channel
Activate/Deactivate
Toggle the “Active” switch to enable or disable WhatsApp without deleting the channel.Edit Settings
- Navigate to Agents → Your Agent → Channels
- Click the WhatsApp channel
- Update configuration
- Click “Save Changes”
Delete Channel
- Navigate to Agents → Your Agent → Channels
- Click the WhatsApp channel
- Click “Delete Channel”
- Confirm deletion
Best Practices
- Template Approval: Prepare and approve message templates early
- 24-Hour Window: Respond within 24 hours to avoid template requirements
- Rich Media: Use images and documents to enhance support
- Business Profile: Keep your profile complete and professional
- Opt-In Compliance: Ensure customers opt-in to WhatsApp communication
- Response Quality: Maintain high-quality, helpful responses
WhatsApp Policies
Follow WhatsApp Business policies:- Opt-In Required: Customers must opt-in to receive messages
- No Spam: Only send relevant, requested content
- 24-Hour Window: Free-form messages only within 24 hours of customer message
- Template Messages: Use approved templates outside 24-hour window
- Quality Rating: Maintain good quality rating to avoid restrictions
Troubleshooting
Not Receiving Messages
- Verify WhatsApp is enabled on your Twilio number
- Check phone number is in correct E.164 format
- Ensure Twilio webhook is configured correctly
- Verify Twilio credentials are valid
- Check Twilio account has sufficient balance
Cannot Send Messages
- Ensure you’re within the 24-hour messaging window
- Use approved message templates for outbound messages
- Verify business profile is complete and approved
- Check quality rating hasn’t restricted your account
- Review WhatsApp Business policies compliance
Template Issues
- Verify templates are submitted and approved
- Check template syntax and placeholders
- Ensure template category matches use case
- Wait for approval (can take 24-48 hours)
Quality Rating Problems
- Review message quality and relevance
- Avoid spammy or promotional content
- Ensure customers opted in
- Respond promptly to customer messages
- Monitor block and report rates
Cost Considerations
- Inbound Messages: Free (covered by WhatsApp)
- Outbound Messages:
- Within 24-hour window: Free
- Template messages: Per-message fee
- Phone Number: Monthly Twilio rental fee
- Template Approvals: No additional cost