# molted alerts

Source: https://molted.email/docs/cli/alerts

Manage alert destinations

| Command | Description |
| - | - |
| [`molted alerts destinations list`](#molted-alerts-destinations-list) | List all alert destinations |
| [`molted alerts destinations create`](#molted-alerts-destinations-create) | Create an alert destination |
| [`molted alerts destinations delete`](#molted-alerts-destinations-delete) | Delete an alert destination (in an enforce workspace only the key that created it can; otherwise a person does it) |
| [`molted alerts destinations test`](#molted-alerts-destinations-test) | Send a clearly-labelled test alert to a destination |
| [`molted alerts destinations deliveries`](#molted-alerts-destinations-deliveries) | List recent delivery attempts for an alert destination |

## Agent context

Alert destinations define where Molted sends a notification when one of the workspace's alert conditions (the ones `molted overrides alerts` reports: stale or old review-queue items, send failures, policy blocks, bounce rate, complaints, SLA breaches) reaches warning or critical.

### Supported destination types

- webhook - HTTP endpoint that receives a JSON POST ("event": "alert.fired", with severity and the firing conditions)
- slack - Slack incoming webhook URL

### Create a webhook destination

```bash
molted alerts destinations create --type webhook --url https://example.com/hooks/molted
# → every alert notification will POST to this URL
```

### Create a Slack destination

```bash
molted alerts destinations create --type slack --url https://hooks.slack.com/services/T.../B.../xxx
```

### List all destinations

```bash
molted alerts destinations list
```

### Delete a destination

```bash
molted alerts destinations delete <id>
```

Send a test alert to a destination (bypasses the notification cooldown, clearly labelled as a test so it can't be mistaken for a real alert; at most one test per destination every 30 seconds by default, else 429 "rate\_limited"):

```bash
molted alerts destinations test <id>
# → { "success": true, "responseCode": 200, "error": null, "deliveryId": "..." }
```

List recent delivery attempts for a destination (the 50 most recent: success/failure, response code, error, whether it was a test, timestamp):

```bash
molted alerts destinations deliveries <id>
```

Alerts evaluate on a schedule (about every minute, for every workspace with an active destination), not just when something calls "molted overrides alerts". A destination is notified when the set of firing conditions changes, and again every 24 hours while the same conditions keep firing; there is no separate "recovered" notification.

Needs a workspace key (admin, or all mailboxes); creating, deleting and testing need manage scope.

Related: [`molted domains`](https://molted.email/docs/cli/domains.md), [`molted analytics`](https://molted.email/docs/cli/analytics.md)

## Commands

### molted alerts destinations list

List all alert destinations

```bash
molted alerts destinations list
```

### molted alerts destinations create

Create an alert destination

```bash
molted alerts destinations create [options]
```

| Option | Description | Default |
| - | - | - |
| `--type <type>` | Destination type (required; one of: webhook, slack) | |
| `--url <url>` | Destination URL (required) (required) | |

### molted alerts destinations delete

Delete an alert destination (in an enforce workspace only the key that created it can; otherwise a person does it)

```bash
molted alerts destinations delete <id>
```

| Argument | Description | Required |
| - | - | - |
| `<id>` | | yes |

### molted alerts destinations test

Send a clearly-labelled test alert to a destination

```bash
molted alerts destinations test <id>
```

| Argument | Description | Required |
| - | - | - |
| `<id>` | | yes |

### molted alerts destinations deliveries

List recent delivery attempts for an alert destination

```bash
molted alerts destinations deliveries <id>
```

| Argument | Description | Required |
| - | - | - |
| `<id>` | | yes |

See [CLI overview](https://molted.email/docs/cli.md) for global options, credentials and output format.
