WhatsApp Configuration
WhatsApp (web channel)
Section titled “WhatsApp (web channel)”Status: Stable (WhatsApp Web via Baileys). The Gateway owns the session(s).
OpenClaw connects to WhatsApp using the Baileys library, simulating a WhatsApp Web client. This allows your agent to reply to messages, manage groups, and act as a personal assistant directly within WhatsApp.
Quick Setup
Section titled “Quick Setup”Prepare a Phone Number Use a separate phone number if possible (recommended) or your personal number.
Configure OpenClaw Add the WhatsApp configuration to
~/.openclaw/openclaw.json.{channels: {whatsapp: {enabled: true,dmPolicy: "allowlist",allowFrom: ["+15551234567"] // Your personal number}}}Start the Gateway Run the gateway to initialize the connection.
Terminal window openclaw gateway runScan QR Code The gateway will print a QR code to the terminal (or logs).
- Open WhatsApp on your phone.
- Go to Settings > Linked Devices > Link a Device.
- Scan the QR code.
Configuration Strategy
Section titled “Configuration Strategy”Option A: Dedicated Number (Recommended)
Section titled “Option A: Dedicated Number (Recommended)”Use a spare Android phone or an eSIM on your main device.
- Pros: Clean routing, no “self-chat” quirks, distinct identity.
- Setup: Install WhatsApp (or WhatsApp Business) on the spare device/profile. Link OpenClaw to this account.
Option B: Personal Number (Fallback)
Section titled “Option B: Personal Number (Fallback)”Run OpenClaw on your own main number.
- Pros: No extra hardware/SIM needed.
- Cons: You have to message yourself (Note to Self) to talk to the bot.
- Quirks: You will see the bot’s replies as if you sent them.
Advanced Configuration
Section titled “Advanced Configuration”{ channels: { whatsapp: { enabled: true, // Who can talk to the bot? dmPolicy: "allowlist", // "allowlist" (strict) or "pairing" (open) allowFrom: ["+15551234567"],
// Admin users (can run privileged commands) adminUsers: ["+15551234567"],
// Session storage (defaults to ~/.openclaw/workspace/sessions/whatsapp) sessionDir: "/path/to/custom/session" } }}Troubleshooting
Section titled “Troubleshooting”- QR Code Loop: If the QR code keeps regenerating, ensure your phone has a stable internet connection.
- Disconnects: WhatsApp Web sessions can time out. Restart the gateway to refresh the session.
- No Reply: Check
dmPolicy. If set toallowlist, ensure your number is inallowFrom(include country code, e.g.,+1...). - Group Chats: By default, the bot may not reply in groups unless mentioned or configured otherwise.