# Custom actions

> Connect your agent to your own API so it can look up orders, bookings and accounts.

Source: https://askmavis.co/help/custom-actions  
Collection: Actions and procedures  
Last updated: 2026-12-05

A Custom Action lets your AI agent call your own API during a chat, for example to look up an order status or a booking. Custom actions are on paid plans.

## Before you start

You need an API endpoint that accepts an HTTPS request and returns JSON.

## Set up a custom action

1. Open your agent, go to **Actions** and add a **Custom Action**.
2. Give it a **Name** and describe **When to use** it.
3. Under **Inputs the AI collects**, add what the agent should ask the visitor for, like an order number. Give each a name, type and what to ask for.
4. Set the **Method** and **URL**. Use inputs in the URL, **Query parameters**, **Headers** or **JSON body**, like `{order_number}`.
5. Store API keys as a **Secret**. Secrets are stored encrypted and never shown to the AI.
6. Choose **What the AI can see**: **Only the fields I pick** (recommended) or **The full response**.
7. Click **Send test request** to check it works and to list the fields you can pick.
8. Save, then publish your agent.

## Who can run it

**Who can run this** decides who the action runs for:

- **Anyone:** any visitor can trigger it.
- **Signed-in visitors only:** only visitors your website has signed in with identity verification. Anonymous visitors are offered a handoff to your team instead.

If an input is typed by the visitor, like an email or order number, someone could guess another person's value and read their record. For anything private, choose **Signed-in visitors only**, or make sure the API returns nothing private.

Contact values, like the signed-in visitor's email, only come from verified visitors. An action that uses them can only run for signed-in visitors. See [Sign in your visitors](https://askmavis.co/help/identity-verification).

## Check a detail

**Check a detail** stops anyone reading another person's record by guessing a number. Choose an input the visitor gives, like **email**, and the field in your API's answer that must hold the same value, like `billing.email`. The AI agent only sees the answer when the two match, ignoring capital letters and spaces. When they don't, it answers exactly as if there were no record.

## Example response

Add an **Example response** to use while your API isn't ready. Tests also use it.

## Related

- [What actions do](https://askmavis.co/help/actions-overview)
- [Procedures](https://askmavis.co/help/procedures)
