Deleting a Kafka Message

Updated on 2025-03-07 GMT+08:00

Function

This API is used to delete a Kafka message.

Calling Method

For details, see Calling APIs.

URI

DELETE /v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/messages

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

instance_id

Yes

String

Instance ID.

topic

Yes

String

Topic name.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

partitions

No

Array of PartitionOffsetEntity objects

Partition offset details.

Table 3 PartitionOffsetEntity

Parameter

Mandatory

Type

Description

partition

No

Integer

Partition.

offset

No

Integer

Consumer offset.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

partitions

Array of PartitionResp objects

Partition response information.

Table 5 PartitionResp

Parameter

Type

Description

partition

Integer

Partition.

result

String

Returned result.

error_code

String

Returned error code.

Example Requests

DELETE https://{endpoint}/v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/messages

Example Responses

Status code: 200

Successful

{
  "partitions" : [ {
    "partition" : 0,
    "result" : "success",
    "error_code" : 0
  } ]
}

Status Codes

Status Code

Description

200

Successful

Error Codes

See Error Codes.

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback