Let your AI agent take actions
Give your AI agent functions to look up an order, book a slot or return fixed information during a conversation.
A function is something your AI agent can do mid-conversation, such as checking an order’s status in your own system. You create a function once, then switch it on for any AI agent.
Before you start
- For a webhook function: a web address (API) of your own system that answers over HTTPS with JSON.
Create a function
Section titled “Create a function”-
Go to AI Agents›Custom Functions and click New Function.
-
Type a Function Name in lowercase with underscores, such as
check_order_status. -
Write a Description that tells the AI agent exactly when to use it, such as “Use when the customer asks where their order is.”
-
Choose a Function Type:
- Static Data: returns fixed text you write under Response Data, such as your returns policy.
- Webhook (External API): calls your system. Enter the Endpoint URL, choose the HTTP Method, and add any Headers your system needs, such as an authorisation key. Header values are stored securely and never shown again.
-
Under Parameters, click Add Parameter for each piece of information the AI agent must get from the customer first, such as
order_id. Give each a Type and a Description. To put a parameter in the address, write it in braces:https://api.example.com/orders/{{order_id}}. -
For a webhook, click Test Webhook to check your system answers. The test uses sample values.
-
Click Add Function.
You should see ”Custom function created successfully!” and the function on the page.
Switch it on for an AI agent
Section titled “Switch it on for an AI agent”- Go to AI Agents and open the AI agent.
- Open the Actions tab, click the functions it may use, and click Save.
Try it on the Test tab: the answer’s Tool calls show what the function did. See Test your AI agent.
Good to know
Section titled “Good to know”- Your system has up to 10 seconds to answer (5 by default; set Timeout (seconds)). The AI agent reads up to 10 KB of the answer.
- An AI agent can have up to 20 functions.
- A function in use can’t be deleted. Switch it off on each AI agent first.
- Changing a function changes it for every AI agent that uses it.
- To see who changed a function, click History on its card.