# Delete a Kafka Topic

Allows you to delete a specific Kafka topic from a specified Kafka cluster.

## Endpoint

`DELETE /clusters/{clusterId}/topics/{topicId}`

The `DELETE /clusters/{clusterId}/topics/{topicId}` endpoint deletes the Kafka topic specified by `topicId` from the Kafka cluster identified by `clusterId`. Upon successful deletion request, the endpoint returns a `202 Accepted` status code, indicating that the topic deletion process has been initiated.

Use this endpoint carefully as it permanently removes the Kafka topic and its associated data. Ensure appropriate permissions and safeguards are in place before executing this operation.

## Request

```bash
curl -X 'DELETE' \
  'https://kafka.de-txl.ionos.com/clusters/e69b22a5-8fee-56b1-b6fb-4a07e4205ead/topics/ae085c4c-3626-5f1d-b4bc-cc53ae8267ce' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $Token'
```

{% tabs %}
{% tab title="Request Header Parameters" %}
To make authenticated requests to the API, the following fields are mandatory in the request header:

| Header Parameters | Required | Type   | Description                                                  |
| ----------------- | -------- | ------ | ------------------------------------------------------------ |
| `Accept`          | yes      | string | Set this to `application/json`.                              |
| `Authorization`   | yes      | string | Provide a header value as `Bearer` followed by your `token`. |
| {% endtab %}      |          |        |                                                              |

{% tab title="Request Path Parameters" %}

| Path Parameters | Required | Type   | Description                                                                                         |
| --------------- | -------- | ------ | --------------------------------------------------------------------------------------------------- |
| `clusterId`     | Yes      | string | <p>The UUID of the Kafka cluster.<br>Example: <code>e69b22a5-8fee-56b1-b6fb-4a07e4205ead</code></p> |
| `topicId`       | Yes      | string | <p>The UUID of the Kafka topic.<br>Example: <code>ae085c4c-3626-5f1d-b4bc-cc53ae8267ce</code></p>   |
| {% endtab %}    |          |        |                                                                                                     |
| {% endtabs %}   |          |        |                                                                                                     |

## Response

**202 Accepted**

The request to delete the topic was successful.


---

# Agent Instructions: 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 current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/data-analytics/kafka/api-howtos/delete-topic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
