Summary
Want to deploy your own custom AI agent on Wati? With the Connect AI Agents feature, you can integrate your AI agent directly into Wati as an custom AI agent. This allows your agent to work alongside your human operators - receiving, responding to, and managing customer conversations just like a member of your team.
Note:
The Connect AI Agents feature is offered as a paid add-on ($100 USD/month) for Wati customers.
If you’re already using Astra and want to connect it with Wati via Connect AI Agents, the add-on is not required. You only need to be on Wati’s Pro or Business plan to enable this integration.
Tip: You can find it under Settings > User Management page in Wati!
Instructions
Follow this guide to understand how your AI agent can send and receive messages, manage chat context, and interact with Wati using APIs.
Add your AI agent to Wati
You can register your AI agent as an Custom AI Agent in Wati. Once added, your agent will receive a dedicated access token that allows it to interact with Wati’s public APIs - such as sending messages, updating contacts, or resolving chats.
Your Custom AI Agent will appear in the Team inbox operator list, and you can assign conversations to it manually or through Wati automations.
For example, you can create an automation rule to assign all new chats to your Custom AI Agent automatically.
How your AI agent receives customer messages
To receive messages, provide a webhook URL to Wati. Wati will push relevant message events to your AI agent through this webhook.
Your AI agent won’t be overwhelmed with unnecessary data - Wati only sends events from conversations assigned specifically to your AI agent. Conversations handled by human operators won’t trigger webhook events for your agent.
Supported webhook events
Currently, your AI agent can receive 2 types of webhook events:
Chat Assigned – Triggered when a chat is assigned to your AI agent.
Assigned Message Received - Triggered when there is a new incoming message for conversations that are assigned to your AI Agent.
How your AI agent can respond to customers
Once your agent is registered, a dedicated access token will be generated. You can use this dedicated access token with Wati’s public APIs to send messages, update contact information, or manage chat statuses.
You can find the full list of APIs in the Wati API documentation.
Here are the most commonly used endpoints to get started:
/sendSessionMessageSend a message response to a customer.
/getContactsRetrieve contact details (such as phone number and custom attributes) when a conversation is assigned to your AI agent.
/updateContactAttributesStore new information gathered during a conversation as contact attributes in Wati.
/updateChatStatusUpdate the chat status once your AI agent resolves a conversation.
/assignOperatorReassign a chat to a human operator if your AI agent cannot handle it.
Accessing conversation history
When your AI agent is assigned to a chat, it can retrieve the historical context using the /getMessages API endpoint. This helps your AI generate more accurate and contextual responses based on both past and recent messages.
Handling media messages
If a customer sends an image, document, or voice note, Wati will include a filename in the webhook event. Your AI agent can use the /getMedia API to download the file and process it accordingly.
Where to find your Custom AI Agent
After setup, your Custom AI Agent appears in the Team inbox operator list, where it can be assigned chats just like any other team member.
You can also use Wati automations to route messages automatically to your Custom AI Agent.
Frequently Asked Questions (FAQs)
Overview
1. What is the Connect AI Agents feature in Wati?
The Connect AI Agents feature allows you to integrate your own custom AI agent into Wati. The AI agent can work alongside human operators by receiving, responding to, and managing customer conversations within Wati.
2. Is the Connect AI Agents feature included in Wati plans?
No. The Connect AI Agents feature is available as a paid add-on that costs $100 USD per month. However, if you are already using Astra, the add-on is not required. You only need to be on Wati’s Pro or Business plan to connect Astra with Wati through Connect AI Agents.
3. How do I add and assign a Custom AI Agent in Wati?
You can register your AI agent as a Custom AI Agent in Wati under Settings > User Management. After setup, the AI agent appears in the Team inbox operator list and can be assigned conversations manually or through Wati automations.
Receiving customer messages
4. How does a Custom AI Agent receive customer messages?
To receive customer messages, you must provide a webhook URL to Wati. Wati sends relevant message events to the AI agent through the webhook.
5. Which conversations trigger webhook events for a Custom AI Agent?
Wati only sends webhook events from conversations that are assigned to the Custom AI Agent. Conversations handled by human operators do not trigger webhook events for the AI agent.
6. Which webhook events are supported for Custom AI Agents?
Custom AI Agents can currently receive two webhook events:
Chat Assigned – Triggered when a chat is assigned to the AI agent.
Assigned Message Received – Triggered when a new incoming message is received in a conversation assigned to the AI agent.
Responding to customers and managing conversations
7. What can a Custom AI Agent do using Wati APIs?
A Custom AI Agent can use its dedicated access token to interact with Wati’s public APIs. It can send messages, retrieve contact information, update contact attributes, update chat statuses, reassign conversations to human operators, access conversation history, and download media files sent by customers.
8. How can a Custom AI Agent access conversation history?
When a Custom AI Agent is assigned to a chat, it can use the /getMessages API endpoint to retrieve historical conversation context. This helps the AI agent generate more accurate and contextual responses.
9. How can a Custom AI Agent handle media files sent by customers?
When a customer sends an image, document, or voice note, Wati includes the filename in the webhook event. The Custom AI Agent can then use the /getMedia API endpoint to download and process the media file.







