# chat_list_channels

List Chat Channels

## Beschreibung

Lists chat channels the caller can see: public/private channels inside
their workspaces,
public channels, private channels the caller joined (admins also
see every private one), and the caller's DMs. Archived
channels are hidden unless `include_archived: true`.

Ordered public → private → direct, then alphabetically by name
within each group. Note: DMs appear here only if a DM was
already started with that partner — use `chat_start_dm` to
initiate a new one.
Admins and employers can create, edit, archive and restore shared
channels with chat_channel_save, subject to workspace/channel access.

## Zugriff

Zugriffsprofil: `basic`. Module: `chat`.
Die Freigabe im Profil ersetzt keine Account-, Workspace- oder Rollenberechtigung.

## Parameter

| Name | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `account_id` | string | Ja | Account prefix ID (e.g., acct_abc123). Discover via account_list. |
| `workspace_id` | string | Nein | Optional workspace prefix ID (wsp_…) or key. When present, returns only public/private channels in that workspace; account-wide DMs are omitted. |
| `include_archived` | boolean | Nein | Include archived channels (hidden from the web sidebar). Default false. Set true to search an archived channel by name. |

## Eingabeschema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "account_id": {
      "type": "string",
      "description": "Account prefix ID (e.g., acct_abc123). Discover via account_list."
    },
    "workspace_id": {
      "type": "string",
      "description": "Optional workspace prefix ID (wsp_…) or key. When present, returns only public/private channels in that workspace; account-wide DMs are omitted."
    },
    "include_archived": {
      "type": "boolean",
      "description": "Include archived channels (hidden from the web sidebar). Default false. Set true to search an archived channel by name."
    }
  },
  "required": [
    "account_id"
  ],
  "type": "object"
}
```

## Ausgabeschema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "channels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Channel prefix ID (chan_…) — pass to chat_get_messages / chat_send_message."
          },
          "workspace_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null for account-wide DMs."
          },
          "name": {
            "type": "string"
          },
          "channel_type": {
            "type": "string",
            "enum": [
              "public",
              "private",
              "direct"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_archived": {
            "type": "boolean"
          },
          "last_message_at": {
            "type": [
              "string",
              "null"
            ],
            "description": "ISO 8601 timestamp; null if no messages yet."
          },
          "is_member": {
            "type": "boolean",
            "description": "Whether the caller is a member of this channel."
          }
        },
        "required": [
          "id",
          "workspace_id",
          "name",
          "channel_type",
          "is_archived",
          "is_member"
        ]
      }
    }
  },
  "required": [
    "channels"
  ],
  "type": "object"
}
```
