# Create a Kafka Cluster

You can create a new Kafka cluster with specified configurations.

## Endpoint

`POST /clusters`

The `POST /clusters` endpoint allows you to create a new Kafka cluster with specified properties. The name, version, size and connection fields are required. The response includes the ID, metadata, and properties of the newly created cluster, along with its current state and broker addresses.

Use this endpoint to provision a Kafka cluster tailored to your application's requirements, ensuring seamless integration and efficient data management.

## Parameters

| Body Parameter                             | Required |  Type  | Description                                                    |
| ------------------------------------------ | :------: | :----: | -------------------------------------------------------------- |
| `metadata`                                 |    No    | object | Optional metadata for the cluster.                             |
| `properties`                               |    Yes   | object | Properties of the cluster to be created.                       |
| `properties.name`                          |    Yes   | string | The name of the Kafka cluster.                                 |
| `properties.version`                       |    Yes   | string | The version of Kafka to use for the cluster.                   |
| `properties.size`                          |    Yes   | string | The size of the Kafka cluster.                                 |
| `properties.connections`                   |    No    |  array | List of connections for the cluster.                           |
| `properties.connections[].datacenterId`    |    Yes   | string | The UUID of the data center where the cluster will be created. |
| `properties.connections[].lanId`           |    Yes   | string | The LAN ID where the cluster will be connected.                |
| `properties.connections[].brokerAddresses` |    Yes   |  array | List of broker addresses for the cluster.                      |

## Request Body

```json
{
  "metadata": {},
  "properties": {
    "name": "my-kafka-cluster",
    "version": "3.7.0",
    "size": "S",
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "brokerAddresses": [
          "192.168.1.101/24",
          "192.168.1.102/24",
          "192.168.1.103/24"
        ]
      }
    ]
  }
}
```

## Response

```json
{
  "id": "e69b22a5-8fee-56b1-b6fb-4a07e4205ead",
  "type": "cluster",
  "href": "/clusters/e69b22a5-8fee-56b1-b6fb-4a07e4205ead",
  "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",
    "message": "In progress.",
    "brokerAddresses": [
      "192.168.1.101:9093",
      "192.168.1.102:9093",
      "192.168.1.103:9093"
    ]
  },
  "properties": {
    "name": "my-kafka-cluster",
    "version": "3.7.0",
    "size": "S",
    "connections": [
      {
        "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
        "lanId": "2",
        "brokerAddresses": [
          "192.168.1.101/24",
          "192.168.1.102/24",
          "192.168.1.103/24"
        ]
      }
    ]
  }
}
```


---

# 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/~/revisions/AMiYziCllTKB2y2lmONY/data-analytics/kafka/api-howtos/create-kafka.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.
