> For the complete documentation index, see [llms.txt](https://platform9.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform9.com/kb/pmk/how-to/delete-a-cluster-using-the-qbert-api.md).

# Delete a Cluster using the Qbert API

## Problem

A cluster deletion via the API is a useful tool for automation or if you do not have access to UI.

Environment

* Platform9 Managed Kubernetes - All Versions
* Qbert

## Procedure

1 - Obtain an authentication token from the Keystone service.

{% tabs %}
{% tab title="Bash" %}

```bash
$ TOKEN=(curl -D - -sH "Content-Type: application/json" https://__DDU__/keystone/v3/auth/tokens -d '{"auth": {"identity": {"methods": ["password"], "password": {"user": {"name": "<__signup_email__>", "domain": {"id": "default"}, "password": "__PASSWORD__"}}}}}' | grep -Fi 'X-Subject-Token' | awk '{print $2}')
```

{% endtab %}
{% endtabs %}

2 - Obtain the UUID of the Tenant by clicking on your profile on the Top right and navigating to Admin Settings.

<figure><img src="https://978681485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzyQCMA9ICq40g4F8hWJi%2Fuploads%2Fgit-blob-c6529aa92320aa1f4609414c62aaf296d0e6fc11%2F1628739009.png?alt=media" alt=""><figcaption></figcaption></figure>

3 - Obtain the Cluster UUID by navigating to Infrastructure -> Clusters -> Select Cluster -> Cluster Details -> Unique ID.

4 - The Cluster can be deleted using the following command.

{% tabs %}
{% tab title="Bash" %}

```bash
$ curl --request DELETE --url https://<platform9_url>/qbert/v3/<project_uuid>/clusters/<uuid> --header "X-Auth-Token: $TOKEN"
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Warning**

Please ensure all workloads have been moved off the cluster before attempting deletion.
{% endhint %}

## Additional Information

[Qbert API Documentation](https://platform9.com/docs/v5.2/qbert-v3/ref#deletedelete-a-cluster-from-pmk-as-specified-by-the-cluster-uuid)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://platform9.com/kb/pmk/how-to/delete-a-cluster-using-the-qbert-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
