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

# ankra alerts

> Manage alert destinations and notification routes

## ankra alerts

Manage where Ankra delivers alerts and platform notifications.

Destinations are the endpoints notifications are sent to: a webhook URL
(Slack, Microsoft Teams, Discord, PagerDuty, or any custom receiver) or a
Slack/Teams channel the Ankra bot posts to directly. Routes decide which
notifications reach which destination, filtered by kind, severity, cluster,
and source, so the whole alerting setup can live in scripts and CI next to
the rest of your platform configuration.

ankra alerts destinations list
ankra alerts destinations create --name ops-slack --url [https://hooks.slack.com/services/](https://hooks.slack.com/services/)...
ankra alerts destinations test \<destination-id>
ankra alerts routes create --destination-id \<destination-id> --severity critical
ankra alerts routes list -o json

## ankra alerts destinations

Manage the organisation's alert destinations.

A destination is either a webhook URL or a channel-based Slack/Teams
destination that carries a channel id instead of a URL (list the channels
the Ankra bot can post to with 'ankra alerts destinations channels').
Webhook URLs are shown masked on every read.

## ankra alerts destinations channels

List the channels the Ankra bot can post to, for use with
'ankra alerts destinations create --channel-id'. Both providers are shown
unless --provider narrows it to one.

A provider whose workspace or tenant is not connected to the organisation
reads "not connected"; one whose bot service is not configured on this
platform reads "not available". Neither is an error.

```bash theme={null}
ankra alerts destinations channels [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |
| `--provider`     |         | Only one provider: slack or teams (default both)      |

## ankra alerts destinations create

Create an alert destination.

Pass --url for a webhook destination, or --channel-id for a channel-based
Slack or Teams destination (find ids with 'ankra alerts destinations
channels'); a Teams channel also needs --teams-tenant-id. --type records
which receiver the destination targets (slack, teams, discord, pagerduty,
custom; default slack) and selects the default payload format;
\--template-file overrides the payload with your own template.

ankra alerts destinations create --name ops-slack --url [https://hooks.slack.com/services/](https://hooks.slack.com/services/)...
ankra alerts destinations create --name oncall --type pagerduty --url [https://events.pagerduty.com/](https://events.pagerduty.com/)...
ankra alerts destinations create --name ops-teams --type teams --channel-id 19:abc\@thread.tacv2 --teams-tenant-id \<tenant>

```bash theme={null}
ankra alerts destinations create [flags]
```

**Flags**

| Flag                | Default | Description                                                                  |
| ------------------- | ------- | ---------------------------------------------------------------------------- |
| `--channel-id`      |         | Slack or Teams channel id for a channel-based destination (instead of --url) |
| `--channel-name`    |         | Display name of the channel behind --channel-id                              |
| `--description`     |         | Free-text description                                                        |
| `--disabled`        | `false` | Create the destination disabled                                              |
| `--name`            |         | Destination name, unique within the organisation                             |
| `-o`, `--output`    |         | Output format: json or yaml (default: human-readable)                        |
| `--teams-tenant-id` |         | Microsoft Teams tenant id (required with --channel-id for --type teams)      |
| `--template-file`   |         | File holding a custom payload template                                       |
| `--type`            |         | Receiver type: slack, teams, discord, pagerduty, or custom (default slack)   |
| `--url`             |         | Webhook URL to deliver to                                                    |

## ankra alerts destinations delete

Delete an alert destination. Routes that pointed at it stop delivering;
remove or re-point them with 'ankra alerts routes'.

```bash theme={null}
ankra alerts destinations delete <destination-id> [flags]
```

**Flags**

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

## ankra alerts destinations get

Show one alert destination

```bash theme={null}
ankra alerts destinations get <destination-id> [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |

## ankra alerts destinations list

List the organisation's alert destinations, 20 per page.

Filter by name with --search and by state with --enabled or --disabled. The
ID column is what routes and the other destination commands take.

ankra alerts destinations list --search slack
ankra alerts destinations list --disabled -o json

```bash theme={null}
ankra alerts destinations list [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `--disabled`     | `false` | Only disabled destinations                            |
| `--enabled`      | `false` | Only enabled destinations                             |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |
| `--page`         | `1`     | Page number                                           |
| `--page-size`    | `20`    | Destinations per page (max 100)                       |
| `--search`       |         | Filter destinations by name                           |

## ankra alerts destinations test

Send a sample notification to a stored destination and report whether
the receiver accepted it. A failed delivery exits non-zero so CI can gate
on it; the details are still printed (or emitted with -o json).

```bash theme={null}
ankra alerts destinations test <destination-id> [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |

## ankra alerts destinations test-url

Send a sample notification to an ad-hoc webhook URL, optionally with a
custom payload template, without creating a destination. A failed delivery
exits non-zero.

ankra alerts destinations test-url --url [https://hooks.slack.com/services/](https://hooks.slack.com/services/)...
ankra alerts destinations test-url --url [https://example.com/hook](https://example.com/hook) --template-file payload.json

```bash theme={null}
ankra alerts destinations test-url [flags]
```

**Flags**

| Flag              | Default | Description                                           |
| ----------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output`  |         | Output format: json or yaml (default: human-readable) |
| `--template-file` |         | File holding a custom payload template                |
| `--url`           |         | Webhook URL to send the test notification to          |

## ankra alerts destinations update

Update an alert destination. Only the flags you pass are changed; the
rest keep their current values.

ankra alerts destinations update \<destination-id> --url [https://hooks.slack.com/services/new](https://hooks.slack.com/services/new)
ankra alerts destinations update \<destination-id> --disabled

```bash theme={null}
ankra alerts destinations update <destination-id> [flags]
```

**Flags**

| Flag                | Default | Description                                           |
| ------------------- | ------- | ----------------------------------------------------- |
| `--channel-id`      |         | New Slack or Teams channel id                         |
| `--channel-name`    |         | New display name of the channel                       |
| `--description`     |         | New description                                       |
| `--disabled`        | `false` | Disable the destination                               |
| `--enabled`         | `false` | Enable the destination                                |
| `--name`            |         | New destination name                                  |
| `-o`, `--output`    |         | Output format: json or yaml (default: human-readable) |
| `--teams-tenant-id` |         | New Microsoft Teams tenant id                         |
| `--template-file`   |         | File holding the new payload template                 |
| `--url`             |         | New webhook URL                                       |

## ankra alerts routes

Manage the organisation's notification routes.

A route sends notifications matching every filter it sets (kind, severity,
cluster, source) to one destination; a route with no filters matches
everything. Routes are evaluated in ascending priority, mode "exclude"
withholds matches instead of delivering them, and --stop-on-match ends the
walk at that route so lower-priority routes never see the notification.

ankra alerts routes create --destination-id \<destination-id> --severity critical
ankra alerts routes create --destination-id \<destination-id> --kind execution\_failed --cluster-id \<cluster-id> --priority 10
ankra alerts routes update \<route-id> --disabled
ankra alerts routes test \<route-id>

## ankra alerts routes create

Create a notification route to a destination. Every filter is optional;
a route with none matches every notification.

Kinds include execution\_failed, resource\_deployment\_failed,
resource\_health\_degraded, alert\_trigger\_fired, gitops\_sync\_failed,
agent\_offline, security\_new\_severe\_cves, and the other platform
notification kinds; severities are critical, warning, and info.

ankra alerts routes create --destination-id \<destination-id> --severity critical
ankra alerts routes create --destination-id \<destination-id> --kind gitops\_sync\_failed --mode exclude --stop-on-match

```bash theme={null}
ankra alerts routes create [flags]
```

**Flags**

| Flag               | Default | Description                                                        |
| ------------------ | ------- | ------------------------------------------------------------------ |
| `--cluster-id`     |         | Only notifications about this cluster (id)                         |
| `--destination-id` |         | Destination to deliver to (see 'ankra alerts destinations list')   |
| `--disabled`       | `false` | Create the route disabled                                          |
| `--kind`           |         | Only notifications of this kind (for example execution\_failed)    |
| `--mode`           |         | include delivers matches, exclude withholds them (default include) |
| `-o`, `--output`   |         | Output format: json or yaml (default: human-readable)              |
| `--priority`       | `0`     | Evaluation order, lowest first (default 100)                       |
| `--severity`       |         | Only notifications of this severity: critical, warning, or info    |
| `--source-id`      |         | Only notifications from this source id                             |
| `--stop-on-match`  | `false` | Stop evaluating lower-priority routes once this one matches        |

## ankra alerts routes delete

Delete a notification route

```bash theme={null}
ankra alerts routes delete <route-id> [flags]
```

**Flags**

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

## ankra alerts routes list

List notification routes

```bash theme={null}
ankra alerts routes list [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |

## ankra alerts routes test

Queue a sample notification through a route's destination. Delivery is
asynchronous: the command returns the delivery id once the sample is
queued, not once the receiver has accepted it.

```bash theme={null}
ankra alerts routes test <route-id> [flags]
```

**Flags**

| Flag             | Default | Description                                           |
| ---------------- | ------- | ----------------------------------------------------- |
| `-o`, `--output` |         | Output format: json or yaml (default: human-readable) |

## ankra alerts routes update

Update a notification route. Only the flags you pass are changed; the
rest keep their current values.

ankra alerts routes update \<route-id> --priority 5 --stop-on-match
ankra alerts routes update \<route-id> --destination-id \<other-destination-id>
ankra alerts routes update \<route-id> --disabled

```bash theme={null}
ankra alerts routes update <route-id> [flags]
```

**Flags**

| Flag               | Default | Description                                                        |
| ------------------ | ------- | ------------------------------------------------------------------ |
| `--cluster-id`     |         | Only notifications about this cluster (id)                         |
| `--destination-id` |         | Re-point the route at another destination                          |
| `--disabled`       | `false` | Disable the route                                                  |
| `--enabled`        | `false` | Enable the route                                                   |
| `--kind`           |         | Only notifications of this kind (for example execution\_failed)    |
| `--mode`           |         | include delivers matches, exclude withholds them (default include) |
| `-o`, `--output`   |         | Output format: json or yaml (default: human-readable)              |
| `--priority`       | `0`     | Evaluation order, lowest first (default 100)                       |
| `--severity`       |         | Only notifications of this severity: critical, warning, or info    |
| `--source-id`      |         | Only notifications from this source id                             |
| `--stop-on-match`  | `false` | Stop evaluating lower-priority routes once this one matches        |
