> For the complete documentation index, see [llms.txt](https://docs.lenses.io/latest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lenses.io/latest/devx/5.5/user-guide/cli/admin/alert-channels.md). Agents can also search and read this documentation through its [MCP server](https://docs.lenses.io/latest/~gitbook/mcp).

# Alert Channels

This page describes managing alert channels in Lenses via the CLI.

## List alert channels <a href="#list-alert-channels" id="list-alert-channels"></a>

```bash
lenses-cli alertchannels
```

## View details of all alert channels <a href="#view-details-of-all-alert-channels" id="view-details-of-all-alert-channels"></a>

```bash
lenses-cli alertchannels --details
```

## List alert channels with possible flags <a href="#list-alert-channels-with-possible-flags" id="list-alert-channels-with-possible-flags"></a>

```bash
lenses-cli alertchannels \
--page=1 \
--pageSize=10 \
--sortField="name" \
--sortOrder="asc" \
--templateName="test" \
--channelName="slack"
```

## Create a new alert channel <a href="#create-new-alert-channel" id="create-new-alert-channel"></a>

```bash
lenses-cli alertchannels create \
--name "my-slack-channel" \
--connectionName="my-slack-connection" \
--templateName="Slack" \
--properties="[{\"key\":\"username\",\"value\":\"@johndoe\"},{\"key\":\"channel\",\"value\":\"company-slack-channel\"}]"

```

Create a new alert channel using a YAML file:

```yaml
name: "My alert channel"
templateName: "Slack"
connectionName: "slackconn"
   properties:
   - key: "username"
     value: "George"
   - key: "channel"
     value: "#dev-ops"
```

```bash
lenses-cli alertchannels create alert_chann.yml
```

## Update an alert channel <a href="#update-an-alert-channel" id="update-an-alert-channel"></a>

```bash
lenses-cli alert setting set \
    --id 1000 \
    --enable=false \
    --channels="143315dd-80bf-4833-a13a-394be06dd
    --channels="f9d6140c-4823-4157-a93c-5147aa0e2f29"

```

Update the settings of an alert channel from a file:

```yaml
id: 1000
enable: false
channels:
- "f9d6140c-4823-4157-a93c-5147aa0e2f29"
- "143315dd-80bf-4833-a13a-394be06dda87"
```

```bash
lenses-cli alert setting set alert_sett.yaml
```

## Delete an alert channel <a href="#delete-an-alert-channel" id="delete-an-alert-channel"></a>

```bash
lenses-cli alertchannels \
    delete channelID="f9d6140c-4823-4157-a93c-5147aa0e2f29"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lenses.io/latest/devx/5.5/user-guide/cli/admin/alert-channels.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
