---
source_url: https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/list
title: List all channels
updated_at: 2026-06-15T12:11:30.869Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# List all channels

Get a paginated list of all channels with `getChannels()`. Custom channel metadata is included by default.

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) for your keyset in the [Admin Portal](https://admin.pubnub.com/). With [Access Manager](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/users/permissions) enabled, uncheck `Disallow Get All Channel Metadata` in the [App Context configuration](https://www.pubnub.com/docs/general/metadata/basics#configuration) to retrieve all channel metadata without defining permissions in the authentication token.
:::

To list channels a user belongs to, use [getMemberships()](https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/membership#get-membership) instead.

### Method signature

This method takes the following parameters:

```kotlin
chat.getChannels(
    filter: String?,
    sort: Collection<PNSortKey<PNKey>> = listOf(),
    limit: Int?,
    page: PNPage?
): PNFuture<GetChannelsResponse>
```

#### Input

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| filter | String | Optional |  | Expression used to filter the results. Returns only these channels whose properties satisfy the given expression are returned. The filter language is [defined here](https://www.pubnub.com/docs/general/metadata/filtering). |
| sort | Collection<PNSortKey<PNKey>> | Optional | `listOf()` | A collection to specify the sort order. Available options are `id`, `name`, and `updated`. Use `asc` or `desc` to specify the sorting direction. For example: `listOf(PNSortKey.asc(PNKey.NAME))`. Unless specified otherwise, the items are sorted by the last updated date. Defaults to an empty list. |
| limit | Int | Optional | `100` | Number of objects to return in response. The default (and maximum) value is `100`. |
| page | PNPage | Optional |  | Object used for pagination to define which previous or next result page you want to fetch. |

#### Output

| Type | Description |
| --- | --- |
| `PNFuture<GetChannelsResponse>` | `PNFuture` containing a set of channels with pagination information (`next`, `prev`, `total`). |

### Sample code

Fetch all existing channel IDs.

```kotlin
chat.getChannels().async { result ->
    result.onSuccess {
        // handle success
    }.onFailure {
        // handle failure
    }
}
```

### Other examples

#### Pagination

Get the number of 25 channels and then specify that you want to fetch the results from the next page using a string previously returned from the PubNub server.

```kotlin
chat.getChannels(limit = 25).async { result ->
    result.onSuccess { channelsObject: GetChannelsResponse ->
        chat.getChannels(limit = 25, page = channelsObject.next)
            .async { result2 ->
                result2.onSuccess { channelsObjectPage2 -> ... }
                    .onFailure { ... }
            }
    }.onFailure { ... }
}
```

#### Archived channels

Get all archived channels. This request will return all channels removed with the `soft` option set to `true`, whose data is still stored in the App Context storage.

```kotlin
chat.getChannels(filter = "status=='deleted'").async { result ->
    result.onSuccess {
        // handle success
    }.onFailure {
        // handle failure
    }
}
```