Advanced Features
AI Actions
AI Actions transforms your chatbot into an intelligent agent capable of performing actions through API calls. This enables the agent to perform various tasks such as subscription management, shipment tracking, appointment scheduling, and more. The process works in three simple steps:
- Configure your API within Chat Data or choose from available pre-configured actions.
- Create a prompt that instructs the Agent about the appropriate timing and method for action execution.
- The AI Agent handles everything else, performing actions on behalf of your customers to deliver an exceptional experience. These actions can utilize internal APIs for application-specific functions or external APIs for business tools like ticketing systems, CRMs, e-commerce platforms, and various other services.
Setup your AI Actions
The AI Actions feature is available in all our paid plans. Based on your plan, Entry/Standard/Professional users can set up 1/3/5 actions per chatbot respectively. You can go to the https://www.chat-data.com/chatbot/{chatbotId}/settings/actions page to set up your AI Actions.
There are two common fields that you must add for all AI actions:
- Action Name: The name of the action must be in the format of a function name, using either camel case or snake case.
- Description: A clear description of what the action does and under what conditions the chatbot should trigger it.
Important Insight
To ensure reliable action triggering, if you notice the AI chatbot isn't executing actions as expected despite having a clear action description, consider adding the triggering conditions to the chatbot's base prompt. This additional configuration helps minimize unexpected behavior and enhances the accuracy and consistency of action execution.

What can AI Actions do?
With AI Actions, your bot goes beyond answering questions—it can now take on sales and support tasks to help you achieve your business goals. Here are some key highlights of what AI Actions can do:
- Trigger the lead form: Dynamically trigger the lead form based on user queries that meet your pre-defined conditions.
- Activate a custom button: Enable your bot to trigger custom link buttons, such as booking appointments or redirecting users to place an order.
- Search the web intelligently: Your chatbot can smartly decide when to perform a web search, generate relevant search queries, and fetch up-to-date information in real time.
- Connect with 834+ external apps via MCP: Integrate Model Context Protocol servers to extend your chatbot with tools from Gmail, Notion, Slack, GitHub, and hundreds more platforms.
- Act on your website with browser actions: Run JavaScript in the visitor's browser to read or change the page they are on, such as adding a product to their cart or applying a filter. See Browser Actions.
- Leverage the AI Actions API: While we provide a variety of default actions, the AI Actions API allows you to integrate your own custom actions. Connect your bot to any API that powers your business, enabling it to access real-time data and execute highly specific, tailored tasks.
- Send image/PDF documents: If your API response includes an image or file buffer, our AI chatbot can display the file or image directly in the conversation. This works across all platforms, including Widget, iframe, WhatsApp, Instagram, Messenger, Discord, and Slack.
Lead Form Action & Custom Button Action
You just need to fill in the description of when to trigger the action. When the conversation meets the prompt conditions set by you, the lead form or the custom button link will automatically be triggered on the chatbot widget or iframe. These two actions are only available in the Widget and iframe because they control the UI of the Chat Data website integration.
Lead Form Action Setting

Custom Button Action Setting

Web Search Action
The Web search action will generate a search query based on the intent of the whole conversation history. Then the chatbot will search Google and get the top 10 results. For each result, the chatbot will read the content on the websites of the top 10 pages and use this content as context information to substitute your training data to answer the question. The chatbot can provide the website sources of the searched pages as references if you have enabled the Show sources option in the Chatbot Interface setting. There are some additional settings you can configure for the Web Search Action:
Include images: This allows the chatbot to provide images as replies to the users elaborating the answer provided.
Included domains: This option allows you to add specific domains that the chatbot can use to search the answer. If you didn't add any domains, the chatbot will search over the whole web.

For example, in the picture below, the user wants to know the latest refinance rate in California. The chatbot will search Google, look for the refinance rate in the top result pages, and summarize the answer.

