> ## Documentation Index
> Fetch the complete documentation index at: https://docs.molin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom actions

> Let your AI take real actions in your business: issue coupons, book callbacks, look up orders, and anything else you connect to it.

Custom actions let your AI do real things during a chat, not just answer questions. You set up an action in the dashboard, connect it to your own system, and the AI uses it when a customer needs it.

This part needs a developer on your side because you (or someone on your team) needs to build the endpoint that the AI calls.

<Note>Find it in your dashboard under [**Chatbot → Actions**](https://molin.ai/app/actions).</Note>

## Examples

* Give a discount code when a customer asks for one.
* Look up an order by email and order number.
* Send a callback request to your CRM or Slack.
* Check if something is in stock in your warehouse system.
* Cancel or change an order.
* Add the customer to your newsletter list (Klaviyo, Mailchimp, etc).

## How it works

1. You set up the action in the dashboard: a name, a description, the info the AI should collect (for example, the customer’s email or an order number), and whether your endpoint expects a POST or GET request.
2. The AI decides when to use the action based on the description you wrote.
3. Molin calls your endpoint with that info, as a JSON body for POST or as query params/URL segments for GET.
4. Your endpoint sends back a short answer.
5. The AI uses the answer to reply to the customer.

```mermaid theme={null}
sequenceDiagram
  Customer->>Molin AI: "Where is order #1234?"
  Molin AI->>Your API: POST /lookup-order { orderNumber: "1234" }
  Your API->>Molin AI: { status: "Shipped", eta: "Tomorrow" }
  Molin AI->>Customer: "Your order shipped and arrives tomorrow."
```

<Tip>The action description is what the AI reads to decide *when* to use it. Be specific. Write "Look up an order status when the customer asks about delivery" instead of just "Order lookup".</Tip>

## Setup

See the [Custom actions API reference](/apis/custom-actions) for the full request/response spec, security headers, and code examples.

## Best practices

* **One action, one job.** Set up a separate action for each task instead of one big one that does everything.
* **Send back short, clear text** from your endpoint. The AI will turn it into a reply to the customer.
* **Don’t send sensitive info back.** The customer might see it in the answer.
* **Test it in the chat preview** before turning it on for real customers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.