# REST Resource: projects.locations.clusters.topics

- [Resource: Topic](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/reference/rest/v1/projects.locations.clusters.topics#Topic)
  - [JSON representation](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/reference/rest/v1/projects.locations.clusters.topics#Topic.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/reference/rest/v1/projects.locations.clusters.topics#METHODS_SUMMARY)

## Resource: Topic

A Kafka topic in a given cluster.

| JSON representation |
|---|
| ``` { "name": string, "partitionCount": integer, "replicationFactor": integer, "configs": { string: string, ... } } ``` |

| Fields ||
|---|---|
| `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` | `map (key: string, value: string)` 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`. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/reference/rest/v1/projects.locations.clusters.topics/create` | Creates a new topic in a given project and location. |
| ### `https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/reference/rest/v1/projects.locations.clusters.topics/delete` | Deletes a single topic. |
| ### `https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/reference/rest/v1/projects.locations.clusters.topics/get` | Returns the properties of a single topic. |
| ### `https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/reference/rest/v1/projects.locations.clusters.topics/list` | Lists the topics in a given cluster. |
| ### `https://docs.cloud.google.com/managed-service-for-apache-kafka/docs/reference/rest/v1/projects.locations.clusters.topics/patch` | Updates the properties of a single topic. |