PDF Generation Action
With the PDF Generation Action, you create a PDF template which takes in an array of variables and the AI chatbot will generate the actual values for the variables and then fill the variables to replace the placeholders in the PDF template to generate the actual PDF file and send the PDF file directly to the user in the conversation.
How It Works
- Design Your Template – Use our rich text editor or modify existing templates.
- Define Variables – Set fields with descriptions for AI to fill dynamically.
- Preview & Generate – Click "Generate PDF" to instantly create a formatted document.template to generate the actual PDF file and send the PDF file.
- Seamless AI Execution – The chatbot gathers user details and automatically generates a personalized PDF in real time.
Use Case
You can use this feature to generate the PDF receipt, shipping confirmation, rental agreement, and more. We provided a list of templates for you to choose from.
Appointment Action
The Appointment Action enables your AI chatbot to automatically trigger appointment booking interfaces based on specific conditions defined in your base prompt. This powerful integration streamlines the scheduling process by allowing your chatbot to intelligently offer appointment booking options when appropriate.
Supported Platforms
The appointment action currently integrates with:
- Calendly: Full integration with booking modal
- Cal.com: Complete scheduling interface
This feature is currently available in web-based AI agents only (Widget and iframe integrations).
How It Works
- Setup: Create and configure the appointment action in your AI actions settings
- Integration: Connect it to your preferred scheduling platform (Calendly or Cal.com)
- Configuration: Define specific triggering conditions in your base prompt to control when and how the appointment UI appears
Base Prompt Configuration
You can precisely control when the appointment UI should be triggered by specifying conditions in your base prompt, such as:
- When specific topics are discussed
- At particular points in the conversation flow
- Under certain business conditions
- Based on user request patterns
Current Capabilities
- Web-based AI agent implementation
- Full-screen booking modal
- Direct integration with scheduling platforms
- Custom triggering conditions through base prompt

MCP Integration
Model Context Protocol (MCP) integration allows your chatbot to access 834 built-in applications with over 5,000 tools. This powerful feature enables your chatbot to automatically interact with external platforms and services during conversations.
With MCP integration, your chatbot can:
- Send and manage emails through Gmail
- Schedule meetings via Google Calendar
- Create and update documents in Notion
- Post messages to Slack channels
- Manage GitHub issues and pull requests
- Access hundreds of other productivity and communication tools
MCP actions work seamlessly with your chatbot's AI capabilities, allowing it to intelligently decide when to use specific tools based on the conversation context. Each MCP tool you enable counts as one AI action toward your quota.
Key Features:
- 834 Built-in Apps: Choose from a vast library of pre-configured MCP applications
- Custom MCP Servers: Add your own remote MCP servers for specialized integrations
- Secure Authentication: OAuth-based authentication ensures your credentials remain safe
- Granular Control: Select specific tools from each MCP server to optimize your quota usage
AI Actions — including MCP tools — can also be configured per AI Conversation node in the Workflow builder. This gives you granular, step-level control over which actions are available at each point in a multi-step workflow, with the ability to store action results to variables for use in later nodes. See the Workflow AI Actions documentation for details.
For detailed setup instructions, configuration options, and use cases, visit our comprehensive MCP Integration documentation.
With at least 2 MCP tools connected, you can switch the chatbot to AI Agent mode in Settings → Model: the agent chains your tools in the order a task needs, and up to 100 tools can be on regardless of your plan's AI action limit. Workflow actions are off while AI Agent mode is on.
AI Actions API
To create one, click Custom action and choose Our server. To run code on your website instead, choose Visitor's browser (see Browser Actions).
With the custom API action, you can create any API request to let the chatbot call your API with generated parameters or preset parameters. We support path parameters, query parameters, and body parameters with string, number, boolean, array, and object types. You have to validate the API action by submitting a real API request with example parameters first before saving it. The parameters can be static or non-static. If the parameter is static, we will use the example value given by you in the real API call. If the parameter is non-static, the chatbot will generate the parameter value dynamically based on the conversation history. It's suggested that you put the authentication token as a static parameter.
For example, below we want the chatbot to call https://finance.yahoo.com/quote/{symbol}/ to get the latest stock price of the given stock symbol. We set the symbol as the path parameter and the chatbot will generate the symbol based on the conversation history.

For example, in the picture below, the user wants to know Microsoft's stock price today, and the chatbot can smartly generate the symbol MSFT and call the API to get the stock price.

