# reveata alerts

> Create, change, test and delete traffic and revenue alerts and scheduled reports, and read their history, from the command line.

`reveata alerts` manages the same [alerts](https://reveata.com/docs/alerts) as **Settings → Alerts**: traffic spikes and drops, new payments, revenue and goal thresholds, new referrers, and the weekly and monthly reports. Reading needs `alerts:read`; changing needs `alerts:write` and the editor role. Payment and revenue alerts are hidden from viewers who may not see revenue.

Alert types: `traffic_spike`, `traffic_drop`, `new_payment`, `revenue_threshold`, `goal_threshold`, `new_referrer`, `weekly_summary`, `monthly_summary`. Money thresholds are in minor units (cents) of the website currency. Without other recipients, the email goes to you. `--data` takes any other field of the API body, for example `'{"channels":{"email":{"recipientUserIds":["…"]}}}'`.

`reveata alerts test` sends a test through every enabled channel: reports send the real report, other alerts a plain test message. Deleting needs `--yes`.

### `reveata alerts list`

Traffic and revenue alerts, and the weekly and monthly reports.

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)

Calls [`GET /api/v1/websites/{website}/alerts`](https://reveata.com/api-reference/list-alerts) (`alerts:read`).

```bash
reveata alerts list --site example.com
```

### `reveata alerts get <alertId>`

One alert with its condition and channels.

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)

Calls [`GET /api/v1/websites/{website}/alerts/{alertId}`](https://reveata.com/api-reference/get-alert) (`alerts:read`).

```bash
reveata alerts get 6710a4c2e4b0a1b2c3d4e5f6 --site example.com
```

### `reveata alerts create <type>`

Create an alert or a scheduled report (editor role).

Types: traffic_spike, traffic_drop, new_payment, revenue_threshold, goal_threshold, new_referrer, weekly_summary, monthly_summary. Money thresholds are minor units (cents). Email goes to you unless --data sets channels.email.recipientUserIds.

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `--name <name>`: Display name
- `--enabled <true|false>`: Turn it on (true) or off (false)
- `--threshold <n>`: Alert threshold (visitors or completions; money in minor units)
- `--percent-change <n>`: Alert on a change of this many percent against a week earlier
- `--window-minutes <n>`: Alert evaluation window in minutes (5 to 10080)
- `--goal <name>`: Goal name, e.g. signup
- `--slack-webhook <url>`: Slack incoming webhook URL for the alert
- `--discord-webhook <url>`: Discord webhook URL for the alert
- `--data <json>`: More request fields as a JSON object (merged into the body)

Calls [`POST /api/v1/websites/{website}/alerts`](https://reveata.com/api-reference/create-alert) (`alerts:write`).

```bash
reveata alerts create traffic_spike --site example.com --threshold 500
reveata alerts create goal_threshold --site example.com --goal signup --threshold 10 --window-minutes 60
reveata alerts create new_payment --site example.com --slack-webhook https://hooks.slack.com/services/…
```

### `reveata alerts update <alertId>`

Rename, pause or change an alert (editor role).

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `--name <name>`: Display name
- `--enabled <true|false>`: Turn it on (true) or off (false)
- `--threshold <n>`: Alert threshold (visitors or completions; money in minor units)
- `--percent-change <n>`: Alert on a change of this many percent against a week earlier
- `--window-minutes <n>`: Alert evaluation window in minutes (5 to 10080)
- `--goal <name>`: Goal name, e.g. signup
- `--slack-webhook <url>`: Slack incoming webhook URL for the alert
- `--discord-webhook <url>`: Discord webhook URL for the alert
- `--data <json>`: More request fields as a JSON object (merged into the body)

Calls [`PATCH /api/v1/websites/{website}/alerts/{alertId}`](https://reveata.com/api-reference/update-alert) (`alerts:write`).

```bash
reveata alerts update 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --enabled false
reveata alerts update 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --threshold 1000
```

### `reveata alerts delete <alertId>`

Delete an alert and its history (editor role).

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `-y, --yes`: Confirm a delete, revoke, roll or removal (required; nothing is asked)

Calls [`DELETE /api/v1/websites/{website}/alerts/{alertId}`](https://reveata.com/api-reference/delete-alert) (`alerts:write`).

```bash
reveata alerts delete 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --yes
```

### `reveata alerts test <alertId>`

Send a test through every enabled channel of an alert.

Weekly and monthly reports send the real report; other alerts send a plain test message.

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)

Calls [`POST /api/v1/websites/{website}/alerts/{alertId}/test`](https://reveata.com/api-reference/test-alert) (`alerts:write`).

```bash
reveata alerts test 6710a4c2e4b0a1b2c3d4e5f6 --site example.com
```

### `reveata alerts history [alertId]`

When alerts fired and how each delivery went.

Newest first. Pass an alert id for one alert. Follows pagination up to --limit (50).

Options:

- `--site <id|domain>`: Website id or domain (defaults to REVEATA_SITE, or a site key’s own website)
- `--limit <n>`: Maximum number of rows

Calls [`GET /api/v1/websites/{website}/alerts/history`](https://reveata.com/api-reference/list-alert-history) (`alerts:read`).

```bash
reveata alerts history --site example.com
reveata alerts history 6710a4c2e4b0a1b2c3d4e5f6 --site example.com --json
```
