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

Deleting a Kafka Message

Function

This API is used to delete a Kafka message.

This API is out-of-date and may not be maintained in the future. Please use the API described in Deleting a Kafka Message.

URI

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

Table 1 URI 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

Table 2 Request body parameter

Parameter

Mandatory

Type

Description

partitions

No

Array of PartitionOffsetEntity objects

Details of the partition consumer offset.

Table 3 PartitionOffsetEntity

Parameter

Mandatory

Type

Description

partition

No

Integer

Partition.

offset

No

Integer

Consumer offset.

Response

Status code: 200

Table 4 Response body parameter

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 Request

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

{
  "partitions" : [ {
    "partition" : 0,
    "offset" : 1
  } ]
}

Example Response

Status code: 200

Message deleted.

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

Status Code

Code

Description

200

Message deleted.

Error Code

See Error Codes.