---
title: "POST /v1/{+parent}/topics"
method: POST
path: "/v1/{+parent}/topics"
tags: ["projects"]
---

# POST /v1/{+parent}/topics

`POST /v1/{+parent}/topics`

Creates a new topic in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `topicId` string

## Request body

- Topic — A Kafka topic in a given cluster.
  - `name` string — Identifier. The name of the topic. The `topic` segment is used when connecting directly to the cluster. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}
  - `partitionCount` integer — Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.
  - `replicationFactor` integer — Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.
  - `configs` object — Optional. Configurations for the topic that are overridden from the cluster defaults. The key of the map is a Kafka topic property name, for example: `cleanup.policy`, `compression.type`.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/managedkafka.md) · [All operations](https://skmtc.net/google/apis/managedkafka/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/managedkafka/versions/ebfb70483869/schema)
