For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connect a Conversation Platform: WhatsApp

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

Before You Integrate

  • An "AI Assistant" has been created on the MaiAgent platform

  • You have a Meta Business account

  • A phone number ready to integrate. Either of the following works:

    • A number already linked to a WhatsApp Business account, or a number added in the Meta authorization window

    • A number currently in use in the WhatsApp Business App on a phone; the App can still be used after integration, see Sharing a Number with the WhatsApp Business App

Start Integrating

1. Open the Channel Integration Page

In the left menu, select Messaging Channels, then click the Connect Channel button at the top right.

2. Select WhatsApp

On the platform selection page, click WhatsApp.

3. Connect a Facebook Account

Click the Connect WhatsApp button; the system opens a Facebook OAuth login window.

The WhatsApp step of connecting a channel, with the Connect WhatsApp button in the center of the screen
Click Connect WhatsApp to open the Meta authorization window
  1. Log in to your Facebook account

  2. Authorize MaiAgent to access WhatsApp Business management permissions

  3. Follow the instructions in the Meta window to select or create a WhatsApp Business account and phone number. To integrate a number currently used by the WhatsApp Business App, choose the option to connect an existing WhatsApp Business App, and complete the confirmation in the App on your phone as instructed

  4. After authorization is complete, the window closes automatically and returns to the settings page

4. Select the WhatsApp Business Account and Phone Number

After OAuth authorization is complete:

  1. From the Select WhatsApp Business account dropdown, choose the business account you selected in the Meta window; the options appear as "WABA" followed by the account's numeric ID, not the account name

  2. From the Select phone number dropdown, choose the phone number that will receive messages: if a number was already selected in the Meta window, the list shows only that number; for a number integrated from the WhatsApp Business App, or when only a business account was selected in the Meta window, the list shows the numbers under that business account

If you chose the wrong account or number, click Reload at the top right before saving to authorize again.

5. Basic Settings

Field
Description

Channel name

Give this integration a name for easy identification

AI Assistant

Select the Agent to bind

Reset command

(Optional) When turned on, you can add one or more command texts (for example "Start over"); when a message a user sends on WhatsApp exactly matches one of them, a new conversation is started for that user. The command itself receives no reply; the AI answers in the new conversation when the user sends the next message

6. Save Settings

After confirming the settings are correct, click Save to complete the integration.

Once the integration is complete, when users send messages to that phone number through WhatsApp, the Agent replies automatically.

After a successful integration, you can find it in the channel list; click Edit to configure further feature options (OCR recognition, scheduled replies, permission control, and so on).

Sharing a Number with the WhatsApp Business App

A number already run on the phone with the WhatsApp Business App can be integrated with MaiAgent without switching to a new number: in the Meta window from Connect a Facebook Account, choose to connect an existing WhatsApp Business App, and when finished, select that number as described in Select the WhatsApp Business Account and Phone Number. No separate activation is needed on the MaiAgent side.

After integration, the number works on both the App and MaiAgent:

  • The App keeps working: The number stays in the WhatsApp Business App on your phone, and you can continue to view and reply to customers in the App

  • The Agent replies to customer messages: Messages customers send to this number enter MaiAgent, and the bound Agent replies automatically

Whether a number can be integrated this way (for example, by country/region or App version) depends on the options shown in the Meta authorization window.

Message Format and Consecutive Messages

  • Markdown is automatically converted to text: Markdown syntax in Agent replies, such as headings, links, tables, and code, is automatically converted to plain text before being sent to WhatsApp (a link becomes "text URL"), and bold uses WhatsApp's own *bold* style; text typed by human agents is not affected, see Message Rendering Optimization: Messaging Channels

  • Consecutive messages are merged into one round: 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 when no new message arrives about 4 seconds after the last one, up to about 20 seconds at most; as soon as text is received, it answers immediately); only one round is processed at a time per conversation

Troubleshooting

Situation or error message
Cause
Solution

The organization receives the platform announcement "WhatsApp integration requires reconnection", and that WhatsApp channel no longer replies to customers

Meta has invalidated the authorization MaiAgent stored and it cannot be renewed automatically. Common causes: the Facebook account that authorized this integration changed its password, removed MaiAgent's app permissions in Facebook settings, the authorization expired, or Meta reset the login state for security reasons. The system checks the authorization once a day and issues the announcement only when a renewal attempt fails, so the channel may stop replying first and the announcement arrives later

Go to Messaging Channels, delete this WhatsApp channel, then recreate it with the same phone number following Start Integrating. The announcement ends automatically after deletion

"WhatsApp registration was not completed. Please try again." appears after connecting

After authorization in the Meta window, the system did not receive the WhatsApp Business account to integrate (for example, no business account was selected in the Meta window), or MaiAgent failed while processing this authorization. If the Meta window is closed midway, the screen shows no message and simply stays on the original page

Click Connect WhatsApp again and complete the steps of selecting the business account and phone number in the Meta window; if the same message still appears on retry, contact customer support

The Select phone number dropdown is empty

The selected WhatsApp Business account has no phone numbers yet

In Meta's WhatsApp management tools, add and verify a phone number for this business account, or add a number directly in the Meta authorization window; then click Reload at the top right to authorize again

"WhatsApp phone number registration failed." appears when saving

Meta refused to let this number start using the WhatsApp Cloud API, for example because the number has not completed verification, or a two-step verification PIN has been set in Meta. For a number in use by the WhatsApp Business App, the system may have failed to check the number's status with Meta at that moment and mistakenly taken the registration steps for a regular number

Regular number: in Meta's WhatsApp management tools, confirm the number has completed verification; if two-step verification is set, turn it off and save again. Number in use by the WhatsApp Business App: turning off two-step verification does not help; please save again a little later

"This WhatsApp phone number is already in use." appears when saving

This phone number is already integrated with another WhatsApp channel (possibly in another organization), and one number can be integrated with only one channel

First delete the WhatsApp channel that currently uses this number (if it is in another organization, contact that organization's administrator), then create it again

Last updated

Was this helpful?