Prerequisites
- A Twilio account with WhatsApp enabled (twilio.com/console)
- A WhatsApp Business Account approved by Meta
- A phone number enabled for WhatsApp in Twilio
Step 1: Get your Twilio credentials
- Log in to console.twilio.com
- From the dashboard, copy your Account SID and Auth Token
- Go to Messaging → Senders → WhatsApp Senders
- Copy the sender number (format:
whatsapp:+1XXXXXXXXXX)
Step 2: Configure the webhook
DMHub automatically sets the webhook for you when you connect, but verify it's correct:
- In Twilio console, go to Messaging → Services or directly to your WhatsApp sender
- The webhook URL should be set to:
``` https://www.dmhub.ai/api/webhooks/twilio/whatsapp ```
- Set the method to HTTP POST
Step 3: Connect in DMHub
- Go to /settings/channels
- Click Add Channel → WhatsApp → Twilio
- Enter:
- Account SID - Auth Token - WhatsApp sender number
- Click Connect
DMHub sends a test message to verify the connection. You'll see a confirmation in the UI.
Step 4: Configure message templates
WhatsApp requires pre-approved templates for outbound messages sent outside the 24-hour conversation window.
Go to /settings/channels → your WhatsApp channel → Templates. DMHub includes 80+ pre-built templates for common scenarios:
- Appointment reminders
- Order confirmations
- Payment receipts
- Follow-up messages
To submit a new template, click New Template and fill in the content. Meta typically approves templates within 24 hours.
Understanding the 24-hour window
WhatsApp allows free-form messages only within 24 hours of the customer's last message. After that window closes:
- You must use a pre-approved template
- Templates can include dynamic variables like
{{customer_name}}and{{order_number}}
DMHub tracks window status on each conversation and warns you when it's about to close.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Messages not arriving | Wrong webhook URL | Verify webhook in Twilio console |
| "Not a WhatsApp number" error | Missing whatsapp: prefix | Use whatsapp:+1... format |
| Template rejected | Policy violation | Review Meta's content guidelines |
See WhatsApp template not approved for more on template issues.
Was this article helpful?
Let us know if this answered your question or if you need more help.
Send feedback