# Make an automation

When something happens, send an email, a Slack message or a webhook.

1. Open **Automations** and choose a trigger.
2. Add filters if you want, such as amount at least 100000 cents.
3. Choose what to do. Email goes only to people in your team.
4. Press **Test**.
5. Turn it on.

With the API it is the same order: make it with `POST /automations`, test it with `POST /automations/{id}/test`, then send `PATCH /automations/{id}` with `"enabled": true`. Turning it on before the test gives `invalid_field`.

## Triggers

| Trigger | API name |
|---|---|
| Someone clicked a link | `link.clicked` |
| A new person showed up | `person.created` |
| A person became hot | `person.became_hot` |
| A form was sent | `form.sent` |
| A call was booked | `booking.created` |
| A booking was canceled | `booking.canceled` |
| A sale was made | `sale.created` |
| A sale was refunded | `sale.refunded` |
| Credit changed | `credit.changed` |
| Tracking broke | `health.broken` |
| Tracking was fixed | `health.fixed` |

## When sending fails

We try again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours. After that it is marked failed, and you can retry it by hand. After 20 failures in a row we turn the automation off and email the owner.
