v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Databases

Update Topic for a Kafka Cluster

To update a topic attached to a Kafka cluster, send a PUT request to /v2/databases/$DATABASE_ID/topics/$TOPIC_NAME.

The result will be a JSON object with a topic key.

put/v2/databases/{database_cluster_uuid}/topics/{topic_name}

Path parameters

database_cluster_uuidstring uuid required

A unique identifier for a database cluster.

topic_namestring required

The name used to identify the Kafka topic.

Request body

replication_factorinteger

The number of nodes to replicate data across the cluster.

partition_countinteger

The number of partitions available for the topic. On update, this value can only be increased.

Example request

{
  "replication_factor": 2,
  "partition_count": 3,
  "config": {
    "cleanup_policy": "delete",
    "compression_type": "producer",
    "delete_retention_ms": 86400000,
    "file_delete_delay_ms": 60000,
    "flush_messages": 9223372036854776000,
    "flush_ms": 9223372036854776000,
    "index_interval_bytes": 4096,
    "max_compaction_lag_ms": 9223372036854776000,
    "max_message_bytes": 1048588,
    "message_down_conversion_enable": true,
    "message_format_version": "3.0-IV1",
    "message_timestamp_type": "create_time",
    "min_cleanable_dirty_ratio": 0.5,
    "min_insync_replicas": 1,
    "retention_bytes": 1000000,
    "retention_ms": 604800000,
    "segment_bytes": 209715200,
    "segment_ms": 604800000
  }
}

Response

A JSON object with a key of topic.

Example response

{
  "topic": {
    "name": "events",
    "state": "active",
    "replication_factor": 2,
    "partitions": [
      {
        "size": 4096,
        "id": 1,
        "in_sync_replicas": 3,
        "consumer_groups": [
          {
            "group_name": "consumer"
          }
        ]
      }
    ],
    "config": {
      "cleanup_policy": "delete",
      "compression_type": "producer",
      "delete_retention_ms": 86400000,
      "file_delete_delay_ms": 60000,
      "flush_messages": 9223372036854776000,
      "flush_ms": 9223372036854776000,
      "index_interval_bytes": 4096,
      "max_compaction_lag_ms": 9223372036854776000,
      "max_message_bytes": 1048588,
      "message_down_conversion_enable": true,
      "message_format_version": "3.0-IV1",
      "message_timestamp_type": "create_time",
      "min_cleanable_dirty_ratio": 0.5,
      "min_insync_replicas": 1,
      "retention_bytes": 1000000,
      "retention_ms": 604800000,
      "segment_bytes": 209715200,
      "segment_ms": 604800000
    }
  }
}