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

# Start an automation from your site or app

> Your site, app, a tool or an AI agent sends an event. The automation starts, and every value of the event is ready to use in its messages.

Someone fills in the contact form on your site. Your site sends this to Minimo:

```bash theme={null}
curl -X POST https://api.minimo.it/public/v1/events \
  -H "Authorization: Bearer YOUR_MINIMO_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "new lead",
    "email": "giulia@example.com",
    "payload": {
      "contact_name": "Giulia Rossi",
      "contact_email": "giulia@example.com",
      "message": "Do you deliver to Milan?",
      "quote": { "total": 1250 }
    }
  }'
```

The automation that starts on **new lead** runs for Giulia. In its emails, `{EVENT_CONTACT_NAME}` becomes
"Giulia Rossi".

## Set it up

**1. Pick the trigger**

In **Automations → Create new automation**, choose the trigger **Event received**.

**2. Name the event**

For example `new lead`. Use the same name in the call. Capital letters and extra spaces don't matter
("New lead" is "new lead"). Allowed: letters, digits, spaces and `. _ : -`.

**3. Copy the call**

Open **Send this event** in the trigger panel. Two ways:

* **Copy prompt**: paste it to your AI agent (Claude, ChatGPT, Codex). It adds the call to your site or app.
* **Copy curl**: the ready call, to run or to paste into a tool such as Zapier or Make (their HTTP / webhook step).

The first copy creates an API key that can only send events (valid one year) and puts it in the copied text.
It is never shown on screen.

**4. Send one event**

The panel shows **Last event** with every value it carried and the tag of each value.

**5. Write the messages**

Add your email or SMS steps and use the tags. Then **Save and publish**.

## What the event contains

| Field | |
| - | - |
| `event` | The name of the event. Required. |
| `email`, `phone` or `contactId` | Who it is about. One is required. |
| `payload` | Any JSON object, up to 64 KB. Nested objects and lists are fine. |
| `firstName`, `lastName` | Optional. Filled on the contact only if it has no name yet. |

Minimo answers `202`. `"status": "no_automation"` means no published automation listens to this name yet.
From a form in the browser, the key can go in the URL as `?api_key=`. Every field: [Send Event](https://docs.minimo.it/api-reference/embedded/events/send-event.md).

## Every value is a tag

Each value of `payload` becomes a tag: `EVENT_` plus its path in capitals. A dot, and every character that is
not a letter, a digit or `_`, becomes `_`.

| In the event | Tag | In the email |
| - | - | - |
| `contact_name` | `{EVENT_CONTACT_NAME}` | Giulia Rossi |
| `contact_email` | `{EVENT_CONTACT_EMAIL}` | [giulia@example.com](mailto:giulia@example.com) |
| `message` | `{EVENT_MESSAGE}` | Do you deliver to Milan? |
| `quote.total` | `{EVENT_QUOTE_TOTAL}` | 1250 |

* **No setup.** The tags work in the emails and SMS of this automation right away.
* **Lists too.** `items.0.name` becomes `{EVENT_ITEMS_0_NAME}`. Up to 200 values per event.
* **Not stored.** The values live only in this run of the automation. To keep one on the contact, click
  **Save to contact** next to it in the trigger panel and pick a contact field. A value missing from an event never
  empties the field.
* **WhatsApp templates** take their variables from contact fields: save the value to the contact first, then pick
  that field.

## New people become contacts

The switch **Create the contact if it doesn't exist** is on by default. When no contact has the event's email or
phone, Minimo creates one. Turn it off and this automation ignores events about people who are not in your contacts.

## Notify your team when someone fills in your contact form

Your form sends the `new lead` event above. The automation emails your team with everything in it.

**1. Add an email step**

In **Send to**, pick **Fixed email addresses** and add your team (1 to 10 addresses). Each address gets its own
copy. These addresses never become contacts.

**2. Put every value in the body**

Nobody has to open anything to read the request:

```text theme={null}
New request from the website
Name: {EVENT_CONTACT_NAME}
Email: {EVENT_CONTACT_EMAIL}
Message: {EVENT_MESSAGE}
```

**3. Add a Reply button**

Add a button **Reply** with the link `mailto:{EVENT_CONTACT_EMAIL}`. A click opens a new email already addressed
to the lead.

**4. Make it Utility**

Set the email's category pill to **Utility**, not Marketing. A Marketing email gets an unsubscribe link, goes from
your marketing domain, and is skipped for an address saved as a contact without marketing consent.

> [!WARNING]
>
> Pressing **Reply** in the mail program answers your own reply address, not the lead. To answer the lead, use the
> **Reply** button in the email. See [Where replies to your emails go](https://docs.minimo.it/product/messaging/replies.md).

> [!TIP]
>
> Contact fields such as `{EMAIL}` show the contact who started the automation (here, the lead), not the team member
> who receives the email.


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