> 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/audit-channels.md). Agents can also search and read this documentation through its [MCP server](https://docs.lenses.io/latest/~gitbook/mcp).

# Audit Channels

This page describes the commands to manage audit channels in Lenses via the CLI.

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

### Basic list <a href="#basic-list" id="basic-list"></a>

```bash
lenses-cli auditchannels
```

### Detailed view <a href="#detailed-view" id="detailed-view"></a>

```bash
lenses-cli auditchannels --details
```

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

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

## List audit channel templates <a href="#list-audit-channel-templates" id="list-audit-channel-templates"></a>

When creating audit channels, one of the existing predefined channel templates needs to be used.

Such a command lists all available audit channel templates:

```bash
lenses-cli auditchannel-templates
```

To get all the details, use JSON format:

```bash
lenses-cli auditchannel-templates --output JSON
```

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

```bash
lenses-cli auditchannels create \
  --name "my-audit-channel-1" \
  --connectionName="w1" \
  --templateName="Webhook" \
  --properties="[{\"key\":\"body\",\"value\":\"payload1-created\"},{\"key\":\"insecure\",\"value\":true},{\"key\":\"method\",\"value\":\"GET\"}]"
```

Create a new audit channel using a YAML file:

```yaml
name: "my-audit-channel-2"
templateName: "Webhook"
connectionName: "w1"
properties:
  - key: "body"
    value: "body-payload"
  - key: "insecure"
    value: true
  - key: "method"
    value: "GET"
```

\
Save the file as audit\_chann.yml and execute it like this:Copy

```bash
lenses-cli auditchannels create audit_chann.yml
```

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

```bash
lenses-cli auditchannels update \
  --id "ID_OF_THE_CHANNEL_TO_BE_UPDATED" \
  --name "my-audit-channel-2-updated" \
  --connectionName="w1" \
  --templateName="Webhook" \
  --properties="[{\"key\":\"body\",\"value\":\"payload1-created\"},{\"key\":\"insecure\",\"value\":true},{\"key\":\"method\",\"value\":\"GET\"}]"
```

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

```bash
lenses-cli auditchannels delete \
    --channelID="701ff62c-8d14-4ef9-8dd0-fe2cd3c73779"
```


---

# 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/audit-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.
