# WhatsApp

> Connect WhatsApp through the Meta Cloud API for real two-way AI support. Set up the webhook, save your access token, and the agent answers inbound messages automatically.

The WhatsApp channel connects your agent to the **Meta Cloud API** for genuine two-way messaging. Customers message your WhatsApp number, Meta forwards each message to a Bookbag webhook, the agent replies from your knowledge, and Bookbag sends the answer back through the Cloud API.

> **PREREQUISITES:** A Meta Business account, a WhatsApp Business phone number registered in the WhatsApp Cloud API, and a system-user **access token** with messaging permissions.

## Connect WhatsApp

1. **Enable the WhatsApp channel** — On the agent's Deploy tab, open the WhatsApp card and choose Connect.
2. **Save your credentials** — Enter the Cloud API access token and the send URL (the Graph API messages endpoint for your phone number). Bookbag uses these to send replies back out.
3. **Set the webhook in Meta** — In your Meta app's WhatsApp → Configuration, set the Callback URL to the channel's inbound webhook and choose a verify token. Subscribe to the messages field.
4. **Verify the webhook** — Meta sends a GET verification request with a challenge; Bookbag answers it automatically so the webhook turns green.

> **INBOUND WEBHOOK URL:** Use `https://app.bookbag.ai/channels/whatsapp/webhook` as the Meta callback URL. The exact URL is shown on the WhatsApp channel card.

## How verification works

Meta validates your webhook with a one-time handshake: it sends a `GET` to your callback URL with `hub.mode=subscribe`, `hub.verify_token`, and `hub.challenge`. Bookbag echoes the `hub.challenge` value back as plain text, which completes the subscription. You don't need to build anything for this.

## Inbound and outbound flow

Once connected, the round trip is fully automatic:

- **Inbound** — Meta POSTs the message envelope to your webhook. Bookbag parses the sender and text and runs the agent.
- **Outbound** — Bookbag POSTs the reply to your send URL with the access token, addressing it to the customer's WhatsApp ID.

> **REUSE THIS CHANNEL FOR OUTBOUND CAMPAIGNS:** A connected WhatsApp channel also powers real campaign sends. With it configured, [Outbound campaigns](/docs/outbound/campaigns) deliver through the Cloud API instead of a simulation.

## Messaging windows and templates

> **THE 24-HOUR RULE:** WhatsApp only lets you send free-form messages within 24 hours of the customer's last message. To start a conversation outside that window you must use a pre-approved message template. See [WhatsApp templates](/docs/outbound/whatsapp-templates).

## What's next

- [WhatsApp templates](/docs/outbound/whatsapp-templates) — Create and manage approved templates for proactive messages.
- [Outbound campaigns](/docs/outbound/campaigns) — Reach customers proactively over WhatsApp.
- [WhatsApp integration](/docs/integrations/whatsapp) — Credentials, limits, and connection details.
