- Documentation
Message Queue for Kafka
API Reference
V2(2022-05-01)
Topic management
DescribeTopicPartitions - View Topic partitions
Topic management
DescribeTopicPartitions - View Topic partitions
DescribeTopicPartitions - View Topic partitions
Call the DescribeTopicPartitions API to get the Topic's partition information.
Instructions
The DescribeTopicPartitions API offers paged queries to view the number of partitions of a specified Topic, partition ISR status, and other details.
Debug
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
Request parameters
Only the unique request parameters of this interface and some common parameters are listed below. For more information, see common parameters. Action string required Example value: DescribeTopicPartitions
Operation to execute, value: DescribeTopicPartitions.
Version string required Example value: 2022-05-01
API version, value: 2022-05-01.
InstanceId string required Example value: kafka-cnngbnntswg1****x
Instance ID.
TopicName string required Example value: my_topic
Topic name.
PageNumber integer required Example value: 1
Page number of the list, minimum value is 1.
PageSize integer required Example value: 10
The number of items per page in the list, ranging from 1 to 100.
PartitionIds integer[] No Example value: [1,2]
Partition ID. If not specified, information for all partitions is returned.
UnderInsyncOnly boolean No Example: true
Query only partitions with unsynced replicas, default is false.
- true: Query only partitions with unsynced replicas.
- false: (default) Query all partitions.
Response parameters
Only the unique response parameters of this API are listed below. For more details, see response structure. Total integer Example value: 2
Total number of partitions matching the query conditions.
PartitionsInfo object[] Example value: --
List of partitions matching the query criteria.
PartitionId integer Example value: 0
Partition number.
Leader integer Example value: 2
Partition leader ID.
Replicas integer[] Example value: [2,0,1]
The replica list of the partition.
InsyncReplicas integer[] Example value: [2, 0, 1]
List of synchronized replicas for the partition.
UnderInsyncReplicas integer[] Example value: []
Out-of-sync replica list.
StartOffset long Example value: 7758654122
Offset of the earliest message currently held by the partition leader.
EndOffset long Example value: 7774940552
The offset of the next message for the partition leader. The current latest message position is EndOffset - 1.
MessageCount long Example value: 16286430
The current number of messages within the partition leader. Where MessageCount = EndOffset - StartOffset.
Request example
POST /?Action=DescribeTopicPartitions&Version=2022-05-01 HTTP/1.1
Content-Type: application/json
Host: kafka.volcengineapi.com
X-Date: 20210328T100802Z
Authorization: HMAC-SHA256 Credential=AK********/20210328/cn-beijing/Kafka/request, SignedHeaders=x-date, Signature=********
"InstanceId": "kafka-cnngbnntswg1****",
"TopicName": "my_topic",
Response example
"RequestId": "2023022720063227B3DCC115F59769D448",
"Action": "DescribeTopicPartitions",
"Version": "2022-05-01",
"EndOffset": 7774940552,
"MessageCount": 16286430,
"StartOffset": 7758654122,
"UnderInsyncReplicas": []
Error code
The following table lists error codes related to this interface and business logic. Refer to the Public error codes section for common error codes.
Last updated: 2025.06.30 12:00:29