How to Connect WhatsApp to OpenClaw
Learn how to connect WhatsApp to OpenClaw and create an AI-powered WhatsApp bot. Step-by-step guide with QR code pairing and configuration.
This guide shows you how to connect your WhatsApp account to OpenClaw, enabling AI-powered responses to your messages. You'll link your WhatsApp via QR code and configure access controls.
Prerequisites
Before connecting WhatsApp, ensure you have OpenClaw installed and the gateway running. See our installation guide if needed.
Step 1: Start the WhatsApp Login Flow
Run the channels login command to begin WhatsApp pairing:
openclaw channels loginThis displays a QR code in your terminal. You have about 60 seconds to scan it.
Step 2: Scan the QR Code
Open WhatsApp on your phone
Make sure you're using the primary device, not WhatsApp Web.
Go to Settings → Linked Devices
On iPhone: Settings → Linked Devices. On Android: ⋮ menu → Linked Devices.
Tap 'Link a Device'
You may need to authenticate with Face ID, fingerprint, or PIN.
Scan the terminal QR code
Point your camera at the QR code displayed in your terminal.
Once scanned, OpenClaw will authenticate and your WhatsApp will show a new linked device.
Step 3: Configure Access Controls
By default, OpenClaw uses 'pairing' mode where new contacts receive a one-time code. Configure this in your openclaw.json:
{
"channels": {
"whatsapp": {
"dmPolicy": "pairing",
"groups": {
"*": { "requireMention": true }
}
}
}
}DM Policy options:
pairing (default)
New senders get a time-limited approval code. Most secure option.
allowlist
Only pre-approved phone numbers can message your AI.
open
Anyone can message. Use with caution - only for public-facing bots.
disabled
No DM access at all. Groups only.
Step 4: Approve Pairing Requests
When someone new messages your AI, they'll receive a pairing code. Approve them via CLI:
# List pending pairing requests
openclaw pairing list whatsapp
# Approve a request
openclaw pairing approve whatsapp <code>Step 5: Test Your Connection
Send a test message to verify everything works:
openclaw message send --target +15555550123 --message "Hello from OpenClaw!"Connect WhatsApp in 60 seconds
Skip the CLI setup. Deploy a WhatsApp AI agent with 1 click using clawd.new.
Deploy WhatsApp Bot →