---
source_url: https://www.pubnub.com/docs/chat/kotlin-chat-sdk/build/features/channels/leave
title: Leave channels
updated_at: 2026-05-25T11:25:21.736Z
---

> 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


# Leave channels

:::note Requires App Context
Enable [App Context](https://youtu.be/9UEoSlngpYI) for your keyset in the [Admin Portal](https://admin.pubnub.com/).
:::

Remove a user's channel membership with `leave()`.

## Method signature

This method has the following signature:

```kotlin
channel.leave(): PNFuture<Unit>
```

### Input

This method doesn't take any parameters.

### Output

| Type | Description |
| --- | --- |
| `PNFuture<Unit>` | Function that returns an instance of `PNFuture` that will be completed with `Unit` when the `leave` operation is completed. |

## Sample code

Leave the `support` channel.

```kotlin
val channel: Channel
// ...
    
// you must be a member of the "support" channel...
channel.join().async {
    // ...
}
// ...to leave it sometime later
channel.leave().async {
    // ...
}
```