Help Center/ Simple Message Notification/ API Reference/ APIs/ Key Management/ Deleting the KMS Key Bound to a Topic
Updated on 2025-11-21 GMT+08:00

Deleting the KMS Key Bound to a Topic

Function

This API is used to delete the key bound to a topic.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    smn:topic:deleteKmsKey

    Write

    topic *

    • g:EnterpriseProjectId

    • g:ResourceTag/<tag-key>

    -

    • smn:topic:get
    • smn:topic:getKmsKey

URI

DELETE /v2/{project_id}/notifications/topics/{topic_urn}/kms/{id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

The project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

topic_urn

Yes

String

Unique resource identifier of a topic. To obtain the resource identifier, see Querying Topics.

id

Yes

String

The ID of the resource that has been bound to the key.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies a user token.

It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

request_id

String

The unique request ID.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID, which is unique.

code

String

Specifies the error code.

message

String

Describes the error message.

Example Requests

Example for a successful request

https://{SMN_Endpoint}/v2/{project_id}/notifications/topics/urn:smn:regionId:44ef0bd78eb24f02b40614fe85a7d234:topic_6253fdb3904211f0b78284a93e8ae4b6/kms/1ce8715843c34abb9dece60b49d2feb9

Example Responses

Status code: 200

Response body returned when the request succeeded.

{
  "request_id" : "8d26f183dbb0436cb74634c0867a051b"
}

Status code: 400

Bad Request

{
  "request_id" : "e1e39d73d4d6409998fffc846b7e8850",
  "error_code" : "SMN.00013056",
  "error_msg" : "The kms key id is not available."
}

Status Codes

Status Code

Description

200

Response body returned when the request succeeded.

400

Bad Request

Error Codes

See Error Codes.