How to Set Up OpenClaw on WhatsApp (Business API + QR Pairing)
WhatsApp is where your customers already are. Getting OpenClaw to work with it is also 3x harder than Telegram. Here's the complete guide — Business API approval, QR pairing, webhook setup, and every gotcha we've hit.
Telegram is the easy channel. Create a bot with BotFather, paste a token, done. We wrote a 14-step guide and even that felt long.
WhatsApp is different. It's where 2 billion people actually message every day — including your customers. But connecting an AI agent to WhatsApp requires navigating Meta's Business API, phone number verification, webhook tunneling, and a pairing flow that breaks in new and exciting ways.
This guide covers both approaches: the official WhatsApp Business API (for businesses) and the QR pairing method (faster, more limited). We'll flag the gotchas Meta doesn't document.
Two ways to connect OpenClaw to WhatsApp
Option A: WhatsApp Business API (recommended for production)
This is the official way. You register as a business with Meta, get an API key, and receive messages through webhooks — just like Telegram.
Pros: Reliable, scalable, supports rich messages, Meta-approved Cons: Business verification required (1-7 days), phone number can't be used for personal WhatsApp simultaneously
Option B: QR Pairing (WhatsApp Web protocol)
This connects OpenClaw to WhatsApp the same way WhatsApp Web does — by scanning a QR code. Your personal or business WhatsApp number becomes the bot.
Pros: No Meta approval needed, works immediately, uses your existing number Cons: Less stable (Meta can break it), limited features, phone must stay connected, violates WhatsApp ToS for automation
For anything customer-facing, use Option A. Option B is fine for personal use or testing.
Option A: WhatsApp Business API Setup
Step 1: Create a Meta Business Account
- Go to business.facebook.com
- Create a new business account (or use existing)
- Complete business verification:
- Business name and address
- Business registration document (KvK extract, Articles of Incorporation, etc.)
- This takes 1-7 business days for Meta to approve
Don't skip verification. Without it, you get a test account limited to 5 messages per day.
Step 2: Set up a WhatsApp Business App
- Go to developers.facebook.com
- Create a new App → select Business type
- Add the WhatsApp product
- In WhatsApp → Getting Started, you'll see:
- A Phone number ID
- A WhatsApp Business Account ID
- A temporary access token (expires in 24h)
Step 3: Register a phone number
You need a phone number that:
- Can receive SMS or voice calls (for verification)
- Is NOT currently registered on WhatsApp (or you'll lose personal access)
- Is a real number (VoIP numbers often don't work)
Tip: Buy a cheap prepaid SIM for your bot. Don't use your personal number unless you're okay with losing WhatsApp on that number.
In the Meta dashboard:
- Go to WhatsApp → Phone Numbers
- Click Add Phone Number
- Enter the number and verify via SMS
- Choose a display name (this is what users see)
Step 4: Generate a permanent access token
The temporary token expires in 24 hours. For production, create a System User token:
- Go to Business Settings → System Users
- Create a new system user (Admin role)
- Click Generate New Token
- Select your WhatsApp app
- Grant these permissions:
whatsapp_business_managementwhatsapp_business_messaging
- Copy the token — this one doesn't expire
Step 5: Configure OpenClaw
Add the WhatsApp channel to your OpenClaw config:
{
"channels": [
{
"type": "whatsapp",
"agentSlug": "main",
"config": {
"accessToken": "EAAxxxxxxx...",
"phoneNumberId": "123456789012345",
"verifyToken": "my-secret-verify-token",
"appSecret": "abcdef123456"
}
}
]
}
The verifyToken is a string you make up — Meta uses it to verify your webhook endpoint.
The appSecret is found in your Meta App Dashboard under Settings → Basic.
Step 6: Set up the webhook
Meta needs to reach your server to deliver messages. This means:
- Your server needs a public HTTPS URL
- You need to expose the WhatsApp webhook endpoint through your reverse proxy
In your Caddy/nginx config, add the WhatsApp webhook path:
handle /api/whatsapp/webhook {
reverse_proxy 127.0.0.1:19001
}
Restart your reverse proxy, then in the Meta dashboard:
- Go to WhatsApp → Configuration
- Set Callback URL to
https://bot.yourdomain.com/api/whatsapp/webhook - Set Verify Token to the same value you put in the OpenClaw config
- Subscribe to these webhook fields:
messagesmessaging_postbacks
Click Verify and Save. Meta will send a GET request to your webhook with the verify token. If OpenClaw is running and configured correctly, it'll respond and Meta will confirm the subscription.
Step 7: Set up a message template
WhatsApp has a 24-hour messaging window. After a user messages your bot, you can reply freely for 24 hours. After that, you can only send pre-approved message templates.
Create at least one template for re-engaging users:
- Go to WhatsApp → Message Templates
- Create a template:
- Name:
welcome_back - Category: Utility
- Language: English
- Body: "Hi {{1}}! I'm here if you have any questions. Just reply to start chatting."
- Name:
- Submit for approval (usually takes minutes to hours)
Step 8: Test
Send a WhatsApp message to your bot's phone number.
You: Hello
Bot: Hi there! How can I help you today?
Common issues:
| Problem | Cause | Fix |
|---|---|---|
| No response | Webhook not receiving | Check Meta dashboard → Webhook → verify it's verified |
| "Message failed to send" | Access token wrong | Regenerate system user token |
| Bot responds to some users but not others | 24-hour window | User needs to message first |
| "Phone number not registered" | Verification failed | Re-verify with SMS |
| Webhook verification fails | verifyToken mismatch | Must match exactly in config and Meta dashboard |
| Delayed responses | Meta webhook delivery lag | Normal — can be 1-5 seconds |
Step 9: Go live
By default, your WhatsApp Business API is in development mode — only pre-registered test numbers can message your bot.
To go live:
- Complete business verification (Step 1)
- Request production access in the Meta dashboard
- Wait for approval (1-3 days)
Once approved, anyone can message your bot's number.
Option B: QR Pairing Setup
If you don't want to deal with Meta's Business API, QR pairing connects OpenClaw to WhatsApp the same way your browser connects to WhatsApp Web.
How it works
- OpenClaw starts a WhatsApp Web session
- It generates a QR code
- You scan the QR code with your phone's WhatsApp
- Your phone bridges messages to OpenClaw
Configuration
{
"channels": [
{
"type": "whatsapp-web",
"agentSlug": "main",
"config": {
"pairingMode": "qr"
}
}
]
}
Pairing process
After starting OpenClaw, check the logs for the QR code:
docker logs openclaw-main
You'll see a QR code rendered in ASCII. Scan it with WhatsApp on your phone:
- Open WhatsApp → Settings → Linked Devices
- Tap Link a Device
- Scan the QR code from the logs
If the QR code expires before you scan it, restart the container to generate a new one.
Limitations of QR pairing
- Phone must stay online — if your phone loses connection, the bot stops responding
- Session expires — WhatsApp disconnects linked devices periodically (every ~14 days). You'll need to re-scan.
- No message templates — you can't send proactive messages
- Terms of Service — Meta doesn't officially support automation via WhatsApp Web. They can ban your number.
- Single device — you can't use WhatsApp Web on your browser AND OpenClaw simultaneously
For testing and personal use, this works. For a business serving customers, use the Business API.
WhatsApp-specific considerations for OpenClaw
Message formatting
WhatsApp supports a subset of formatting:
*bold*_italic_~strikethrough~```code blocks```
But NOT Markdown headers, links, or bullet points. Your agent's responses will look different on WhatsApp than on Telegram. Consider adding a note to your SOUL.md:
## Channel-specific behavior
When responding on WhatsApp, keep messages short (under 500 characters when possible).
Use *bold* for emphasis. Don't use Markdown headers or bullet lists — they don't render.
Media handling
WhatsApp supports sending and receiving:
- Images (JPEG, PNG)
- Videos (MP4)
- Audio messages (OGG, M4A)
- Documents (PDF, DOCX)
- Location pins
OpenClaw can receive these and pass them to the AI model (if the model supports vision/audio). Sending media back requires the Business API — QR pairing mode has limited media support.
Rate limits
WhatsApp imposes rate limits based on your business tier:
| Tier | Messages/day | How to reach it |
|---|---|---|
| Unverified | 250 | Default |
| Tier 1 | 1,000 | After verification |
| Tier 2 | 10,000 | Good quality + volume |
| Tier 3 | 100,000 | Consistent quality |
| Tier 4 | Unlimited | High volume + quality |
You start at 250 messages/day. That's fine for a small business. Tier upgrades happen automatically based on message quality and volume.
Privacy considerations
WhatsApp messages are end-to-end encrypted between users and your bot's phone number. But once the message reaches your server, it's decrypted and processed by OpenClaw.
If you're handling customer data, make sure your OpenClaw deployment has:
logging.redactSensitive: truein config- Docker volumes on encrypted storage (if required by regulations)
- A data processing agreement with your hosting provider
session.dmScope: per-channel-peerto isolate conversations
The full WhatsApp setup checklist
Business API route
- Meta Business Account created and verified (1-7 days)
- WhatsApp Business App created on developers.facebook.com
- Phone number registered and verified
- System User created with permanent access token
- OpenClaw configured with WhatsApp channel
- Webhook endpoint exposed via reverse proxy with SSL
- Webhook verified in Meta dashboard
- Message template created and approved
- Bot tested with real WhatsApp messages
- Production access requested and approved
QR pairing route
- OpenClaw configured with whatsapp-web channel
- QR code scanned from logs
- Bot tested
- Reminder set to re-pair every 2 weeks
That's 10 steps for Business API (plus 1-7 days of waiting for Meta), or 3 steps for QR pairing (with ongoing maintenance).
Compare this to Telegram's setup: create bot with BotFather, paste token, set webhook. Done.
On ClawPort, WhatsApp Business API setup is guided — paste your access token, enter your phone number ID, and we handle the webhook, SSL, and verification automatically. QR pairing? We show the QR code in your dashboard — scan and go. Try it →
Ready to deploy your AI agent?
Get started with ClawPort in 60 seconds. No credit card required.
Get Started FreeRelated Articles
Add an AI Chatbot to Your Shopify Store (Without Apps)
How to connect an OpenClaw agent to your Shopify store for product recommendations, order tracking, and FAQ automation — without paying $50/month for a chatbot app.
How to Migrate From ChatGPT Assistants API to OpenClaw
Why developers are moving away from the OpenAI Assistants API, a full feature comparison, and step-by-step migration guide — including conversation history, file search, and function calling.
Build an AI Appointment Booking Agent (Google Calendar + OpenClaw)
How to build an AI agent that checks availability, books appointments, and sends confirmations using Google Calendar — ideal for service businesses, coaches, and consultants.
How to Build a Discord Bot With OpenClaw
A complete guide to building and deploying a Discord bot using OpenClaw — covering gateway setup, slash commands, conversation memory, and how it compares to Telegram.