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

# Alerts

> Manage project alerts from the terminal with the Formo CLI. Create, list, update, delete, and toggle alerts that notify you of key events and thresholds.

The `formo alerts` command group lets you manage project alerts. Alerts notify you when specific events or thresholds are triggered.

## `formo alerts list`

List all alerts for the project.

<Note>
  Requires `alerts:read` scope on your API key.
</Note>

```bash theme={null}
formo alerts list
```

***

## `formo alerts get`

Get a single alert by ID.

<Note>
  Requires `alerts:read` scope on your API key.
</Note>

### Arguments

| Argument  | Type     | Required | Description |
| --------- | -------- | -------- | ----------- |
| `alertId` | `string` | ✅        | Alert ID    |

```bash theme={null}
formo alerts get alert_abc123
```

***

## `formo alerts create`

Create a new project alert.

<Note>
  Requires `alerts:write` scope on your API key.
</Note>

### Options

| Option              | Type     | Required | Description                              |
| ------------------- | -------- | -------- | ---------------------------------------- |
| `--name`            | `string` | ✅        | Alert name                               |
| `--trigger-type`    | `string` | ✅        | Trigger type (e.g. `event`, `threshold`) |
| `--trigger-filters` | `string` | ❌        | JSON array of trigger filter objects     |
| `--recipient`       | `string` | ❌        | JSON array of recipient objects          |
| `--secret`          | `string` | ❌        | Webhook secret for the alert             |

### Examples

```bash theme={null}
# Create a basic event alert
formo alerts create --name "High value tx" --trigger-type event

# Create an alert with trigger filters and recipients
formo alerts create \
  --name "Whale activity" \
  --trigger-type threshold \
  --trigger-filters '[{"field":"net_worth_usd","op":"gt","value":100000}]' \
  --recipient '[{"type":"email","value":"team@example.com"}]'

# Create an alert with a webhook secret
formo alerts create \
  --name "Transaction webhook" \
  --trigger-type event \
  --secret "whsec_abc123"
```

***

## `formo alerts update`

Update an existing alert.

<Note>
  Requires `alerts:write` scope on your API key.
</Note>

### Arguments

| Argument  | Type     | Required | Description        |
| --------- | -------- | -------- | ------------------ |
| `alertId` | `string` | ✅        | Alert ID to update |

### Options

| Option              | Type     | Required | Description                          |
| ------------------- | -------- | -------- | ------------------------------------ |
| `--name`            | `string` | ❌        | Alert name                           |
| `--trigger-type`    | `string` | ❌        | Trigger type                         |
| `--trigger-filters` | `string` | ❌        | JSON array of trigger filter objects |
| `--recipient`       | `string` | ❌        | JSON array of recipient objects      |
| `--secret`          | `string` | ❌        | Webhook secret for the alert         |

### Examples

```bash theme={null}
# Update an alert name
formo alerts update alert_abc123 --name "Renamed alert" --trigger-type event

# Update alert with new recipients
formo alerts update alert_abc123 \
  --name "Updated alert" \
  --trigger-type threshold \
  --recipient '[{"type":"slack","value":"#alerts"}]'
```

***

## `formo alerts delete`

Delete an alert.

<Note>
  Requires `alerts:write` scope on your API key.
</Note>

### Arguments

| Argument  | Type     | Required | Description        |
| --------- | -------- | -------- | ------------------ |
| `alertId` | `string` | ✅        | Alert ID to delete |

```bash theme={null}
formo alerts delete alert_abc123
```

<Warning>
  Deleting an alert is permanent.
</Warning>

***

## `formo alerts toggle`

Toggle an alert's status between `active` and `paused`.

<Note>
  Requires `alerts:write` scope on your API key.
</Note>

### Arguments

| Argument  | Type     | Required | Description        |
| --------- | -------- | -------- | ------------------ |
| `alertId` | `string` | ✅        | Alert ID to toggle |

### Options

| Option     | Type   | Required | Description                      |
| ---------- | ------ | -------- | -------------------------------- |
| `--status` | `enum` | ✅        | New status: `active` or `paused` |

### Examples

```bash theme={null}
# Pause an alert
formo alerts toggle alert_abc123 --status paused

# Re-activate an alert
formo alerts toggle alert_abc123 --status active
```
