Receive and reply to customer messages on WhatsApp automatically.
Overview
Empfio supports two WhatsApp providers: Twilio (easiest to set up) and Meta Business API (direct Meta API, lower cost at scale). Both receive inbound messages via webhook and send replies through the same AI agent pipeline.
For initial setup steps, see Connect WhatsApp.
Provider comparison
| Feature | Twilio | Meta Business API |
|---|---|---|
| Best for | Testing, small-medium volume | Production at scale |
| Setup time | ~15 minutes | ~1-2 hours |
| Business verification | Not required | Required by Meta |
| Interactive messages | Supported (buttons, lists) | Supported (buttons, lists) |
| Message templates | Not required for sandbox | Required for outbound after 24h |
How inbound messages flow
When a customer sends a WhatsApp message, the flow is:
- Provider webhook — Twilio or Meta forwards the message to Empfio's webhook endpoint
- Signature verification — the provider's signature is validated to prevent spoofing
- Message extraction — sender phone number and message text are extracted from the payload
- Lead lookup — the backend finds or creates a lead record based on the phone number
- Conversation routing — the message is added to the lead's active conversation
- Agent processing — the message is sent to the LangGraph AI agent
- Reply delivery — the agent's response is sent back to the customer via the same provider
Webhook endpoints
POST /api/v1/channels/twilio/webhook (Twilio provider)
POST /api/v1/channels/meta/webhook (Meta provider)Both endpoints:
- Verify the provider's request signature
- Extract sender phone number and message text
- Route through the shared inbound pipeline (lead → conversation → agent → reply)
Interactive messages
The AI agent can present interactive elements to customers on WhatsApp:
- Quick reply buttons (up to 3) — for confirmations like "Yes, book it!" / "No, show more times"
- List messages (up to 10 rows, grouped in sections) — for service menus and time slot pickers
These are rendered as native WhatsApp interactive messages — customers tap to select instead of typing.
WhatsApp message templates
When using the Meta Business API in production, outbound messages to customers who haven't messaged in the last 24 hours require pre-approved message templates. This is a Meta policy, not an Empfio limitation.
For most use cases (customer initiates the conversation), templates are not needed since the agent replies within the 24-hour customer service window.
Limitations
- WhatsApp message templates required for outbound messages after 24 hours of inactivity (Meta provider only)
- Twilio sandbox has a limited number of test recipients
- Rich media messages (images, documents, audio) from customers are acknowledged but not processed by the AI
- Button titles are limited to 20 characters (WhatsApp platform limit)
- List rows are limited to 24-character titles and 72-character descriptions
Troubleshooting
| Problem | Fix |
|---|---|
| No reply from the agent | Check that the webhook URL is correct and accessible from the internet |
| "Media message not supported" | The agent currently handles text messages only |
| Messages arrive but no agent reply | Verify the agent service is running and Cal.com is connected |
| Twilio sandbox expired | Rejoin the sandbox by sending the join code to the sandbox number |
| Buttons not appearing | Ensure the message includes 3 or fewer options (WhatsApp limit) |