dots.v2.databases.byDatabase_cluster_uuid().topics.post()
Generated on 27 Oct 2026
from DoTs version
v1.21.0
Usage
client.v2.databases.byDatabase_cluster_uuid(database_cluster_uuid).topics.post(body: Kafka_topic_create, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | TopicsPostResponse>Description
To create a topic attached to a Kafka cluster, send a POST request to
/v2/databases/{database_cluster_uuid}/topics.
The result will be a JSON object with a topic key.
Parameters
Path Parameters
database_cluster_uuidstring requiredExample:
9cc10173-e9ea-4176-9dbc-a4cee4c4ff30A unique identifier for a database cluster.
Request Body
namestring requiredExample:
eventsThe name of the Kafka topic.
replicationFactorinteger optionalExample:
2The number of nodes to replicate data across the cluster.
partitionCountinteger optionalExample:
3The number of partitions available for the topic. On update, this value can only be increased.
configobject optionalShow child properties
cleanupPolicystring optionalThe cleanup_policy sets the retention policy to use on log segments. 'delete' will discard old segments when retention time/size limits are reached. 'compact' will enable log compaction, resulting in retention of the latest value for each key.
compressionTypestring optionalThe compression_type specifies the compression type of the topic.
deleteRetentionMsinteger optionalExample:
86400000The delete_retention_ms specifies how long (in ms) to retain delete tombstone markers for topics.
fileDeleteDelayMsinteger optionalExample:
60000The file_delete_delay_ms specifies the time (in ms) to wait before deleting a file from the filesystem.
flushMessagesinteger optionalExample:
9223372036854776000The flush_messages specifies the number of messages to accumulate on a log partition before messages are flushed to disk.
flushMsinteger optionalExample:
9223372036854776000The flush_ms specifies the maximum time (in ms) that a message is kept in memory before being flushed to disk.
indexIntervalBytesinteger optionalExample:
4096The index_interval_bytes specifies the number of bytes between entries being added into te offset index.
maxCompactionLagMsinteger optionalExample:
9223372036854776000The max_compaction_lag_ms specifies the maximum amount of time (in ms) that a message will remain uncompacted. This is only applicable if the logs are have compaction enabled.
maxMessageBytesinteger optionalExample:
1048588The max_messages_bytes specifies the largest record batch size (in bytes) that can be sent to the server. This is calculated after compression if compression is enabled.
messageDownConversionEnableboolean optionalExample:
trueThe message_down_conversion_enable specifies whether down-conversion of message formats is enabled to satisfy consumer requests. When 'false', the broker will not perform conversion for consumers expecting older message formats. The broker will respond with an
UNSUPPORTED_VERSIONerror for consume requests from these older clients.messageFormatVersionstring optionalThe message_format_version specifies the message format version used by the broker to append messages to the logs. The value of this setting is assumed to be 3.0-IV1 if the broker protocol version is 3.0 or higher. By setting a particular message format version, all existing messages on disk must be smaller or equal to the specified version.
messageTimestampTypestring optionalThe message_timestamp_type specifies whether to use the message create time or log append time as the timestamp on a message.
minCleanableDirtyRationumber optionalExample:
0.5The min_cleanable_dirty_ratio specifies the frequency of log compaction (if enabled) in relation to duplicates present in the logs. For example, at 0.5, at most 50% of the log could be duplicates before compaction would begin.
minCompactionLagMsinteger optionalExample:
0The min_compaction_lag_ms specifies the minimum time (in ms) that a message will remain uncompacted in the log. Only relevant if log compaction is enabled.
minInsyncReplicasinteger optionalExample:
1The min_insync_replicas specifies the number of replicas that must ACK a write for the write to be considered successful.
preallocateboolean optionalExample:
falseThe preallocate specifies whether a file should be preallocated on disk when creating a new log segment.
retentionBytesinteger optionalExample:
1000000The retention_bytes specifies the maximum size of the log (in bytes) before deleting messages. -1 indicates that there is no limit.
retentionMsinteger optionalExample:
604800000The retention_ms specifies the maximum amount of time (in ms) to keep a message before deleting it.
segmentBytesinteger optionalExample:
209715200The segment_bytes specifies the maximum size of a single log file (in bytes).
segmentJitterMsinteger optionalExample:
0The segment_jitter_ms specifies the maximum random jitter subtracted from the scheduled segment roll time to avoid thundering herds of segment rolling.
segmentMsinteger optionalExample:
604800000The segment_ms specifies the period of time after which the log will be forced to roll if the segment file isn't full. This ensures that retention can delete or compact old data.
Request Sample
Response Example
More Information
See /v2/databases/{database_cluster_uuid}/topics in the API reference for additional detail on responses, headers, parameters, and more.