Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

Kafka Administrative Protocol APIs

This document specifies the Kafka protocol APIs used for cluster administration, including topic management, configuration, ACL management, and cluster operations.


API KeyNamePurpose
19CreateTopicsCreate new topics
20DeleteTopicsDelete existing topics
21DeleteRecordsDelete records before offset
37CreatePartitionsAdd partitions to topics
API KeyNamePurpose
32DescribeConfigsRetrieve configurations
33AlterConfigsReplace configurations (deprecated)
44IncrementalAlterConfigsModify configurations incrementally
API KeyNamePurpose
29DescribeAclsList ACL entries
30CreateAclsCreate ACL entries
31DeleteAclsDelete ACL entries
API KeyNamePurpose
34AlterReplicaLogDirsMove replicas between directories
35DescribeLogDirsQuery log directory usage
43ElectLeadersTrigger leader election
45AlterPartitionReassignmentsReassign partitions
46ListPartitionReassignmentsQuery reassignment status
60DescribeClusterDescribe cluster metadata
API KeyNamePurpose
80AddRaftVoterAdd voter to KRaft quorum
81RemoveRaftVoterRemove voter from KRaft quorum
82UpdateRaftVoterUpdate KRaft voter endpoints

The CreateTopics API creates new topics with specified configurations.

VersionKafkaKey Changes
00.10.1Initial version (removed in 4.0)
10.10.2Error message (removed in 4.0)
20.11.0Throttle time (4.0 baseline)
31.0.0Response before quota throttling
42.0.0KIP-464 optional partitions/replication
52.4.0Flexible versions; response configs (KIP-525)
62.7.0KIP-599 THROTTLING_QUOTA_EXCEEDED
73.0.0KIP-516 topic ID
CreateTopicsRequest =>
topics: [Topic]
timeout_ms: INT32
validate_only: BOOLEAN
Topic =>
name: STRING
num_partitions: INT32
replication_factor: INT16
assignments: [Assignment]
configs: [Config]
Assignment =>
partition_index: INT32
broker_ids: [INT32]
Config =>
name: STRING
value: NULLABLE_STRING
FieldTypeDescription
nameSTRINGTopic name
num_partitionsINT32Number of partitions (-1 for default)
replication_factorINT16Replication factor (-1 for default)
assignmentsARRAYManual replica assignments (optional)
configsARRAYTopic-level configurations
timeout_msINT32Operation timeout
validate_onlyBOOLEANOnly validate, do not create
CreateTopicsResponse =>
throttle_time_ms: INT32
topics: [Topic]
Topic =>
name: STRING
topic_id: UUID
error_code: INT16
error_message: NULLABLE_STRING
topic_config_error_code: INT16
num_partitions: INT32
replication_factor: INT16
configs: [Config]
Config =>
name: STRING
value: NULLABLE_STRING
read_only: BOOLEAN
config_source: INT8
is_sensitive: BOOLEAN
AspectGuarantee
AtomicityEach topic creation is independent
ValidationConfigs validated before creation
TimeoutTIMEOUT error does not mean failure
IdempotenceTOPIC_ALREADY_EXISTS if topic exists

Timeout Behavior

A REQUEST_TIMED_OUT response does not indicate failure. The topic may still be created. Clients should query metadata to verify topic state.

Error CodeRetriableCauseRecovery
TOPIC_ALREADY_EXISTSTopic existsSkip or delete first
INVALID_TOPICInvalid topic nameFix name
INVALID_REPLICATION_FACTORRF > available brokersReduce RF
INVALID_PARTITIONSInvalid partition countFix count
TOPIC_AUTHORIZATION_FAILEDNo Create permissionCheck ACLs
REQUEST_TIMED_OUTOperation timeoutCheck metadata, retry

The DeleteTopics API deletes topics and all their data.

