> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/en/build/choose-channel/whatsapp.md).

# Connect a Conversation Platform: WhatsApp

Connect a WhatsApp conversation channel: prepare a Meta Business account and WhatsApp Business API credentials, add a channel in MaiAgent, and bind an Agent.

## Pre-Connection Checklist <a href="#pre-integration-checklist" id="pre-integration-checklist"></a>

* An "AI Assistant" has been created on the [MaiAgent platform](https://admin.maiagent.ai/)
* You have a [Meta Business](https://business.facebook.com/) account
* A WhatsApp Business account has been created and a phone number has been linked

## Start Connection <a href="#start-integration" id="start-integration"></a>

### 1. Go to the Connect Chat Platform Page <a href="#step-go-to-channel-page" id="step-go-to-channel-page"></a>

Click <mark style="color:blue;">Chat Platforms</mark> in the left menu, then click the <mark style="color:blue;">Connect Chat Platform</mark> button in the upper right corner.

### 2. Select WhatsApp <a href="#step-select-whatsapp" id="step-select-whatsapp"></a>

On the platform selection page, click <mark style="color:blue;">WhatsApp</mark>.

### 3. Connect Your Facebook Account <a href="#step-connect-facebook-account" id="step-connect-facebook-account"></a>

Click the <mark style="color:blue;">Connect WhatsApp</mark> button. The system will open a Facebook OAuth login window.

1. Log in to your Facebook account
2. Authorize MaiAgent to access WhatsApp Business management permissions
3. After authorization, the window will close automatically and return to the settings page

{% hint style="warning" %}
Ensure your browser allows pop-up windows; otherwise, the OAuth login window may be blocked.
{% endhint %}

### 4. Select WhatsApp Business Account and Phone Number <a href="#step-select-whatsapp-business-account-and-phone" id="step-select-whatsapp-business-account-and-phone"></a>

After OAuth authorization is complete:

1. From the <mark style="color:blue;">Select WhatsApp Business Account</mark> dropdown, choose the business account to connect
2. From the <mark style="color:blue;">Select Phone Number</mark> dropdown, choose the phone number to receive messages

### 5. Basic Settings <a href="#step-basic-settings" id="step-basic-settings"></a>

| Field             | Description                                                                             |
| ----------------- | --------------------------------------------------------------------------------------- |
| **Platform Name** | Give this connection a name for easy identification                                     |
| **AI Assistant**  | Select the AI Assistant to bind                                                         |
| **Reset Command** | (Optional) Set a command that allows users to restart the conversation, e.g., "restart" |

### 6. Save Settings <a href="#step-save-settings" id="step-save-settings"></a>

After confirming all settings are correct, click <mark style="color:blue;">Save</mark> to complete the connection.

Once connected, when users send messages to the phone number via WhatsApp, the AI Assistant will automatically reply.

{% hint style="info" %}
After successful connection, you can find this integration in the chat platform list. Click edit to further configure feature options (OCR recognition, time-based replies, access control, etc.).
{% endhint %}

## Message Format and Consecutive Messages <a href="#message-format-and-merging" id="message-format-and-merging"></a>

* **Markdown automatically converted to text**: Before an Agent reply is sent to WhatsApp, Markdown syntax such as headings, links, tables, and code is automatically converted to plain text (a link becomes "text URL"), and bold text uses WhatsApp's own `*bold*` style instead. Text typed by human agents is not affected. See [Message Content Rendering Improvements: Messaging Channels](/maiagent-user-guide/en/build/choose-channel/web-chat/markdown-rendering.md#messaging-channels-plain-text)
* **Consecutive messages merged into one turn**: When a user sends several images in a row, or sends an image and then types text, the Agent waits for the whole series of messages to arrive and then answers once (for image-only messages, it answers only after about 4 seconds with no new message following the last one, up to about 20 seconds at most; as soon as text arrives, it answers immediately). Only one turn is processed at a time in the same conversation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/maiagent-user-guide/en/build/choose-channel/whatsapp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
