Updated on 2025-12-31 GMT+08:00

Obtaining Kafka Topic Details

Function

This API is used to obtain Kafka topic details.

Calling Method

For details, see Calling APIs.

URI

GET /v2/kafka/{project_id}/instances/{instance_id}/topics-detail/{topic}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID. You can call the API for querying all instances to obtain the instance ID. The instance ID is in the response body.

Constraints

N/A

Range

N/A

Default Value

N/A

topic

Yes

String

Definition

Topic name.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

topic

String

Definition

Topic name.

Range

N/A

create_time

Long

Definition

Creation time.

Range

N/A

partitions

Array of partitions objects

Definition

Partition list.

Table 3 partitions

Parameter

Type

Description

partition

Integer

Definition

Partition ID.

Range

N/A

leader

Integer

Definition

ID of the broker where the leader replica resides.

Range

N/A

replicas

Array of integers

Definition

Replica list.

Example Requests

GET https://{endpoint}/v2/kafka/{project_id}/instances/{instance_id}/topics-detail/{topic}

Example Responses

Status code: 200

Kafka topic details obtained.

[ {
  "topic" : "topic-test",
  "create_time" : 1763447003740,
  "partitions" : [ {
    "partition" : 0,
    "leader" : 2,
    "replicas" : [ 2 ]
  }, {
    "partition" : 1,
    "leader" : 0,
    "replicas" : [ 0 ]
  }, {
    "partition" : 2,
    "leader" : 1,
    "replicas" : [ 1 ]
  } ]
} ]

Status Codes

Status Code

Description

200

Kafka topic details obtained.

Error Codes

See Error Codes.