VersionKafkaKey Changes
00.10.1Initial version (removed in 4.0)
10.10.2Throttle time (4.0 baseline)
20.11.0Response before quota throttling
31.2.0TOPIC_DELETION_DISABLED error
42.4.0Flexible versions
52.8.0Error message; THROTTLING_QUOTA_EXCEEDED
63.0.0Topic ID support
DeleteTopicsRequest =>
topics: [Topic]
topic_names: [STRING]
timeout_ms: INT32
Topic =>
name: NULLABLE_STRING
topic_id: UUID
FieldTypeDescription
topicsARRAYTopics to delete (v6+; by name or ID)
topic_namesARRAYTopic names to delete (v0-5)
timeout_msINT32Operation timeout
DeleteTopicsResponse =>
throttle_time_ms: INT32
responses: [Response]
Response =>
name: NULLABLE_STRING
topic_id: UUID
error_code: INT16
error_message: NULLABLE_STRING
AspectGuarantee
IrreversibilityDeletion cannot be undone
AsynchronousDeletion may complete after response
Data lossAll partition data permanently lost
MetadataTopic removed from cluster metadata

Irreversible Operation

Topic deletion permanently destroys all data in the topic. There is no recovery mechanism.


The CreatePartitions API adds partitions to existing topics.

VersionKafkaKey Changes
01.0.0Initial version
12.0.0Response improvements
22.4.0Flexible versions
32.8.0KIP-516
CreatePartitionsRequest =>
topics: [Topic]
timeout_ms: INT32
validate_only: BOOLEAN
Topic =>
name: STRING
count: INT32
assignments: [Assignment]
Assignment =>
broker_ids: [INT32]
FieldTypeDescription
countINT32New total partition count
assignmentsARRAYManual replica assignments for new partitions
CreatePartitionsResponse =>
throttle_time_ms: INT32
results: [Result]
Result =>
name: STRING
error_code: INT16
error_message: NULLABLE_STRING
AspectGuarantee
Increase onlyCan only increase partition count
Key distributionExisting key distribution changes
Data preservationExisting partition data preserved

Key Distribution Impact

Adding partitions changes key-to-partition mapping. Keys previously routing to partition N may route to new partitions. This affects ordering guarantees for keyed messages.


The DescribeConfigs API retrieves configuration for resources (brokers, topics, etc.).

VersionKafkaKey Changes
00.11.0Initial version
11.0.0Include synonyms
22.0.0Response improvements
32.1.0Include documentation
42.4.0Flexible versions
DescribeConfigsRequest =>
resources: [Resource]
include_synonyms: BOOLEAN
include_documentation: BOOLEAN
Resource =>
resource_type: INT8
resource_name: STRING
configuration_keys: [STRING]
FieldTypeDescription
resource_typeINT8Resource type (see below)
resource_nameSTRINGResource name (topic/broker ID)
configuration_keysARRAYKeys to fetch (null for all)
ValueTypeDescription
0UNKNOWNUnknown (invalid)
2TOPICTopic configuration
4BROKERBroker configuration
8BROKER_LOGGERBroker logger level
16CLIENT_METRICSClient metrics
32GROUPGroup configuration
DescribeConfigsResponse =>
throttle_time_ms: INT32
results: [Result]
Result =>
error_code: INT16
error_message: NULLABLE_STRING
resource_type: INT8
resource_name: STRING
configs: [Config]
Config =>
name: STRING
value: NULLABLE_STRING
read_only: BOOLEAN
is_default: BOOLEAN
config_source: INT8
is_sensitive: BOOLEAN
synonyms: [Synonym]
config_type: INT8
documentation: NULLABLE_STRING
ValueSourceDescription
0UNKNOWNUnknown source
1TOPIC_CONFIGDynamic topic config
2DYNAMIC_BROKER_CONFIGDynamic broker config
3DYNAMIC_DEFAULT_BROKER_CONFIGDynamic broker default
4STATIC_BROKER_CONFIGStatic broker config
5DEFAULT_CONFIGBuilt-in default
6DYNAMIC_BROKER_LOGGER_CONFIGDynamic broker logger config
7CLIENT_METRICS_CONFIGDynamic client metrics config
8GROUP_CONFIGDynamic group config

The IncrementalAlterConfigs API modifies configurations incrementally without replacing all values.

VersionKafkaKey Changes
02.3.0Initial version
12.4.0Flexible versions
IncrementalAlterConfigsRequest =>
resources: [Resource]
validate_only: BOOLEAN
Resource =>
resource_type: INT8
resource_name: STRING
configs: [Config]
Config =>
name: STRING
config_operation: INT8
value: NULLABLE_STRING
FieldTypeDescription
config_operationINT8Operation type
ValueOperationDescription
0SETSet config value
1DELETERemove config override
2APPENDAppend to list config
3SUBTRACTRemove from list config
IncrementalAlterConfigsResponse =>
throttle_time_ms: INT32
responses: [Response]
Response =>
error_code: INT16
error_message: NULLABLE_STRING
resource_type: INT8
resource_name: STRING

The DescribeAcls API queries ACL entries matching specified filters.

VersionKafkaKey Changes
00.11.0Initial version
12.0.0Throttle time
22.4.0Flexible versions
33.0.0KIP-516
DescribeAclsRequest =>
resource_type_filter: INT8
resource_name_filter: NULLABLE_STRING
pattern_type_filter: INT8
principal_filter: NULLABLE_STRING
host_filter: NULLABLE_STRING
operation: INT8
permission_type: INT8
FieldTypeDescription
resource_type_filterINT8Resource type (ANY for all)
pattern_type_filterINT8Pattern type (ANY for all)
operationINT8Operation (ANY for all)
permission_typeINT8ALLOW or DENY (ANY for all)
ValueType
0UNKNOWN
1ANY
2TOPIC
3GROUP
4CLUSTER
5TRANSACTIONAL_ID
6DELEGATION_TOKEN
7USER
ValueOperation
0UNKNOWN
1ANY
2ALL
3READ
4WRITE
5CREATE
6DELETE
7ALTER
8DESCRIBE
9CLUSTER_ACTION
10DESCRIBE_CONFIGS
11ALTER_CONFIGS
12IDEMPOTENT_WRITE
13CREATE_TOKENS
14DESCRIBE_TOKENS
ValueTypeDescription
0UNKNOWNUnknown (invalid)
1ANYMatch any pattern
2MATCHMatches resource name pattern
3LITERALExact resource name match
4PREFIXEDResource name prefix match
DescribeAclsResponse =>
throttle_time_ms: INT32
error_code: INT16
error_message: NULLABLE_STRING
resources: [Resource]
Resource =>
resource_type: INT8
resource_name: STRING
pattern_type: INT8
acls: [Acl]
Acl =>
principal: STRING
host: STRING
operation: INT8
permission_type: INT8

The CreateAcls API creates new ACL entries.

VersionKafkaKey Changes
00.11.0Initial version
12.0.0Response improvements
22.4.0Flexible versions
33.0.0KIP-516
CreateAclsRequest =>
creations: [Creation]
Creation =>
resource_type: INT8
resource_name: STRING
resource_pattern_type: INT8
principal: STRING
host: STRING
operation: INT8
permission_type: INT8
FieldTypeDescription
principalSTRINGPrincipal (e.g., "User:alice")
hostSTRINGHost ("*" for any)
permission_typeINT82=DENY, 3=ALLOW
CreateAclsResponse =>
throttle_time_ms: INT32
results: [Result]
Result =>
error_code: INT16
error_message: NULLABLE_STRING

The DeleteAcls API deletes ACL entries matching filters.

VersionKafkaKey Changes
00.11.0Initial version
12.0.0Response improvements
22.4.0Flexible versions
33.0.0KIP-516
DeleteAclsRequest =>
filters: [Filter]
Filter =>
resource_type_filter: INT8
resource_name_filter: NULLABLE_STRING
pattern_type_filter: INT8
principal_filter: NULLABLE_STRING
host_filter: NULLABLE_STRING
operation: INT8
permission_type: INT8
DeleteAclsResponse =>
throttle_time_ms: INT32
filter_results: [FilterResult]
FilterResult =>
error_code: INT16
error_message: NULLABLE_STRING
matching_acls: [MatchingAcl]
MatchingAcl =>
error_code: INT16
error_message: NULLABLE_STRING
resource_type: INT8
resource_name: STRING
pattern_type: INT8
principal: STRING
host: STRING
operation: INT8
permission_type: INT8

The ElectLeaders API triggers leader election for partitions.

