Skip to content

WhatsApp

WhatsApp integration uses the Meta Cloud API — the official business API from Meta. This is the most involved channel to set up because Meta requires business verification, but once running it’s rock solid.

  • Text, voice, image, document, and location messages
  • 24-hour message window compliance (Meta policy)
  • Template messages for outside-window outreach
  • Webhook-based delivery (requires a public HTTPS URL)
  1. Create a Meta Business account if you don’t have one
  2. Add a WhatsApp Business product to your Meta App in the Meta for Developers console
  3. Add a test phone number or verify your own business number
  4. In WhatsApp → API Setup, copy:
    • Temporary access token (24h) or a permanent System User token
    • Phone Number ID
    • WhatsApp Business Account ID
Terminal window
aibutler vault set whatsapp_access_token YOUR_ACCESS_TOKEN
aibutler vault set whatsapp_phone_number_id YOUR_PHONE_NUMBER_ID

For production, generate a permanent token via a System User under Business Settings → Users → System Users. Temporary tokens expire after 24 hours.

WhatsApp requires a public HTTPS endpoint for incoming messages. Point Meta’s webhook at:

https://your-host/webhook/whatsapp

Set a Verify Token of your choosing and store it:

Terminal window
aibutler vault set whatsapp_verify_token $(openssl rand -hex 16)

Subscribe to the following webhook fields:

  • messages
  • message_status (optional, for delivery receipts)
configurations:
channels:
active:
- whatsapp
Terminal window
aibutler run

On startup you should see whatsapp: tools registered. Send a message to your WhatsApp Business number.

Meta only allows free-form messages within 24 hours of the user’s last message. Outside that window, you must use approved message templates. AI Butler logs a warning if it tries to send outside the window — you’ll need to register templates in the Meta dashboard for outbound-first flows.

FeatureSupported
Text messagesYes
ImagesYes
Voice messagesYes (transcribed via STT)
DocumentsYes
LocationYes (read-only)
TemplatesYes (pre-approved)
Streaming repliesNo (WhatsApp has no edit API)
Group chatsNo (Cloud API limitation)

(#100) Invalid parameter when sending. The recipient hasn’t messaged you in the last 24 hours. You need to use a template.

Webhook verification fails. Meta sends a GET request with hub.verify_token — it must match your whatsapp_verify_token exactly. Check for trailing whitespace.

Messages sent but never delivered. The recipient must have WhatsApp installed and must not have blocked your business number. Check the message_status webhook for delivery receipts.