---
source_url: https://www.pubnub.com/docs/chat/swift-chat-sdk/build/features/channels/delete
title: Delete channels
updated_at: 2026-06-12T11:23:12.408Z
---

> 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


# Delete channels

Remove a channel permanently with `delete()` or `deleteChannel()`.

Both methods produce the same result. Call `delete()` on a `Channel` object or `deleteChannel()` on the `Chat` object with the channel ID.

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

### Method signature

These methods take the following parameters:

* delete() (on the Channel object) 1channel.delete() async throws
* deleteChannel() (on the Chat object) 1chat.deleteChannel(2 id: String3) async throws

#### Input

| Parameter | Required in delete() | Required in deleteChannel() | Description |
| --- | --- | --- | --- |
| id | String | Optional |  | No | Yes | Unique channel identifier. |

#### Output

This method doesn't return any value.

### Sample code

:::tip Sample code
The code samples in Swift Chat SDK focus on asynchronous code execution.
You can also write synchronous code as the parameters are shared between the async and sync methods but we don't provide usage examples of such.
:::

Permanently delete the `support` channel metadata.

* `delete()`

```swift
// Assumes a "ChatImpl" reference named "chat"
Task {
  if let channel = try await chat.getChannel(channelId: "support") {
    try await channel.delete()
  } else {
    debugPrint("Channel not found")
  }
}
```