What You Will Achieve
By following this guide, you will connect OpenClaw to WhatsApp. Once connected, you can send messages on WhatsApp and receive AI-powered responses. This is perfect for people who use WhatsApp as their primary messaging app and want AI assistance on the go.
How WhatsApp Connection Works
Unlike Telegram and Discord which use bots, WhatsApp connection works differently. OpenClaw connects to WhatsApp Web, the same technology that powers WhatsApp on your computer. You will scan a QR code to link your WhatsApp account, and then OpenClaw can send and receive messages on your behalf.
Important Limitations
WhatsApp has strict policies about automated messaging. Using OpenClaw with WhatsApp is intended for personal use only. Do not use it to spam or send bulk messages, as this may result in your WhatsApp account being banned.
Before You Start
Make sure you have completed these steps:
- OpenClaw is installed and running on your computer
- You have a WhatsApp account with an active phone number
- WhatsApp is installed on your phone and working normally
Check OpenClaw Status First
Before continuing, open your terminal and run openclaw status. You should see "Gateway: running". If not, start OpenClaw first by running openclaw gateway --daemon.
Verify OpenClaw is running:
openclaw status
Expected Result
Gateway: running Port: 18789 Auth: configured
Understanding the Process
Here is what we will do:
- Start the WhatsApp channel in OpenClaw
- Scan a QR code with your phone (like WhatsApp Web)
- Test the connection by sending a message
- Configure auto-reply settings (optional)
WhatsApp Web Technology
OpenClaw uses the same connection method as WhatsApp Web. When you scan the QR code, your phone authorizes OpenClaw to access your WhatsApp messages. Your phone must stay connected to the internet for this to work.
Step-by-Step Setup
Enable the WhatsApp Channel
First, we need to tell OpenClaw that we want to use WhatsApp. Edit the OpenClaw configuration file.
Open your terminal and edit the config file:
nano ~/.openclaw/openclaw.json
Add the WhatsApp channel configuration:
{
"channels": {
"whatsapp": {
"enabled": true,
"dmPolicy": "pairing"
}
}
}
What is dmPolicy?
"pairing"(default): New contacts must be approved before getting AI responses"allowlist": Only specific phone numbers can use the bot"open": Anyone can message and get responses (use with caution)
Save the file (Ctrl+O, then Ctrl+X in nano).
Expected Result
Your configuration file now includes WhatsApp settings.
Restart the Gateway
For the new channel to work, we need to restart OpenClaw's gateway.
openclaw gateway restart
Wait a few seconds for the gateway to restart with WhatsApp support enabled.
Expected Result
Stopping gateway... Starting gateway... Gateway started successfully Channels: whatsapp (waiting for QR)
Display the QR Code
Now we need to get a QR code to scan with your phone.
openclaw channels login --channel whatsapp
A QR code will appear in your terminal. If your terminal does not display it correctly, you can also view it in your browser.
QR Code Not Showing Correctly?
If the QR code looks broken in your terminal, try opening the OpenClaw dashboard in your browser at http://127.0.0.1:18789/ and look for the WhatsApp QR code there.
Expected Result
Scan this QR code with WhatsApp on your phone:
█████████████████████████████ █████████████████████████████ ████ ▄▄▄▄▄ █▀▄▀▄█ ▄▄▄▄▄ ████ ████ █ █ █▄▀ ▀█ █ █ ████ ████ █▄▄▄█ █ ▄▀██ █▄▄▄█ ████ ████▄▄▄▄▄▄▄█▄▀▄█▄▄▄▄▄▄▄▄████ █████████████████████████████
Waiting for scan...
Scan the QR Code with Your Phone
Now pick up your phone and scan the QR code.
On your phone:
- Open WhatsApp
- Tap the three dots menu (top right on Android) or Settings (bottom right on iPhone)
- Tap Linked Devices
- Tap Link a Device
- Your phone's camera will open. Point it at the QR code on your computer screen.
Face ID or Fingerprint
Your phone may ask you to authenticate with Face ID, Touch ID, or your phone passcode before scanning. This is a security feature to prevent unauthorized access.
Expected Result
After scanning, your terminal will show: WhatsApp connected successfully! Logged in as: +1234567890
Important: Keep your phone connected to the internet. If your phone goes offline, the WhatsApp connection will stop working.
Verify the Connection
Let us make sure everything is working.
openclaw status
Expected Result
Gateway: running Port: 18789 Auth: configured Channels: whatsapp (connected)
You should see whatsapp (connected) in the channels list.
Configure Auto-Reply (Optional)
By default, OpenClaw will only respond to messages from approved contacts. You can configure how it responds by editing the configuration file.
Edit ~/.openclaw/openclaw.json:
Option A: Respond only to specific contacts (allowlist)
This is the safest option. Only phone numbers in the list can get AI responses.
{
"channels": {
"whatsapp": {
"dmPolicy": "allowlist",
"allowFrom": ["+15551234567", "+15559876543"]
}
}
}
Option B: Use pairing mode (default)
New contacts receive a pairing code that you must approve.
{
"channels": {
"whatsapp": {
"dmPolicy": "pairing"
}
}
}
Use With Caution
If you set dmPolicy to open with allowFrom: ["*"], anyone who messages you will get an AI response. This could be confusing for people who do not know about your AI setup.
Test Your First Message
Now let us test that AI responses are working!
Option A: Message yourself
You can send a message to yourself on WhatsApp:
- Open WhatsApp on your phone
- Find your own contact (or message your saved number)
- Send a message like "Hello AI!"
Option B: Ask a friend to message you
Have a friend send you a WhatsApp message. If they are not yet approved, they will receive a pairing code.
For new contacts (pairing required):
When someone new messages you, they receive a pairing code. Approve them in your terminal:
openclaw pairing list whatsapp
Expected Result
Pending pairing requests: [1] WhatsApp: +1987654321 (Code: 789012)
openclaw pairing approve whatsapp 789012
Replace 789012 with the actual pairing code shown.
Test the AI Response
After pairing is complete, send another message:
- Open WhatsApp
- Send a message like "What is the weather like today?"
Expected Result
You should receive an AI-generated response within a few seconds.
Congratulations!
You have successfully connected OpenClaw to WhatsApp! You can now chat with AI through WhatsApp on any device.
Common Problems and Solutions
QR code expired
QR codes expire after a short time for security reasons.
Solution: Run the login command again to get a fresh code:
openclaw channels login --channel whatsapp
"WhatsApp disconnected" message
This happens when your phone loses internet connection or WhatsApp is closed.
Solution:
- Make sure your phone has internet access
- Open WhatsApp on your phone
- Run
openclaw gateway restartto reconnect
QR code looks corrupted in terminal
Some terminals do not display QR codes correctly.
Solution:
- Open your browser
- Go to
http://127.0.0.1:18789/ - Find the WhatsApp section and scan the QR code from there
"Session logged out" error
WhatsApp may log out linked devices periodically for security.
Solution:
- Run
openclaw channels loginto get a new QR code - Scan again with your phone
Phone battery drains quickly
WhatsApp needs to maintain a connection to your phone, which can use battery.
Tips:
- Keep your phone plugged in when possible
- Use WiFi instead of mobile data
- Close other apps you are not using
Messages not being received
Check if WhatsApp on your phone is working correctly.
Solution:
- Open WhatsApp on your phone and send a test message to a friend
- If that works, restart the OpenClaw gateway:
openclaw gateway restart - Check the logs:
openclaw logs --limit 20
Bot responds to wrong messages
By default, OpenClaw may respond to all messages.
Solution:
Edit ~/.openclaw/openclaw.json to use allowlist mode:
{
"channels": {
"whatsapp": {
"dmPolicy": "allowlist",
"allowFrom": ["+15551234567"]
}
}
}
Only phone numbers in the allowFrom list will get responses.
Privacy and Security
Your Messages Are Processed
When using OpenClaw with WhatsApp, your messages are sent to AI services for processing. Be mindful of what information you share.
Important security considerations:
-
End-to-end encryption: WhatsApp messages are encrypted between you and the recipient. However, OpenClaw needs to read the message content to provide AI responses.
-
Message storage: OpenClaw may temporarily store messages for processing. Check your OpenClaw configuration to understand data retention.
-
Account security: Never share your QR code screenshots. Anyone who scans your QR code can access your WhatsApp messages.
To disconnect WhatsApp from OpenClaw:
openclaw channels remove --channel whatsapp
openclaw gateway restart
You can also disconnect from your phone:
- Open WhatsApp
- Go to Linked Devices
- Tap on the OpenClaw session
- Tap Log Out
Advanced Configuration
All advanced configurations are done by editing ~/.openclaw/openclaw.json.
Disable read receipts
Prevent blue checkmarks from appearing when messages are read:
{
"channels": {
"whatsapp": {
"sendReadReceipts": false
}
}
}
Configure group messages
Allow the bot to respond in WhatsApp groups:
{
"channels": {
"whatsapp": {
"groupPolicy": "allowlist",
"groups": ["*"]
}
}
}
Add acknowledgment reaction
Automatically react to messages when processing:
{
"channels": {
"whatsapp": {
"ackReaction": {
"emoji": "👀",
"direct": true,
"group": "mentions"
}
}
}
}
Using WhatsApp on Multiple Devices
One of the benefits of WhatsApp is that it syncs across devices:
- Phone: Primary device, must stay connected
- WhatsApp Web: Access from any browser
- WhatsApp Desktop: Native app for Windows and Mac
Your AI conversations will appear on all your devices. However, remember that the AI only responds through OpenClaw on your computer. If OpenClaw is not running, you will not get AI responses.
What To Do Next
Now that WhatsApp is connected, explore these options:
- Connect to Telegram - Add Telegram as another channel
- Connect to Discord - Use AI in Discord servers
- Multi-Channel Setup - Use all platforms together
- Your First Agent - Customize your AI's behavior
Need Help?
If you run into problems not covered here, check our Troubleshooting guide or visit the official OpenClaw documentation.
Last updated: February 3, 2026 | Found an error? Contact us