---
title: "Create Topic"
method: POST
path: "/clusters/{cluster_id}/topics"
tags: ["Topic (v3)"]
---

# Create Topic

`POST /clusters/{cluster_id}/topics`

[![Generally Available](https://img.shields.io/badge/Lifecycle%20Stage-Generally%20Available-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy)

Creates a topic.
Also supports a dry-run mode that only validates whether the topic creation would succeed
if the ``validate_only`` request property is explicitly specified and set to true.

## Request body

- CreateTopicRequestData
  - `topic_name` string, required
  - `partitions_count` integer
  - `replication_factor` integer
  - `replicas_assignments` object[]
    - `partition_id` integer, required
    - `broker_ids` integer[], required
  - `configs` object[]
    - `name` string, required
    - `value` string, nullable
  - `validate_only` boolean

## Response `200`

The created topic.

- TopicData
  - `kind` string, required
  - `metadata` ResourceMetadata, required
    - `self` string, required
    - `resource_name` string, nullable
  - `cluster_id` string, required
  - `topic_name` string, required
  - `is_internal` boolean, required
  - `replication_factor` integer, required
  - `partitions_count` integer, required
  - `partitions` Relationship, required
    - `related` string, required
  - `configs` Relationship, required
    - `related` string, required
  - `partition_reassignments` Relationship, required
    - `related` string, required

## Other responses

- `201` — The created topic.
- `400` — Indicates a bad request error. It could be caused by an unexpected request body format or other forms of request validation failure. Usually serves application/json content, although in some cases simple text/plain content can be returned.
- `401` — Indicates a client authentication error. Kafka authentication failures will contain error code 40101 in the response body.
- `429` — Indicates that a rate limit threshold has been reached, and the client should retry again later.
- `5XX` — A server-side problem that might not be addressable from the client side. Retriable Kafka errors will contain error code 50003 in the response body.

## Changes

- **2023-08-08** (v3) `1be42847ed21` — 1 breaking, 2 warning, 3 info
  - the `replicas_assignments` request property type/format changed from `object`/`` to `array`/``
  - removed the optional property `allOf[subschema #2]/authorized_operations` from the response with the `200` status
  - removed the optional property `allOf[subschema #2]/authorized_operations` from the response with the `201` status
  - api operation id `createKafkaTopic` removed and replaced with `createKafkaV3Topic`
  - …2 more
- **2023-03-13** (v3) `4a6390846d5c` — 1 breaking
  - the `replicas_assignments` request property type/format changed from `array`/`` to `object`/``
- **2023-03-10** (v3) `bb1cdf42f052` — 1 breaking, 2 info
  - removed the media type `text/plain` for the response with the status `400`
  - api operation id `createKafkaV3Topic` removed and replaced with `createKafkaTopic`
  - added the non-success response with the status `403`
- **2023-03-08** (v3) `fc2720a3b446` — 2 info
  - added the optional property `allOf[subschema #2]/authorized_operations` to the response with the `200` status
  - added the optional property `allOf[subschema #2]/authorized_operations` to the response with the `201` status
- **2023-03-08** (v3) `125174a361e4` — 2 info
  - added the new optional request property `validate_only`
  - added the success response with the status `200`

[Full history](https://skmtc.dev/confluentinc/apis/rest-admin-api/changes/clusters/:cluster_id/topics/post.md)

---

[API](https://skmtc.dev/confluentinc/apis/rest-admin-api.md) · [All operations](https://skmtc.dev/confluentinc/apis/rest-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/confluentinc/rest-admin-api/revisions/1be42847ed21/schema)
