Batch Deleting Topics of a Kafka Instance

Updated on 2025-05-21 GMT+08:00

Function

This API is used to delete multiple topics of a Kafka instance in batches. If some topics are deleted successfully while some fail to be deleted, a success response is returned with information about topics that fail to be deleted.

Calling Method

For details, see Calling APIs.

URI

POST /v2/{project_id}/instances/{instance_id}/topics/delete

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description:

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

Constraints:

N/A

Value range:

N/A

Default value:

N/A

instance_id

Yes

String

Parameter description:

Instance ID. To obtain it, log in to the Kafka console and find the instance ID on the Kafka instance details page.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

topics

No

Array of strings

Parameter description:

Topics to delete.

Constraints:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

topics

Array of topics objects

Parameter description:

Topic list.

Table 4 topics

Parameter

Type

Description

id

String

Parameter description:

Topic name.

Value range:

N/A

success

Boolean

Parameter description:

Indicates whether the deletion is successful.

Value range:

  • true: Yes

  • false: No

Example Requests

Batch deleting topics

POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/topics/delete

{
  "topics" : [ "topic01" ]
}

Example Responses

Status code: 200

The deletion is successful.

{
  "topics" : [ {
    "id" : "topic01",
    "success" : true
  } ]
}

Status Codes

Status Code

Description

200

The deletion is successful.

Error Codes

See Error Codes.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback