Skip to content
Streamkap
Esc
navigateopen⌘Jpreview

Create a new Kafka topic

POST/topics
Authorization
AuthorizationBearer token · headerrequired
Request body
requiredapplication/json
topic_namestringrequired

Kafka topic name

min length 1 · max length 249
num_partitionsinteger

Number of partitions

min 1 · default: 1
replication_factorinteger | any

Replication factor (defaults to broker count)

Show properties
Any of:
integer
integer
any
any
cleanup_policyCleanupPolicyEnum | any

Topic cleanup policy

Show properties
Any of:
CleanupPolicyEnum
string
any
any
min_insync_replicasinteger | any

Minimum in-sync replicas

Show properties
Any of:
integer
integer
any
any
retention_msinteger | any

Time to retain data in ms (-1 for unlimited)

Show properties
Any of:
integer
integer
any
any
retention_bytesinteger | any

Max size on disk in bytes (-1 for unlimited)

Show properties
Any of:
integer
integer
any
any
max_message_bytesinteger | any

Maximum message size in bytes

Show properties
Any of:
integer
integer
any
any
custom_configsobject | any

Additional topic configs as key-value pairs

Show properties
Any of:
object
object
any
any
tagsstring[] | any

Tag IDs to assign to the topic

Show properties
Any of:
string[]
Array of string
string
any
any
Responses
201

Successful Response

idstringrequired
namestringrequired
entityTopicDetailsEntityrequired
Show properties
entity_typeTopicDetailsEntityTypeEnumrequired

Enum for topic entity types (producer types).

Allowed:sourcesdestinationstransformspipelinesmanual
entity_idstringrequired
namestringrequired
connectorSourceConnectorEnum | DestinationConnectorEnum | TransformsLibraryEnum | stringrequired
Show properties
Any of:
SourceConnectorEnum
string
DestinationConnectorEnum
string
TransformsLibraryEnum
string
string
string
topic_idsstring[]required
topic_db_idsstring[]required
display_namestringrequired
filtered_snapshot_languagestring | any
Show properties
Any of:
string
string
any
any
prefixstring | any
Show properties
Any of:
string
string
any
any
serializationTopicSerialization | any
Show properties
Any of:
TopicSerialization
key_formatSerializationFormatEnum

Human-readable serialization format names for API responses.

Allowed:avrojsonjson_schemaprotobufstringbytearrayunknown
value_formatSerializationFormatEnum

Human-readable serialization format names for API responses.

Allowed:avrojsonjson_schemaprotobufstringbytearrayunknown
key_converterstring | any

Converter class for message keys

Show properties
Any of:
string
string
any
any
value_converterstring | any

Converter class for message values

Show properties
Any of:
string
string
any
any
schema_registry_enabledboolean

Whether Schema Registry is used for this topic's serialization

default: false
any
any
num_partitionsintegerrequired
replication_factorintegerrequired
warningsCreateTopicWarning[]
default: []
Show properties
Array of CreateTopicWarning
messagestringrequired
levelstring
default: "WARN"
422

Validation Error

detailValidationError[]
Show properties
Array of ValidationError
locstring | integer[]required
Show properties
Array of string | integer
Any of:
string
string
integer
integer
msgstringrequired
typestringrequired
inputany
ctxobject
Request
curl -X POST "https://api.streamkap.com/topics" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "topic_name": "string",
  "num_partitions": 1,
  "replication_factor": 1,
  "cleanup_policy": "delete",
  "min_insync_replicas": 1,
  "retention_ms": -1,
  "retention_bytes": -1,
  "max_message_bytes": 1,
  "custom_configs": {
    "property1": "string",
    "property2": "string"
  },
  "tags": [
    "string"
  ]
}'
Response
{
  "id": "string",
  "name": "string",
  "entity": {
    "entity_type": "sources",
    "entity_id": "string",
    "name": "string",
    "connector": "alloydb",
    "topic_ids": [
      "string"
    ],
    "topic_db_ids": [
      "string"
    ],
    "display_name": "string",
    "filtered_snapshot_language": "string"
  },
  "prefix": "string",
  "serialization": {
    "key_format": "avro",
    "value_format": "avro",
    "key_converter": "string",
    "value_converter": "string",
    "schema_registry_enabled": false
  },
  "num_partitions": 0,
  "replication_factor": 0,
  "warnings": []
}