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

# alert-channels

> DevHelm CLI alert-channels commands — list, get, create, update, delete, and test alert channels

Manage alert channels from the command line. Create channels, update configs, and send test notifications.

<Note>
  Alert channel IDs are **UUIDs**. The CLI validates the format locally before calling the API. Get IDs from `devhelm alert-channels list`.
</Note>

## Commands

| Command                              | Description              |
| ------------------------------------ | ------------------------ |
| `devhelm alert-channels list`        | List all alert channels  |
| `devhelm alert-channels get <id>`    | Get channel details      |
| `devhelm alert-channels create`      | Create an alert channel  |
| `devhelm alert-channels update <id>` | Update a channel         |
| `devhelm alert-channels delete <id>` | Delete a channel         |
| `devhelm alert-channels test <id>`   | Send a test notification |

## alert-channels list

```bash theme={null}
devhelm alert-channels list
```

| Flag          | Type    | Default | Description                             |
| ------------- | ------- | ------- | --------------------------------------- |
| `--page-size` | integer | `200`   | Number of items per API request (1–200) |

## alert-channels get

```bash theme={null}
devhelm alert-channels get <channel-id> -o json
```

## alert-channels create

Create a new alert channel.

```bash theme={null}
devhelm alert-channels create \
  --name "Slack Alerts" \
  --type slack \
  --webhook-url https://hooks.slack.com/services/T00/B00/xxx
```

| Flag            | Type   | Required | Description                                                                                                                                                                                                                                                      |
| --------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--name`        | string | Yes      | Channel display name                                                                                                                                                                                                                                             |
| `--type`        | string | Yes      | Channel type (lowercase): `email`, `webhook`, `slack`, `pagerduty`, `opsgenie`, `teams`, `discord`, `telegram`, `google_chat`, `pushover`, `mattermost`, `splunk_oncall`, `pushbullet`, `linear`, `incident_io`, `rootly`, `zapier`, `datadog`, `jira`, `gitlab` |
| `--webhook-url` | string | —        | Webhook URL (used by `webhook`, `slack`, `discord`, `teams` channel types)                                                                                                                                                                                       |
| `--config`      | string | —        | Channel-specific configuration as JSON (see note below)                                                                                                                                                                                                          |

<Note>
  Channel type values are **lowercase** everywhere — in the CLI `--type` flag, in `--config` JSON, and in the YAML `channelType` field. Both surfaces validate against the same OpenAPI enum and reject uppercase values.
</Note>

### Examples by type

<CodeGroup>
  ```bash Slack theme={null}
  devhelm alert-channels create \
    --name "Slack Alerts" \
    --type slack \
    --webhook-url https://hooks.slack.com/services/T00/B00/xxx
  ```

  ```bash PagerDuty theme={null}
  devhelm alert-channels create \
    --name "PagerDuty On-Call" \
    --type pagerduty \
    --config '{"channelType":"pagerduty","routingKey":"R0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}'
  ```

  ```bash Email theme={null}
  devhelm alert-channels create \
    --name "Ops Email" \
    --type email \
    --config '{"channelType":"email","recipients":["ops@example.com"]}'
  ```

  ```bash Webhook theme={null}
  devhelm alert-channels create \
    --name "Custom Webhook" \
    --type webhook \
    --config '{"channelType":"webhook","url":"https://webhook.site/00000000-0000-0000-0000-000000000000","signingSecret":"my-hmac-secret"}'
  ```
</CodeGroup>

### Configuring channels that need extra fields

For channels that need more than a webhook URL, pass the configuration as a JSON string with `--config`. The CLI validates the JSON locally against the matching schema **for these 7 types only**: `email`, `webhook`, `slack`, `pagerduty`, `opsgenie`, `teams`, `discord`.

For the remaining types (`telegram`, `google_chat`, `pushover`, `mattermost`, `splunk_oncall`, `pushbullet`, `linear`, `incident_io`, `rootly`, `zapier`, `datadog`, `jira`, `gitlab`), the `--config` flag rejects the payload before it reaches the API, and there are no dedicated flags for their fields (bot tokens, API keys, project IDs, …). Configure those channels via config-as-code or the dashboard instead:

```yaml Config-as-code theme={null}
alertChannels:
  - name: Telegram On-Call
    config:
      channelType: telegram
      botToken: ${TELEGRAM_BOT_TOKEN}
      chatId: "-1001234567890"
```

```bash theme={null}
devhelm deploy -f devhelm.yml --yes
```

## alert-channels update

```bash theme={null}
devhelm alert-channels update <channel-id> \
  --name "Slack Alerts (prod)" \
  --webhook-url https://hooks.slack.com/services/T00/B00/new
```

Supports the same flags as `create` (`--name`, `--type`, `--config`, `--webhook-url`), all optional.

## alert-channels delete

Prompts for confirmation; pass `--yes` (`-y`) in scripts and CI.

```bash theme={null}
devhelm alert-channels delete <channel-id>
```

<Warning>
  Deleting a channel removes it from all notification policies that reference it. Verify the channel isn't in use before deleting.
</Warning>

## alert-channels test

Send a test notification through the channel to verify the configuration.

```bash theme={null}
devhelm alert-channels test <channel-id>
```

## Next steps

<CardGroup cols={2}>
  <Card title="Alert channels reference" icon="bell" href="/alerting/channels">
    Detailed configuration for each channel type.
  </Card>

  <Card title="Integrations" icon="puzzle-piece" href="/integrations/overview">
    Setup guides for Slack, PagerDuty, OpsGenie, and more.
  </Card>
</CardGroup>
