# l4 alerts delete

> Delete a cost alert and the history of everything it said. Pause it instead to keep that history.

Source: https://docs.levelfour.ai/cli/commands/alerts/delete


`l4 alerts delete` deletes a cost alert, along with every firing and recovery it recorded. Nothing brings either back. To stop an alert's notifications and keep its history, [pause it](/cli/commands/alerts#pause-and-resume) instead.

```bash
l4 alerts delete <id> [--yes]
```

## Flags

| Flag          | Description                  |
| ------------- | ---------------------------- |
| `-y`, `--yes` | Skip the confirmation prompt |

## Confirmation

At a terminal, the command asks `Delete cost alert <id> and its history? [y/N]`. Anything other than `y` or `yes` aborts, prints `Aborted.`, and exits `0` without calling the API.

> **Warning**
>
> Outside a terminal there is nobody to answer the prompt, so a piped or scheduled run without `--yes` exits `1` with `deleting <id> outside a terminal needs --yes`, before the CLI sends anything.

## Requires a read-write key

A read-only key fails with exit `1` and `permission denied`. See [CLI authentication](/cli/authentication#browser-login-mints-a-read-only-key).

## Output

A success line naming the alert. With `--json`, `{"id": "<id>", "deleted": true}`.

## Errors

| Exit | Symptom                                       | Cause                                           |
| ---- | --------------------------------------------- | ----------------------------------------------- |
| `1`  | `... is not a cost alert id`                  | The id is not a UUID                            |
| `1`  | `deleting ... outside a terminal needs --yes` | No terminal to confirm on, and no `--yes`       |
| `1`  | `403` permission denied                       | The key is read-only                            |
| `1`  | `404`                                         | No alert has that id, or it was already deleted |
