WhatsApp Business with OpenClaw: Setup Guide
Step-by-step instructions for connecting OpenClaw to WhatsApp Business API, including Meta Business verification and webhook configuration.
WhatsApp is the most widely used messaging platform globally, with over two billion active users. Connecting OpenClaw to WhatsApp through the Business API lets you deliver AI coding assistance where your team -- or your customers -- already communicate. This guide walks through the setup process, which is more involved than Discord or Telegram but entirely manageable.
Understanding the WhatsApp Business API
Unlike Discord and Telegram, WhatsApp doesn't have a simple "create a bot" workflow. Access goes through Meta's WhatsApp Business Platform, which requires a verified business account. There are two approaches:
WhatsApp Business Platform (Cloud API)
Meta hosts the API infrastructure. You register a phone number, configure webhooks, and Meta handles message delivery. This is the recommended approach for most deployments.
WhatsApp Business API (On-Premises)
You host the API infrastructure yourself. This gives you more control but requires significantly more setup and maintenance. Unless you have specific compliance requirements, use the Cloud API.
This guide covers the Cloud API approach.
Prerequisites
Before you begin, you'll need:
- A running OpenClaw instance with a publicly accessible HTTPS URL (required for webhooks)
- A Meta Developer account
- A Meta Business account (free to create)
- A phone number that can receive SMS or voice calls for verification (this number becomes your WhatsApp business number)
Step 1: Set Up Meta Business Account
If you don't already have a Meta Business account, create one at business.facebook.com. Follow the verification steps, which may include submitting business documentation. Verification can take anywhere from a few hours to several days.
While waiting for verification, you can proceed with the developer setup using Meta's test environment.
Step 2: Create a Meta App
Go to developers.facebook.com and create a new app. Select "Business" as the app type. On the product setup screen, find "WhatsApp" and click "Set Up."
This adds the WhatsApp product to your app and connects it to your Meta Business account.
Navigate to WhatsApp Settings
In your app dashboard, go to WhatsApp > Getting Started. Meta provides a test phone number and a temporary access token for initial testing. Note down:
- Phone Number ID: Identifies which WhatsApp number sends messages
- WhatsApp Business Account ID: Your business account identifier
- Temporary Access Token: Valid for 24 hours, used for initial testing
For production, you'll generate a permanent access token (covered in Step 4).
Step 3: Register Your Phone Number
In the WhatsApp settings, go to "Phone Numbers" and click "Add Phone Number." Enter the phone number you want to use for your WhatsApp business presence.
Meta will send a verification code via SMS or voice call. Enter the code to verify ownership.
Important Considerations
- The phone number cannot already be registered with WhatsApp (personal or business)
- If the number is currently on WhatsApp, you must delete that account first
- Once registered as a business number, it cannot be used for personal WhatsApp
Step 4: Generate a Permanent Access Token
The temporary token from Step 2 expires after 24 hours. For production use, create a permanent System User token:
- In Meta Business Settings, go to Users > System Users
- Create a new System User with Admin role
- Click "Generate New Token" for your WhatsApp app
- Select
whatsapp_business_messagingandwhatsapp_business_managementpermissions - Copy the generated token -- this is your permanent access token
Store this token securely. It provides full access to send and receive messages through your WhatsApp business number.
Step 5: Configure Webhooks
WhatsApp delivers incoming messages to your server via webhooks. Your OpenClaw instance must be reachable at a public HTTPS URL.
Set Up the Webhook URL
In your Meta app's WhatsApp settings, go to Configuration > Webhook. Set the callback URL to your OpenClaw instance's webhook endpoint. The exact path depends on your OpenClaw configuration, but it typically follows the pattern:
https://your-instance.example.com/webhook/whatsapp
Verify Token
Meta requires a verify token to confirm you own the webhook URL. Choose any string (like a random password) and enter it in both Meta's webhook configuration and your OpenClaw WhatsApp channel settings.
Subscribe to Message Events
After configuring the webhook URL, subscribe to the messages webhook field. This tells Meta to send incoming message notifications to your URL.
Step 6: Configure OpenClaw
With all the Meta-side configuration complete, configure OpenClaw to use WhatsApp as a channel.
Using the Setup Wizard
Navigate to your OpenClaw instance's /setup page. In the channel configuration section, select "WhatsApp" and provide:
- Access Token: The permanent System User token from Step 4
- Phone Number ID: From your WhatsApp settings in the Meta dashboard
- Webhook Verify Token: The same verify token you configured in Step 5
The setup wizard writes this configuration and restarts the gateway.
Verification
After configuration, send a WhatsApp message to your business number from a personal WhatsApp account. The message should reach your OpenClaw instance via the webhook, process through the AI, and the response should appear in the WhatsApp conversation.
Message Template Considerations
WhatsApp has a concept of "conversation windows." When a user messages your business number, a 24-hour window opens during which you can send free-form messages. Outside this window, you can only send pre-approved message templates.
For an AI assistant use case, this is rarely an issue because the interaction pattern is always user-initiated: the user sends a question, and the bot responds within the window. However, if you plan to send proactive notifications, you'll need to create and get approval for message templates.
Troubleshooting
Webhook Verification Fails
Double-check that your verify token matches exactly between Meta's configuration and your OpenClaw settings. Ensure your instance is publicly accessible and that HTTPS is properly configured. Meta will not accept HTTP-only webhook URLs.
Messages Sent But Not Received
Check the webhook delivery logs in Meta's App Dashboard under WhatsApp > Configuration. Failed deliveries show error codes that help diagnose the issue. Common problems include expired access tokens, incorrect phone number IDs, or webhook URL timeouts.
Rate Limits
New WhatsApp Business accounts start with messaging limits that increase as you build a quality rating. Initially, you can message up to 1,000 unique users per day. For team-internal use, this is more than sufficient. For customer-facing deployments, monitor your tier and request increases through Meta's Business Manager.
Message Formatting
WhatsApp supports a limited set of formatting options compared to Discord or Telegram. Bold, italic, strikethrough, and monospace text work, but complex Markdown like tables or nested lists may not render as expected. Test AI responses that include code to ensure they're readable in WhatsApp's interface.
Cost Considerations
The WhatsApp Business API is not free. Meta charges per conversation (a 24-hour messaging window), with rates varying by country and conversation type. User-initiated conversations (where the user messages first) are generally cheaper than business-initiated ones. Check Meta's current pricing documentation for exact rates in your region.
For a team-internal AI assistant, costs are typically modest -- a few dollars per month for active teams. For customer-facing deployments, model the expected conversation volume against Meta's pricing tiers.
Conclusion
WhatsApp integration requires more upfront setup than Discord or Telegram due to Meta's business verification and API access requirements. However, the payoff is access to the most widely used messaging platform in the world. Once configured, the integration works reliably, and your team or customers can interact with OpenClaw's AI assistant through an interface they use every day.