# Connect WhatsApp to your AI agent (/docs/channels/whatsapp)

> Connect WhatsApp through Meta Cloud API: create the app, a permanent token, paste the credentials, set the webhook and go live with a real number.

Type: how-to | Status: beta | Last reviewed: 2026-11-21 | Minimum role: admin

<Callout type="info">Messaging channels connect through your own provider account (bot, Meta app or Google project). They are in beta: finish with a real test conversation and keep your provider credentials safe.</Callout>

You need a Meta account. A test number is free and instant; a real number needs Meta business verification.

## How do I connect WhatsApp to my AI agent? [#how-do-i-connect-whatsapp-to-my-ai-agent]

Create a Business app at Meta for Developers and add the WhatsApp product. Create a permanent token, paste your credentials into Loopwix and set the webhook. A test number is free and instant. A real number needs Meta business verification. WhatsApp is in beta.

## 1. Create the Meta app [#1-create-the-meta-app]

1. At Meta for Developers create an app of type **Business** (use case "Connect with customers through WhatsApp") and add the **WhatsApp** product. Meta creates a WhatsApp Business Account and a test phone number.
2. In **WhatsApp → API Setup** note the **Phone number ID** (the long number under "From", not the phone number). In "To", add up to five recipient numbers to test with.
3. In **Settings → Basic** copy the **App secret**. It lets Loopwix verify that each message really comes from Meta.

## 2. Create a permanent token [#2-create-a-permanent-token]

Do not use the 24-hour token. In Meta Business settings go to **Users → System users** and add one (Admin). Assign your app and your WhatsApp account (full control). Then **Generate token** with `whatsapp_business_messaging` and `whatsapp_business_management`, and expiry **Never**.

## 3. Connect in Loopwix [#3-connect-in-loopwix]

1. Agent → **Channels → WhatsApp**: paste **Phone number ID**, **Access token** and **App secret** (WABA ID optional) and select **Save and continue**.
2. Copy the **Callback URL** and **Verify token** shown.

<Screenshot src="/media/channels/whatsapp-setup.png" alt="The WhatsApp setup sheet with the step-by-step guide and the Phone number ID, Access token and App secret fields" caption="The WhatsApp setup sheet" captured="2026-11-22" />

3. In Meta: **WhatsApp → Configuration → Webhook → Edit**, paste both, **Verify and save**, then subscribe to the **messages** field.
4. Message the test number from an allowed recipient. Meta apps that are not live only deliver messages from people added as testers.

## 4. Go live with your real number [#4-go-live-with-your-real-number]

1. Complete **business verification** in Meta.
2. Add and verify your phone number and display name (Meta reviews it).
3. Edit the Loopwix connection to use the new number's **Phone number ID**.
4. Switch the Meta app to **Live** and add a privacy policy URL.
5. Add a payment method. Meta charges per delivered message, by category; see [WhatsApp costs and rules](/docs/channels/whatsapp-costs-and-rules).
6. [Publish the agent](/docs/agents/publish) and test.

## What customers can do on WhatsApp [#what-customers-can-do-on-whatsapp]

Customers get the same agent as on your website chat: the same knowledge, instructions and workflows. They can:

- Ask questions and get answers from your published knowledge.
- Verify their email by typing a 6-digit code into the chat, then ask about their own orders or bookings.
- Confirm or cancel an action with **Yes** and **No** buttons. Nothing changes until they tap **Yes**.
- Send photos, documents and voice notes, once you turn files on for the connection.
- Ask for a person. Hand-over is switched on by Loopwix on request; see [Set up escalation](/docs/inbox/set-up-escalation).

A short example:

> **Customer:** Do you deliver on Sundays?
>
> **Agent:** We deliver Monday to Saturday. Orders placed on Sunday ship on Monday morning.
>
> **Customer:** Can I change my delivery address?
>
> **Agent:** To continue I need to verify your email address first. What's your email? (Reply CANCEL to skip.)

## What Loopwix can access [#what-loopwix-can-access]

- **whatsapp_business_messaging** lets Loopwix receive messages sent to your number and send replies from it.
- **whatsapp_business_management** lets Loopwix read your WhatsApp Business account details.
- The **App secret** lets Loopwix check that each message really came from Meta. It is not used to send anything.

Loopwix only sees messages sent to the connected number. Your token and App secret are stored encrypted and never shown again.

## Rules to know [#rules-to-know]

- **24-hour window**: free-form replies only within 24 hours of the customer's last message. Loopwix does not send message templates today, so it cannot start a conversation or reply after the window closes.
- **Costs**: Meta charges your Meta account per delivered message. Rates depend on the category and the customer's country. See [WhatsApp costs and rules](/docs/channels/whatsapp-costs-and-rules).
- **Opt-out**: "STOP" is honoured automatically, and "START" subscribes the customer again.
- **Files**: photos, documents and voice notes are off until you turn them on ([Files](/docs/languages-attachments/files-from-customers)).
- **Message length**: a reply can be up to 4,096 characters. Longer answers are split into several messages.

Meta's [WhatsApp Business Platform documentation](https://developers.facebook.com/docs/whatsapp/cloud-api) is the source for these rules.

### Can I use my existing WhatsApp number?

Yes, once it is registered with the WhatsApp Business Platform in Meta. A number used in the WhatsApp app has to be moved to the platform first. Meta's documentation explains the options.

### What happens outside the 24-hour window?

The agent and your team cannot message the customer. Their next message opens a new window. See [WhatsApp costs and rules](/docs/channels/whatsapp-costs-and-rules).

### Do I need Meta business verification?

Not to test: a Meta test number works at once with up to five recipient numbers. To answer customers on your own number, Meta asks for business verification and reviews your display name.

## Troubleshooting [#troubleshooting]

| Symptom | Fix |
|---|---|
| Meta cannot validate the callback | Save the connection first; paste the token without spaces |
| Messages arrive but no reply | Read **Activity** for window closed, opted out, expired token or unpublished agent |
| Signature errors | Wrong App secret (one per Meta app) |
| Nothing arrives | The `messages` field is not subscribed, or you are not a tester |