VersionKafkaKey Changes
02.2.0Initial version (preferred leaders)
12.4.0KIP-460 election types
22.4.0Flexible versions
ElectLeadersRequest =>
election_type: INT8
topic_partitions: [TopicPartition]
timeout_ms: INT32
TopicPartition =>
topic: STRING
partitions: [INT32]
FieldTypeDescription
election_typeINT80=PREFERRED, 1=UNCLEAN
topic_partitionsARRAYPartitions (null for all)
ValueTypeDescription
0PREFERREDElect preferred leader (must be in ISR)
1UNCLEANElect any available replica (data loss risk)

Unclean Leader Election

Unclean leader election (type=1) may result in data loss if the elected replica is behind the previous leader.

ElectLeadersResponse =>
throttle_time_ms: INT32
error_code: INT16
replica_election_results: [ReplicaElectionResult]
ReplicaElectionResult =>
topic: STRING
partition_result: [PartitionResult]
PartitionResult =>
partition_id: INT32
error_code: INT16
error_message: NULLABLE_STRING

The AlterPartitionReassignments API reassigns partition replicas to different brokers.

VersionKafkaKey Changes
02.4.0Initial version
AlterPartitionReassignmentsRequest =>
timeout_ms: INT32
topics: [Topic]
Topic =>
name: STRING
partitions: [Partition]
Partition =>
partition_index: INT32
replicas: [INT32]
FieldTypeDescription
replicasARRAYNew replica list (null to cancel)
AlterPartitionReassignmentsResponse =>
throttle_time_ms: INT32
error_code: INT16
error_message: NULLABLE_STRING
responses: [Response]
Response =>
name: STRING
partitions: [Partition]
Partition =>
partition_index: INT32
error_code: INT16
error_message: NULLABLE_STRING
AspectGuarantee
ProgressData copied before old replicas removed
AvailabilityPartition remains available during reassignment
CancellationSet replicas to null to cancel

The DescribeLogDirs API queries log directory usage on brokers.

VersionKafkaKey Changes
00.11.0Initial version (removed in 4.0)
12.0.0Throttle time (4.0 baseline)
22.4.0Flexible versions
32.7.0Top-level error code
43.5.0Total/usable bytes (KIP-827)
DescribeLogDirsRequest =>
topics: [Topic]
Topic =>
topic: STRING
partitions: [INT32]
FieldTypeDescription
topicsARRAYTopics to query (null for all)
DescribeLogDirsResponse =>
throttle_time_ms: INT32
error_code: INT16
results: [Result]
Result =>
error_code: INT16
log_dir: STRING
topics: [Topic]
total_bytes: INT64
usable_bytes: INT64
Topic =>
name: STRING
partitions: [Partition]
Partition =>
partition_index: INT32
partition_size: INT64
offset_lag: INT64
is_future_key: BOOLEAN
FieldTypeDescription
log_dirSTRINGLog directory path
total_bytesINT64Total size of the log volume (excludes remote storage)
usable_bytesINT64Usable size of the log volume (excludes remote storage)
partition_sizeINT64Partition data size
offset_lagINT64Replication lag (future replicas)

The DescribeCluster API retrieves cluster metadata including controller and broker information.

VersionKafkaKey Changes
03.0.0Initial version
13.4.0EndpointType (KIP-919)
23.9.0IncludeFencedBrokers (KIP-1073)
DescribeClusterRequest =>
include_cluster_authorized_operations: BOOLEAN
endpoint_type: INT8
include_fenced_brokers: BOOLEAN
DescribeClusterResponse =>
throttle_time_ms: INT32
error_code: INT16
error_message: NULLABLE_STRING
endpoint_type: INT8
cluster_id: STRING
controller_id: INT32
brokers: [Broker]
cluster_authorized_operations: INT32
Broker =>
broker_id: INT32
host: STRING
port: INT32
rack: NULLABLE_STRING
is_fenced: BOOLEAN

PracticeRationale
Use validate_only before creationCatch errors before commit
Verify topic state after timeoutTimeout does not mean failure
Plan partition count carefullyCannot decrease partitions
Use rack-aware assignmentsImprove fault tolerance
PracticeRationale
Use PREFIXED patterns for hierarchySimplify permission management
Audit ACLs regularlyDetect permission drift
Test ACL changes in non-prodPrevent access issues
Document ACL policiesEnable consistent management
PracticeRationale
Use IncrementalAlterConfigsAvoid replacing all configs
Track config changesEnable rollback
Test config changesPrevent cluster issues
Use describe before alterUnderstand current state