Overview
WhatsApp Business API allows your agent to communicate with customers via WhatsApp - the world’s most popular messaging app with 2+ billion users.Business Messaging
Professional customer communication
Rich Media
Images, videos, documents, location
High Engagement
98% open rates
Global Reach
Available in 180+ countries
Prerequisites
Before connecting WhatsApp, you need:Meta updates its developer dashboard and Business Suite UI frequently. The steps below describe what you need; for exact, up-to-date clicks, follow Meta’s official WhatsApp Cloud API — Get Started guide.
Meta Business Account
WhatsApp Business Account (WABA)
In Meta’s developer dashboard, create an app and select the WhatsApp use case. A WhatsApp Business Account is created for you, and you can open it under WhatsApp → API Setup.See Meta’s official guide: Create an app with the WhatsApp use case.
Phone Number
Add and verify a business phone number, or use the free test number Meta provides for development. See Meta’s Get Started guide for adding and verifying numbers.
Get Credentials
Collect the required information:
- Phone Number ID
- WhatsApp Business Account (WABA) ID
- Access Token
Connection Method 1: CLI
Step-by-Step CLI Setup
Configure Webhook in Meta
Add Webhook
Click Edit, paste the webhook URL as the Callback URL, enter your Verify token, and save.
Subscribe to Events
Under Webhook fields, click Manage and subscribe to
messages and message_status.Meta’s webhook setup UI changes periodically. For the current steps and field names, follow Meta’s official guide: Set up Webhooks for WhatsApp Cloud API.
Connection Method 2: Admin Dashboard
Step-by-Step Dashboard Setup
The dashboard uses Meta’s Embedded Signup, so you don’t enter credentials or configure webhooks by hand. Signing in with Facebook lets Meta provision (or connect) your WhatsApp Business Account, phone number, and webhook automatically. Use the CLI method instead if you already have credentials and prefer to enter them manually.
Open the dashboard
Add a channel
Click the + (plus) icon to add a channel, then choose WhatsApp.
Screenshot: The agent’s add-channel (+) control and the WhatsApp option

Accept terms & connect
Tick the box to accept the Terms of Service and Privacy Policy, then click Connect.
Log in with Facebook
A Meta Embedded Signup popup opens. Log in with your Facebook details and continue the Facebook workflow — select or create your Business account, WhatsApp Business Account, and phone number. Meta handles verification and webhook setup for you.
This popup is Meta’s own UI and changes periodically. See Meta’s Embedded Signup overview if you get stuck.
Testing Your WhatsApp Channel
Message Status Events
When you send messages via WhatsApp (including template messages), Meta sends status updates back to Lua as messages progress through delivery. Lua captures these events and can forward them to your webhooks.Status Lifecycle
A typical message goes through these statuses:| Status | Meaning |
|---|---|
sent | Message accepted by WhatsApp servers |
delivered | Message delivered to recipient’s device |
read | Recipient opened and read the message |
failed | Message could not be delivered (includes error details) |
played | Recipient played a voice or video message |
Tracking Delivery with Webhooks
To receive these events in your code, subscribe a webhook to the event types you need:Status events are particularly useful when sending template messages via the Templates API. After sending a campaign, subscribe to
message.delivered and message.read to measure engagement, or message.failed to catch delivery issues.Prerequisites
For status events to flow through, make sure you’ve subscribed tomessages and message_status in your Meta webhook configuration (see Configure Webhook in Meta above).
Status & Quality
Connection Status
- 🟢 CONNECTED - Working normally
- 🔴 DISCONNECTED - Needs reconnection
- 🟡 PENDING - Setup in progress
Quality Rating
Meta assigns quality ratings based on user feedback:- 🟢 GREEN - High quality (good!)
- 🟡 YELLOW - Medium quality (watch carefully)
- 🔴 RED - Low quality (take action)
Best Practices
Response Time
Response Time
- Respond within 24 hours
- Quick responses improve quality rating
- Agent handles this automatically
Message Templates
Message Templates
- Use templates for notifications
- Required for messages after 24 hours
- Set up in Meta Business Suite
Opt-In Required
Opt-In Required
- Users must message you first
- Cannot send unsolicited messages
- Respect user privacy
Monitor Quality
Monitor Quality
Troubleshooting
Channel shows DISCONNECTED
Channel shows DISCONNECTED
Causes:
- Token expired
- WABA disabled
- Phone number removed
- Regenerate access token
- Update in admin dashboard
- Verify WABA is active
Messages not delivering
Messages not delivering
Check:
- Quality rating (RED = issues)
- Webhook configured correctly
- Phone number status in Meta
- Message templates approved
Quality rating dropped
Quality rating dropped
Actions:
- Review recent conversations
- Check user feedback in Meta
- Improve agent responses
- Address user complaints
- May need to adjust persona
Next Steps
Facebook Messenger
Connect another channel
Test Your Agent
Test agent behavior
Monitor Channels
View channel analytics
CLI Command Reference
Complete CLI guide



