Alter client quotas for the specified entities.
Sets or removes quota configuration keys for the given entity targets.
The AlterClientQuotas request payload.
The per-entity alteration results.
Alter configuration for specified resources.
This is a non-incremental set: all config keys must be provided. Omitted keys revert to their defaults.
The AlterConfigs request payload.
Per-resource results.
Initiate, cancel, or modify partition replica reassignments.
The AlterPartitionReassignments request payload.
Per-topic/partition reassignment results.
Move topic-partition replicas between log directories on a broker.
The AlterReplicaLogDirs request payload.
Per-topic results with per-partition error codes.
Alter SCRAM credentials for users.
Creates, updates, or deletes SCRAM credentials. Use upsertions to create or update credentials and deletions to remove them.
The AlterUserScramCredentials request payload.
The per-user alteration results.
Close the admin client.
After closing, no more operations can be performed.
Create one or more ACL bindings.
The CreateAcls request payload.
Per-creation results with error codes.
Create a new delegation token.
Delegation tokens enable lightweight authentication for Kafka clients without requiring each client to have Kerberos credentials or TLS certificates.
The CreateDelegationToken request payload.
The created token details including HMAC and timestamps.
Create additional partitions for existing topics.
The CreatePartitions request payload.
Per-topic results.
Create one or more topics.
The CreateTopics request payload.
Per-topic results.
Delete ACL bindings matching the specified filters.
ACL deletion filters. Each filter matches and deletes ACL bindings.
Per-filter results with matching deleted ACLs.
Delete one or more consumer groups.
Groups must be empty (no active members) to be deleted.
The DeleteGroups request payload.
Per-group deletion results.
Delete records from topic partitions up to specified offsets.
Records before the specified offset in each partition are deleted (the log start offset is advanced). Use offset -1 to delete up to the high watermark.
The DeleteRecords request payload.
Per-topic/partition deletion results.
Delete one or more topics.
The DeleteTopics request payload.
Per-topic results.
Describe ACL bindings matching the specified filter.
The DescribeAcls request payload (filter criteria).
ACL resources matching the filter.
Describe client quotas matching the given entity filters.
Returns quota configuration entries for entities matching all the specified component filters.
The DescribeClientQuotas request payload.
The matching quota entries, or an empty array if none match.
Describe the cluster including broker endpoints and authorised operations.
The DescribeCluster request payload.
The cluster description.
Describe configuration for specified resources.
The DescribeConfigs request payload.
Per-resource config results.
Describe delegation tokens.
Returns delegation tokens matching the specified owner principals.
Pass null owners to describe all tokens the requester can see.
The DescribeDelegationToken request payload.
The described delegation tokens.
Describe one or more consumer groups.
Returns detailed metadata about each group including state, protocol, members, and their current assignments.
The DescribeGroups request payload.
Per-group descriptions.
Describe log directories on the broker.
Returns per-log-directory information including topic-partition sizes
and offset lag. Use null topics to describe all.
The DescribeLogDirs request payload.
Per-log-directory results.
Describe active producers on specified topic partitions.
The DescribeProducers request payload.
Per-topic producer results.
Describe the KRaft quorum state for controller partitions.
The DescribeQuorum request payload.
The quorum description.
Describe topic partitions with pagination support.
Designed for large clusters where the standard Metadata API may be too
heavy. Supports cursored pagination via responsePartitionLimit and cursor.
The DescribeTopicPartitions request payload.
The response including topic partitions and next cursor.
Describe specific topics using the Metadata API.
Topic names to describe.
Topic metadata including partitions and leaders.
Describe the state of active transactions by transactional ID.
The DescribeTransactions request payload.
Per-transaction state results.
Describe SCRAM credentials for users.
Returns the SCRAM credential information (mechanism and iteration count) for the specified users, or all users if no filter is given.
The DescribeUserScramCredentials request payload.
The per-user SCRAM credential results.
Trigger a preferred or unclean leader election for specified partitions.
The ElectLeaders request payload.
Per-topic/partition election results.
Expire a delegation token.
Changes the expiry time of the token. Use a negative
expiryTimePeriodMs to expire the token immediately.
The ExpireDelegationToken request payload.
The expiry response including the final expiry timestamp.
Incrementally alter configuration for specified resources.
Unlike alterConfigs, this only modifies the specified config entries — unmentioned keys are left unchanged.
The IncrementalAlterConfigs request payload.
Per-resource results.
List all consumer groups known to the broker.
The ListGroups request payload. Pass {} for no filter.
Listed groups.
List ongoing partition replica reassignments.
The ListPartitionReassignments request payload.
Per-topic ongoing reassignment state.
List all topics in the cluster.
Uses the Metadata API with a null topics list to discover all topics.
Internal topics (e.g. __consumer_offsets) are included.
Array of topic info objects.
List active transactions on the broker.
The ListTransactions request payload. Pass {} for no filter.
The list transactions response including error code and transaction states.
Renew an existing delegation token.
Extends the expiry time of the token. The caller must be a permitted renewer of the token.
The RenewDelegationToken request payload.
The renewed token response including the new expiry timestamp.
Update finalized feature flags in the cluster.
The UpdateFeatures request payload.
The update features response.
Kafka admin client.
Performs administrative operations on topics and cluster configuration. Operates through the ConnectionPool and negotiates API versions automatically.
Example