# List All Kafka Topics

### List all Kafka Topics

This endpoint lets you fetch a list of all Kafka topics within a specified Kafka cluster.

### Endpoint

`GET /clusters/{clusterId}/topics`

The `GET /clusters/{clusterId}/topics` endpoint retrieves a collection of all Kafka topics within the specified Kafka cluster identified by `clusterId`. Each topic includes detailed metadata such as creation and modification dates, ownership details, and current operational state. Topic properties like name, replicationFactor, numberOfPartitions, and logRetention settings are also provided.

Use this endpoint to fetch and monitor all Kafka topics within your environment, enabling efficient management and monitoring of data streams and event processing.

### Request

```bash
curl -X 'GET' \
  'https://kafka.de-txl.ionos.com/clusters/e69b22a5-8fee-56b1-b6fb-4a07e4205ead/topics' \
--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> |
| {% endtab %}    |          |        |                                                                                                     |
| {% endtabs %}   |          |        |                                                                                                     |

### Response

**200 Successful operation**

```json
{
  "id": "7c1fe82d-a1ea-55fc-a744-12fad4180eef",
  "type": "collection",
  "href": "/clusters/{clusterId}/topics",
  "items": [
    {
      "id": "ae085c4c-3626-5f1d-b4bc-cc53ae8267ce",
      "type": "topic",
      "href": "/clusters/{clusterId}/topics/ae085c4c-3626-5f1d-b4bc-cc53ae8267ce",
      "metadata": {
        "createdDate": "2020-12-10T13:37:50+01:00",
        "createdBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedDate": "2020-12-11T13:37:50+01:00",
        "lastModifiedBy": "ionos:identity:::users/87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "resourceURN": "ionos:<product>:<location>:<contract>:<resource-path>",
        "state": "AVAILABLE"
      },
      "properties": {
        "name": "my-kafka-cluster-topic",
        "replicationFactor": 3,
        "numberOfPartitions": 3,
        "logRetention": {
          "retentionTime": 604800000,
          "segmentBytes": 1073741824
        }
      }
    }
  ]
}
```
