Summary
Want to deploy your own custom AI agent on Wati? With the Bring Your Own AI (BYOA) feature, you can integrate your AI agent directly into Wati as an AI operator. This allows your agent to work alongside your human operators - receiving, responding to, and managing customer conversations just like a member of your team.
Bring Your Own AI (BYOA) feature is currently in Beta and available as an add-on in the Wati's Business plan. Charges will apply once it is out of Beta.
You can find it under your 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 custom AI agent to Wati
You can register your AI agent as an AI operator 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 AI operator 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 AI operator 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:
/sendSessionMessage
Send a message response to a customer.
/getContacts
Retrieve contact details (such as phone number and custom attributes) when a conversation is assigned to your AI agent.
/updateContactAttributes
Store new information gathered during a conversation as contact attributes in Wati.
/updateChatStatus
Update the chat status once your AI agent resolves a conversation.
/assignOperator
Reassign 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 AI operator
After setup, your AI operator 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 AI operator.
Frequently Asked Questions (FAQs)
General questions
1. What is the Bring Your Own AI (BYOA) feature?
The Bring Your Own AI (BYOA) feature allows you to integrate your own custom AI agent into Wati as an AI operator. Once added, your AI agent can send and receive messages, manage chat context, and interact with Wati through public APIs.
2. Who can access the BYOA feature?
The BYOA feature is currently available as an add-on for users on Wati’s Business plan. It is in Beta, and charges will apply once it is officially released.
3. Where can I find the BYOA option in Wati?
You can find the Bring Your Own AI feature under your User Management page in Wati.
Setup and configuration
4. How do I add my custom AI agent to Wati?
You can register your AI agent as an AI operator in Wati. Once registered, it receives a dedicated access token to interact with Wati’s public APIs for tasks such as sending messages, updating contacts, and managing chat statuses.
5. How do I assign chats to my AI agent?
Your AI operator appears in the Team inbox operator list. You can assign chats manually or use Wati automation rules to assign conversations automatically.
Message and API handling
6. How does my AI agent receive customer messages?
Wati sends message events to your AI agent through a webhook URL you provide. Only conversations assigned to your AI agent trigger webhook events—chats handled by human operators are excluded.
7. What types of webhook events are supported?
Your AI agent can currently receive two types of webhook events:
Chat Assigned – Triggered when a chat is assigned to your AI agent.
Assigned Message Received – Triggered when a new message is received in a chat assigned to your AI agent.
8. How can my AI agent respond to customers and manage conversations?
Your AI agent can use Wati’s public APIs with its access token to send messages (/sendSessionMessage), retrieve contacts (/getContacts), update attributes (/updateContactAttributes), resolve chats (/updateChatStatus), or reassign them to human operators (/assignOperator).
9. How can my AI agent handle media and access chat history?
If a customer sends a file, Wati includes a filename in the webhook event. Your AI agent can use the /getMedia API to download it. For past messages, it can use /getMessages to access chat history and maintain context.
Automation and team management
10. Can I automate chat routing to my AI operator?
Yes. You can use Wati’s automation rules to automatically route new or specific chats to your AI operator, just like assigning chats to any other team member.