<a id="cloud-cluster-delete-api"></a>

# Delete Kafka clusters

You can delete a cluster using the
[Confluent Cloud Console](#cloud-cluster-delete-console-walkthrough),
[Confluent CLI](#cloud-cluster-delete-cli-walkthrough), or
[REST API](#cloud-cluster-delete-restapi-walkthrough). You cannot
restore a deleted cluster.

To prevent accidental deletion of a Apache Kafka® cluster, enable
[Cluster Deletion Protection on Confluent Cloud](deletion-protection.md#cloud-cluster-deletion-protection). If a cluster has deletion
protection enabled, you cannot delete the cluster until you disable
protection.

Before you can delete a cluster, you must delete any connectors still running on
the cluster and any ksqlDB clusters associated with the cluster. For more
information, see [Delete a ksqlDB cluster](../ksqldb/ksqldb-cluster-api.md#cloud-ksql-cluster-delete-api).

Confluent retains deleted clusters for a brief period after you delete
them. For more information, contact
[Confluent Cloud Support](../support.md#request-support).

<a id="cloud-cluster-delete-console-walkthrough"></a>

## Cloud Console

1. Navigate to the clusters page for your environment.
2. Select the cluster you want to delete, and then select the **Settings**
   tab.
   ![Settings tab on the cluster page in |ccloud-console|.](images/_clusters/cluster-detail-header.png)
3. In the **Delete cluster** panel, click **Delete cluster**, enter the cluster
   name, and click **Continue**.
   ![The Delete cluster section on the Settings tab, with the
   Delete cluster button.](images/_clusters/delete-cluster-panel.png)

<a id="cloud-cluster-delete-cli-walkthrough"></a>

## Confluent CLI

To delete a cluster, run the following command in your terminal:

```none
confluent kafka cluster delete <id> [flags]
```

In the following example, highlighted text indicates your input:

```none
confluent kafka cluster delete lkc-123exa

Are you sure you want to delete Kafka cluster "lkc-123exa"?
To confirm, type "my-new-name". To cancel, press Ctrl-C:

my-new-name

Deleted Kafka cluster "lkc-123exa".
```

<a id="cloud-cluster-delete-restapi-walkthrough"></a>

## Confluent Cloud APIs

To delete a cluster, make a `DELETE` request specifying the environment and
cluster.

### Request

This request structure applies to all cluster types.

```bash
DELETE /cmk/v2/clusters/{id}?environment={environment_id}
```

| Parameter     | Required or Optional   | Description                                                                                            |
|---------------|------------------------|--------------------------------------------------------------------------------------------------------|
| `id`          | Required               | Path parameter specifying the identifier for the cluster to delete.                                    |
| `environment` | Required               | Query parameter specifying the identifier for the environment that<br/>contains the cluster to delete. |

### Response

Success returns an HTTP `204 No Content`.
