> ## Documentation Index
> Fetch the complete documentation index at: https://document.botsmith.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Your BotSmith Chatbot to WhatsApp Business

> Deploy your BotSmith AI agent on WhatsApp Business API so customers can message your chatbot directly from their WhatsApp account in real time.

BotSmith connects to the WhatsApp Business API through Meta Business Suite, letting your agent reply automatically to customer messages sent to your WhatsApp Business number. Once connected and enabled, every incoming text message is handled by your BotSmith agent.

## Prerequisites

Before you start, make sure you have the following in place:

* A **Meta Business account** with access to [business.facebook.com](https://business.facebook.com).
* A **verified WhatsApp Business number** registered under your Meta Business account.
* A **WhatsApp Business API app** created in the [Meta Developer portal](https://developers.facebook.com).

If you haven't set up a WhatsApp Business API app yet, follow Meta's [Cloud API Getting Started guide](https://developers.facebook.com/docs/whatsapp/cloud-api/get-started) first, then return here.

## Step 1: Configure the Integration in BotSmith

<Steps>
  <Step title="Open the Integrations tab">
    In the BotSmith chatbot editor, click the **Integrations** tab at the top of the page.
  </Step>

  <Step title="Open WhatsApp configuration">
    Find the **WhatsApp** card and click **Setup**.
  </Step>

  <Step title="Enter your WhatsApp credentials">
    Fill in the following fields:

    * **Access Token** — Your permanent or temporary access token from Meta Business Suite. Find it in your WhatsApp Business API app under **API Setup**.
    * **Phone Number ID** — The numeric ID of your WhatsApp Business phone number. Find it in the Meta Developer portal under your app's **WhatsApp → API Setup** section.
    * **Verify Token** *(optional)* — A secret string you create yourself (for example, `my_verify_token`). You will enter this same value in the Meta Developer portal when registering the webhook. Defaults to `botsmith_verify_token` if left blank.
  </Step>

  <Step title="Save and copy your webhook URL">
    Click **Save Integration**. The integration panel displays your unique **Webhook URL** and **Verify Token** — copy both values for the next step.
  </Step>

  <Step title="Enable the integration">
    Toggle **Enable Integration** on to activate message handling.
  </Step>
</Steps>

## Step 2: Register the Webhook in Meta

After saving in BotSmith, register the webhook in the Meta Developer portal so Meta forwards incoming messages to your agent.

1. In the [Meta Developer portal](https://developers.facebook.com), open your WhatsApp Business API app.
2. Go to **WhatsApp → Configuration**.
3. Under **Webhook**, click **Edit** and enter:
   * **Callback URL** — Paste the BotSmith webhook URL (it looks like `https://YOUR_DOMAIN/api/whatsapp/webhook/YOUR_CHATBOT_ID`).
   * **Verify Token** — Enter the exact Verify Token shown in BotSmith.
4. Click **Verify and Save**. Meta sends a verification request to BotSmith; if the tokens match, the webhook is confirmed immediately.
5. Under **Webhook Fields**, click **Manage** and subscribe to the **`messages`** field.

## Step 3: Test the Integration

Send a text message to your WhatsApp Business number from any WhatsApp account. Your BotSmith agent should reply within a few seconds.

If you do not receive a reply, check that:

* The Verify Token in BotSmith matches the one entered in Meta exactly (no spaces or extra characters).
* Your Access Token has not expired. For production use, generate a permanent system-user token.
* The integration is toggled **on** in BotSmith.
* Your chatbot is set to **Active** in BotSmith settings.

<Warning>
  BotSmith only processes incoming **text messages**. Media messages such as
  images, audio clips, videos, and documents are received but not responded to —
  your agent will not reply to them.
</Warning>
