All Products
Search
Document Center

Key Management Service:DeleteKeyMaterial

Last Updated:Mar 12, 2026

Deletes the imported key material from a CMK. After deletion, the CMK enters the PendingImport state until you re-import key material.

Operation description

This operation does not delete the CMK that is created by using the key material.

If the CMK is in the PendingDeletion state, the state of the CMK and the scheduled deletion time do not change after you call this operation. If the CMK is not in the PendingDeletion state, the state of the CMK changes to PendingImport after you call this operation.

After you delete the key material, you can upload only the same key material into the CMK.

For more information about the access policy required by a RAM user or RAM role to call this API, see Resource Access Management.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

KeyId

string

Yes

The globally unique ID of the CMK.

1234abcd-12ab-34cd-56ef-12345678****

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

4162a6af-bc99-40b3-a552-89dcc8aaf7c8

Examples

Success response

JSON format

{
  "RequestId": "4162a6af-bc99-40b3-a552-89dcc8aaf7c8"
}

Error response

JSON format

//xml response

  4162a6af-bc99-40b3-a552-89dcc8aaf7c8

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified parameter is not valid. An invalid value is specified for the parameter.
404 InvalidAccessKeyId.NotFound The Access Key ID provided does not exist in our records.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.