All Products
Search
Document Center

Key Management Service:DisableKey

Last Updated:Aug 28, 2026

Disables a customer master key (CMK) so that it cannot be used for cryptographic operations.

Operation description

After a CMK is disabled, ciphertext encrypted with this CMK cannot be decrypted until you call the EnableKey operation to re-enable it.

In this example, the CMK whose ID is 1234abcd-12ab-34cd-56ef-12345678**** is disabled.

For information about the access policy required for a RAM user or RAM role to call this operation, 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 ID of the CMK. The ID must be globally unique.

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

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

2fe70ce2-3303-4fd6-b3ac-472fb2705c62

Examples

Success response

JSON format

{
  "RequestId": "2fe70ce2-3303-4fd6-b3ac-472fb2705c62"
}

Error response

JSON format

//xml response

    2fe70ce2-3303-4fd6-b3ac-472fb2705c62

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified parameter is not valid. The specified parameter value is invalid.
404 Forbidden.KeyNotFound The specified Key is not found. The specified CMK was not found.
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.