# diagrid notification route create

Create a notification route

### Description

Create a notification route.

A route selects alerts by their type and their labels, and delivers every match
to the destinations it names. A route naming no type matches every type; a
route with no filter matches every alert of the project.

\--type takes an alert type name. Two types are emitted today:
ALERT\_TYPE\_WORKFLOW               a workflow failed, terminated or stalled
ALERT\_TYPE\_TOKEN\_BUDGET\_DEPLETED  a token budget used its window allowance

ALERT\_TYPE\_WORKFLOW is raised only for App IDs that asked for it, with the
\--enable-workflow-notifications flag on diagrid app create and app update.

Which labels an alert carries depends on its type. The Alerts page of the
Diagrid console shows the labels of every alert it has recorded.

Filters are written as key\<op>value, where \<op> is one of:
\=    the label equals the value
!=   the label differs from the value
\=~   the label matches the value as a regular expression
!~   the label does not match the value as a regular expression

A label the alert does not carry is matched as empty. A regular expression
matches anywhere in the value unless it is anchored with ^ or $.

```
diagrid notification route create <name> [flags]
```

### Examples

```

  # Deliver every alert to the ops webhook
  diagrid notification route create all-alerts --destination ops-webhook

  # Deliver failed order workflows to two webhooks
  diagrid notification route create order-failures \
    --type ALERT_TYPE_WORKFLOW \
    --filter status=failed --filter 'workflow_name=~^order-' \
    --destination ops-webhook --destination oncall-webhook

```

### Options

```
  -p, --project string            Name of existing project
      --type string               Alert type this route matches, by name (e.g. ALERT_TYPE_WORKFLOW); omit to match every type
      --filter stringArray        Label matcher as key<op>value; repeat to AND several matchers
      --destination stringArray   Name of a notification destination; repeat for several
  -h, --help                      help for create
```

### Options inherited from parent commands

```
      --api-key string   Diagrid Cloud API key
```

### SEE ALSO

- [diagrid notification route](./route.md)	 - Manage notification routes
