WhatsAppClawdbotSetup GuideTutorial

How to Set Up Clawdbot on WhatsApp: Full Walkthrough

ยท4 min read

WhatsApp is where most people spend their time messaging. Having an AI assistant right there โ€” in the same app you use to talk to friends and family โ€” changes how you interact with AI entirely. No switching apps, no opening a browser. Just text your bot like you'd text anyone else.

Setting up Clawdbot on WhatsApp takes a bit more work than Telegram, but it's absolutely worth it.

Why WhatsApp is different

Unlike Telegram or Discord, WhatsApp doesn't have a simple "create a bot" button. You need to go through the WhatsApp Business API, which means a few extra steps. But don't worry โ€” it's not as complicated as it sounds.

What you'll need

  • A server with at least 2GB RAM and Docker installed
  • A phone number dedicated to your bot (can't be your personal number)
  • A Meta (Facebook) Business account
  • An AI API key (OpenAI, Anthropic, etc.)

Step 1: Set up Meta Business account

  1. Go to business.facebook.com and create an account if you don't have one
  2. Navigate to the Meta Developer Portal
  3. Create a new app and select "Business" as the type
  4. Add the "WhatsApp" product to your app

Step 2: Configure WhatsApp Business API

In the Meta Developer dashboard:

  1. Go to WhatsApp > Getting Started
  2. You'll see a temporary phone number for testing โ€” this works for development
  3. Note down your Phone Number ID and WhatsApp Business Account ID
  4. Generate a permanent Access Token (the temporary one expires in 24 hours)

Step 3: Set up the webhook

WhatsApp sends incoming messages to your server via webhooks. You need a publicly accessible URL.

If your server has a domain, great. If not, you can use a reverse proxy like Cloudflare Tunnel or ngrok for testing.

Your webhook URL will be something like:

https://your-domain.com/webhook/whatsapp

In the Meta Developer dashboard:

  1. Go to WhatsApp > Configuration
  2. Set the Callback URL to your webhook endpoint
  3. Set a Verify Token (any string you choose โ€” you'll use this in your config)
  4. Subscribe to the "messages" webhook field

Step 4: Install and configure OpenClaw

git clone https://github.com/openclaw/openclaw.git
cd openclaw
cp .env.example .env

Edit .env:

# WhatsApp configuration
WHATSAPP_ACCESS_TOKEN=your_access_token
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_VERIFY_TOKEN=your_verify_token
 
# AI API key
OPENAI_API_KEY=your_api_key_here

Step 5: Launch

docker compose up -d

Step 6: Test it

Send a message to your bot's WhatsApp number. If everything is configured correctly, you should get an AI-powered response within seconds.

Moving to production

The test setup uses Meta's temporary credentials. For production:

  1. Verify your business in Meta Business Manager
  2. Register your phone number โ€” you'll need a real phone number that can receive SMS or calls for verification
  3. Request messaging permissions โ€” Meta needs to approve your use case
  4. Set up a message template for initiating conversations (WhatsApp requires this for business-initiated messages)

This process takes a few days but is straightforward.

Tips for WhatsApp

  • Message limits: New WhatsApp Business accounts start with a limit of 1,000 unique conversations per day. This increases as you build a track record.
  • 24-hour window: After a user messages you, you have 24 hours to respond freely. After that, you need to use approved message templates.
  • Media support: Clawdbot can send and receive images, documents, and voice messages on WhatsApp.
  • End-to-end encryption: WhatsApp messages are encrypted in transit. Since you're self-hosting, your data stays on your server.

Common issues

Webhook not receiving messages?

  • Make sure your server is publicly accessible
  • Verify the webhook URL and verify token match
  • Check that you've subscribed to the "messages" field

Messages sending but no AI response?

  • Check your AI API key and credits
  • Look at the Docker logs: docker compose logs -f

Meta verification taking too long?

  • Make sure all business information is accurate
  • Respond promptly to any verification requests from Meta

What's next?

With WhatsApp connected, your AI assistant is now available in the world's most popular messaging app. Consider:

  • Adding Telegram or Discord as backup channels
  • Setting up automated workflows
  • Customizing response behavior for different contacts

Need help? Reach out to us โ€” setup assistance is free.