OpenClaw WhatsApp Integration: Connect Your Personal WhatsApp
OpenClaw WhatsApp Integration: Connect Your Personal WhatsApp
By Sarah Chen | February 7, 2026
OpenClaw WhatsApp Integration: Connect Your Personal WhatsApp
WhatsApp provides a familiar channel for many users. This guide covers setting up OpenClaw with WhatsApp Business API for secure, reliable messaging.
---
Prerequisites
Before you begin, you need:
1. Meta Developer Account — developers.facebook.com 2. WhatsApp Business Account — Free to set up 3. Phone Number — Not already connected to WhatsApp 4. Meta App — With WhatsApp product enabled
---
Step 1: Create Meta App
1. Go to Meta Developer Portal 2. Click "Create App" 3. Choose "Other" → "Business" 4. Name your app 5. Add WhatsApp product from products menu
---
Step 2: Get WhatsApp Credentials
In your Meta App, go to WhatsApp → API Setup:
You'll Need:
| Credential | Location | Purpose |
|---|---|---|
| Phone Number ID | WhatsApp → Phone Numbers | Identifies your number |
| WhatsApp Business Account ID | WhatsApp → Accounts | Business identifier |
| Temporary Access Token | API Setup page | Temporary API access |
| Test Numbers | Provided by Meta | Testing (includes 2 free numbers) |
---
Step 3: Configure OpenClaw
Basic Setup
# Set credentials openclaw config set whatsapp.phoneNumberId "YOUR_PHONE_NUMBER_ID" openclaw config set whatsapp.accessToken "YOUR_ACCESS_TOKEN"Enable WhatsApp
openclaw config set whatsapp.enabled true Security Configuration
# Restrict to specific users (recommended) openclaw config set whatsapp.selfChatMode true openclaw config set whatsapp.dmPolicy "allowlist" openclaw config set whatsapp.allowFrom ["+15551234567", "+15559876543"]Allow from anyone (less secure)
openclaw config set whatsapp.dmPolicy "everyone" Full Configuration
{ "channels": { "whatsapp": { "enabled": true, "phoneNumberId": "YOUR_PHONE_NUMBER_ID", "accessToken": "YOUR_ACCESS_TOKEN", "selfChatMode": true, "dmPolicy": "allowlist", "allowFrom": ["+15551234567"], "webhookVerifyToken": "YOUR_VERIFY_TOKEN" } } } ---
Step 4: Set Up Webhook
Create Webhook Endpoint
OpenClaw handles webhooks automatically. You just need to configure the URL in Meta.
# Get your webhook URL openclaw config get channels.whatsapp.webhookUrl Returns: https://your-domain.com/webhooks/whatsapp
Configure in Meta
1. Go to WhatsApp → Configuration 2. Callback URL: Your OpenClaw webhook URL 3. Verify Token: Generate a random string 4. Click "Verify and Save"
Set Verify Token in OpenClaw
openclaw config set whatsapp.webhookVerifyToken "YOUR_VERIFY_TOKEN" ---
Step 5: Test the Connection
Send a Test Message
# From OpenClaw openclaw message send --channel whatsapp --to "+15551234567" --message "Hello from OpenClaw!"Via WhatsApp
Send a message to your WhatsApp number
OpenClaw should respond
Verify Webhook
# Check webhook status openclaw channels whatsapp webhook-statusView recent webhooks
openclaw channels whatsapp logs --lines 20 ---
Common Configuration Options
Message Formatting
# Enable markdown parsing openclaw config set whatsapp.parseMarkdown trueMaximum message length
openclaw config set whatsapp.maxMessageLength 4096 Reply Settings
# Auto-reply with help openclaw config set whatsapp.autoReplyEnabled true openclaw config set whatsapp.autoReplyMessage "I'm OpenClaw! How can I help?"Typing indicators
openclaw config set whatsapp.showTyping true Media Handling
# Allow image downloads openclaw config set whatsapp.acceptImages trueMaximum image size (MB)
openclaw config set whatsapp.maxImageSize 16 ---
Troubleshooting WhatsApp Issues
Messages Not Delivering
# Check connection status openclaw channels whatsapp statusVerify credentials
openclaw config get whatsapp.phoneNumberIdCheck webhook
openclaw channels whatsapp webhook-status Webhook Verification Failed
# Verify tokens match echo "Meta:" && cat /tmp/meta_token.txt echo "OpenClaw:" && openclaw config get whatsapp.webhookVerifyTokenUpdate if needed
openclaw config set whatsapp.webhookVerifyToken "NEW_TOKEN" Phone Number Issues
---
Multi-Device Setup
Multiple Phone Numbers
{ "channels": { "whatsapp": { "enabled": true, "accounts": [ { "name": "personal", "phoneNumberId": "ID_FOR_NUMBER_1", "accessToken": "TOKEN_1" }, { "name": "business", "phoneNumberId": "ID_FOR_NUMBER_2", "accessToken": "TOKEN_2" } ] } } } Routing to Different Agents
{ "channels": { "whatsapp": { "personal": { "phoneNumberId": "ID_1", "agentId": "personal-assistant" }, "business": { "phoneNumberId": "ID_2", "agentId": "work-assistant" } } } } ---
Best Practices
1. Use allowlist mode — Only accept messages from known numbers 2. Set up two-way sync — Bidirectional messaging works best 3. Monitor usage — WhatsApp has rate limits 4. Test thoroughly — Use test numbers first 5. Keep tokens secure — Rotate access tokens regularly
---
Further Reading
---
Related Articles:
Tags: OpenClaw, AI, Tutorial
Comments
Post a Comment