Files and images with API response
If your API response is a file or image buffer, the chatbot will display the file or image directly in the conversation. For example, you can use the 'application/pdf' content type to display a PDF file and the 'image/png' content type to display an image. The HIPAA document and the Chat Data Logo(https://www.chat-data.com/images/logo.png) have the example response type that your own API response should follow.

This works across all platforms, including Widget, iframe, WhatsApp, Instagram, Messenger, Discord, and Slack.
Website


Instagram & Messenger

Discord

Slack

You can see that our AI chatbot can not only generate responses based on the API call but can also display the files/images content directly on all platforms.
Browser Actions (Client-side AI Actions)
A browser action is a custom AI action whose function runs in the visitor's browser, on the page they are looking at, instead of on our server. Use it when the job needs something only that page has or can do: the visitor's cart, a form on the page, the current URL, a filter, or a page change.

- The visitor asks in the chat on your website.
- The model decides to call the action. Chat Data sends the call to the chatbot on that page, and your function runs there with the arguments the model generated.
- Your function's return value goes back to the model, which answers with what actually happened.
Server action or browser action?

The same chat, two places to do the work. A server action is for data your systems hold, such as an order's status from your order API. A browser action is for the page the visitor is on, such as the cart they are about to check out.
| Our server (API action) | Visitor's browser | |
|---|---|---|
| What runs | Our server calls your HTTP API | Your JavaScript on the visitor's page |
| What it can reach | Any API reachable from the internet | What the page can: its DOM, its JavaScript globals, same-origin requests with the visitor's session on your site |
| Secrets | Static parameters stay on our server | The code is public. Never put secrets in it |
| Where it works | Every channel | Your website: chat bubble, or iframe with the SDK |
| Test before saving | A real API call is required | Optional sandbox test (code written in the action) |
Choose Our server for anything that needs a secret or must happen even if the visitor leaves. Choose Visitor's browser for anything that reads or changes the page.
Create a browser action
- Go to Settings → Actions and click the Custom action card, or the Create custom action button.
- Under Where it runs, choose Visitor's browser. You choose this when creating the action; a saved action keeps where it runs.
- Name and purpose: the Action Name is the function name the model calls (letters, numbers,
_and-, no spaces). The Description tells the model what the action does and when to use it. - Inputs: add the parameters your code needs. They work like API action parameters: string, number, boolean, array and object types, nested objects and arrays of objects, required or optional, and static.
- Code: choose Write the code here or Register it on my website (see below).
- Test (code written in the action only), then save.
Parameter names must use only letters, numbers, _, . and - (up to 64 characters) and be unique at their level, since they become the keys of args. A static parameter is hidden from the model: its example value is always passed in args, the same way API actions handle static parameters.
Option A: write the code in the action
Write the body of an async function with this signature. You can use await, and you return the result:
async function (args, user, context) {
// your code
}
The code is checked for syntax errors when you save and can be up to 20,000 characters. We load it onto every page where your chatbot runs, the first time the action is called on that page, so there is nothing to deploy. If your site uses a Content Security Policy, the domain that serves the chatbot must be allowed in script-src, as it already is for the chat bubble.
Example: an add_to_cart action for a Shopify store, with a required variant_id (number) parameter and an optional quantity (number) parameter. It uses Shopify's Cart AJAX API, which runs with the visitor's own cart:
const response = await fetch('/cart/add.js', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
items: [{ id: args.variant_id, quantity: args.quantity || 1 }],
}),
})
if (!response.ok) {
return { status: 'error', error: `Shopify returned ${response.status}` }
}
const cart = await (await fetch('/cart.js')).json()
return { itemCount: cart.item_count, total: cart.total_price / 100 }
Option B: register the function on your website
If the function already lives in your site's code, register it with the Chat Data SDK. The editor shows this snippet with your chatbot id and the action name filled in:
<script src="https://www.chat-data.com/chatbotsdk.min.js" data-chatbot-id="YOUR_CHATBOT_ID"></script>
<script>
window.chatbot.registerTools({
add_to_cart: async (args, user, context) => {
// Your code. Return a JSON-serializable value, or
// { status: 'error', error: 'message' } to report a failure.
return { ok: true }
},
})
</script>
- Add the SDK tag even if you installed the chat bubble. The bubble does not define
window.chatbot, and the SDK tag does not add a second chat widget. - The key must match the Action Name exactly. If you rename the action, update the snippet.
- The chatbot offers the action only on pages that registered it. On other pages the model never sees it.
- You can register at any time, including after the page has loaded. Calling
registerToolsagain adds to the registered functions and replaces a function with the same name; passingnullfor a name removes it. - If a page registers a function under the same name as an action whose code was written in the dashboard, the registered function runs.
The arguments your function receives
args: an object with the parameter values the model generated, plus your static parameters.user: the visitor information your site sent withwindow.chatbot.sendUserInfo, ornullif none was sent.context:{ chatbotId, conversationId, pageUrl }.
What to return
- Any JSON-serializable value (object, array, string, number, boolean or
null) is a success, and the model receives it. Returning nothing sendsnull. { status: 'success', data }is also a success; the model receivesdata.{ status: 'error', error: 'message' }, or throwing an error, reports a failure. The model is told the action could not be completed and why, and must not claim it succeeded.
Keep results small and to the point: the result must be under 64 KB, and values that can't be turned into JSON (DOM elements, functions, circular objects) are rejected.
Timeouts and unknown outcomes
Each call has 30 seconds to return. A function on a web page cannot be cancelled, so when the result is lost the action may still have run. In these cases the model is told the outcome is unknown, and it tells the visitor it could not confirm the action rather than claiming success or failure:
- the function did not return within 30 seconds;
- the result was over 64 KB or could not be turned into JSON;
- the visitor left the page after the call was sent.
A full page load ends the chat on that page, so an action that navigates (for example window.location.href = ...) usually ends with an unknown outcome. Prefer your site's client-side routing, or return the result first and navigate after a short delay.
Where browser actions work
A browser action is offered to the model only when it can actually run:
- Channels: your website, through the chat bubble, or the iframe with the Chat Data SDK on the same page. It is not offered over the API, on messaging channels (WhatsApp, Messenger, Instagram, Slack and others), on phone calls, or in a plain iframe without the SDK.
- Modes: standard chat, AI Agent mode, and the AI Conversation and AI Agent nodes of workflows. A node with Silent Reply does not offer browser actions, because there is no visitor reply to carry the call.
- Not in the dashboard: the Playground and Workflow Studio do not run browser actions, so test them on your website.
On pages of the Chat Data app itself, browser actions never run.
Testing and debugging
- Sandbox test: for code written in the action, the Test step runs it with sample arguments in an isolated sandbox. The sandbox is not your website:
userandcontext.pageUrlarenull, and code that relies on your page (its DOM, cart or globals) will behave differently there. - On your website: open a page with your chatbot, ask a question that should trigger the action, and check that the page changed.
- Debug: in a conversation's Debug view, each browser action call appears with a client badge, its arguments, its outcome and how long it took.
Security
- Everything in the code is public. Every visitor's browser downloads it, so never put API keys, tokens or passwords in it, or in static parameters. Use a server action for anything secret.
- Treat
argsas untrusted input. The model generates them from the conversation, so validate them as you would form input before acting on them. - Editing or removing the code does not unpublish copies that browsers already downloaded. If a secret was ever saved in an action, rotate it.
Frequently Asked Questions
What are AI Actions in Chat Data?
AI Actions turn the chatbot into an agent that can perform API-driven tasks instead of only answering questions. the general flow is to configure an action, instruct the bot through prompts when to use it, and then let the AI agent execute the action on behalf of the user.
How do I set up AI Actions for a chatbot?
The setup page for AI Actions is `https://www.chat-data.com/chatbot/{chatbotId}/settings/actions`. The guide says every action needs at least two common fields: an `Action Name` written like a function name and a clear `Description` that explains what the action does and when the chatbot should trigger it.
What kinds of tasks can AI Actions handle?
Several categories of actions, including triggering lead forms, activating custom buttons, running web searches, connecting to 834+ apps through MCP, calling custom APIs, generating PDFs, booking appointments, and returning image or PDF files directly inside the conversation. AI Actions can also be configured per workflow node for multi-step automation with variable chaining.
Can an AI Action run JavaScript on my website?
Yes. Create a Custom action and choose Visitor's browser. Either write the code in the action and Chat Data loads it onto every page where your chatbot runs, or register a function on your site with window.chatbot.registerTools. The function receives args, user and context, and its return value goes back to the model. Browser actions run only on your website (chat bubble, or iframe with the SDK), not over the API or messaging channels, and their code is public, so never put secrets in it.