Connect OpenClaw to WhatsApp: Easy Setup
Connect OpenClaw to WhatsApp. Link your account via QR code and start chatting.
Overview
WhatsApp lets you chat with your OpenClaw assistant directly from WhatsApp. This guide walks you through connecting your WhatsApp account via QR code and configuring access control.
- A WhatsApp account
- OpenClaw installed (see Getting Started)
- OpenClaw running on Node.js (not Bun — see troubleshooting)
Configure OpenClaw
First, configure WhatsApp access in your config file:
Open your config.yaml and add:
channels:
whatsapp:
dmPolicy: "pairing" # pairing | allowlist | open | disabled
allowFrom: ["+15551234567"] # Your phone number in E.164 format
groupPolicy: "allowlist"Link WhatsApp Account
WhatsApp uses QR code linking (like WhatsApp Web). Run this command:
openclaw channels login --channel whatsappThis will display a QR code. Scan it with your WhatsApp app:
Open WhatsApp on your phone
Open WhatsApp and go to Settings → Linked Devices
Scan the QR code
Tap "Link a Device" and scan the QR code shown in your terminal
Wait for confirmation
Once linked, you'll see "Linked" in your terminal
openclaw channels login --channel whatsapp --account workStart the Gateway
Start OpenClaw and let it connect to WhatsApp:
openclaw gatewayYou should see logs indicating WhatsApp is connecting. Once connected, it's time to authorize yourself.
Pair Your Account
By default, WhatsApp DMs require pairing (authorization). Here's how to approve yourself:
Find your pairing code
Send any message to your OpenClaw WhatsApp from your phone. Then run:
openclaw pairing list whatsappYou'll see a code like ABC123.
Send the code to the bot
Reply to any message from the bot with your code:
ABC123Approve the pairing
Back in your terminal:
openclaw pairing approve whatsapp ABC123Test It
Now let's verify everything works:
Send a message
Send a message to your OpenClaw WhatsApp from your phone
Wait for a response
Your AI assistant should respond! If it doesn't, check the troubleshooting section below.
Troubleshooting
Common issues and how to fix them:
"Not linked" — QR required
Run openclaw channels login --channel whatsapp to re-link your account.
Linked but disconnected
- Check that the gateway is running
- Try re-linking:
openclaw channels login --channel whatsapp - Check logs:
openclaw logs --follow
Group messages not working
- Check
groupPolicyin your config - Make sure your number is in
groupAllowFrom - Groups require mention by default — mention the bot to trigger it
"Bun runtime" warning
WhatsApp doesn't work well with Bun. Use Node.js instead: npm install -g openclaw