All Products
Search
Document Center

Key Management Service:GetManagedDataKey

Last Updated:Jul 22, 2026

Retrieves the plaintext of a managed data key (DK).

Operation description

For information about the access policy that must be granted to a RAM user or RAM role to call this operation, refer to access control.

This operation can be called through a shared gateway. For more information, refer to Alibaba Cloud SDK.

  • Shared gateway: Access KMS through public or VPC endpoints.

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 syntax

GET  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

DataKeyName

string

No

The name of the managed data key (DK). This parameter is required.

example-data-key

DataKeyVersionId

string

No

The version number of the managed data key (DK). This parameter is optional. If you set this parameter to a specific version number, the plaintext of the specified version of the managed data key (DK) is returned.

xH6OPUmz

UseLatest

boolean

No

Specifies whether to use the latest version of the managed data key (DK) when no version number is provided. Valid values:

  • true: Returns the latest version of the managed data key (DK).

  • false: Returns the first version of the managed data key (DK).

Default value: false.

true

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID. Alibaba Cloud generates a unique identifier for each request. You can use the request ID to troubleshoot issues.

4bd560a1-729e-45f1-a3d9-b2a33d61046b

DataKeyName

string

The name of the managed data key (DK).

example-data-key

DataKeyVersionName

string

The credential name that stores the key material of the returned managed data key (DK) version.

kms-datakeyversion!example-data-key!xH6OPUmz

DataKeyVersionId

string

The version number of the returned managed data key (DK).

xH6OPUmz

Plaintext

string

The Base64-encoding plaintext value of the data key (DK).

CYueyVmZJ2MfA1VSZV2jCbFT8bO7StAvBnHacplr9aI=

Examples

Success response

JSON format

{
  "RequestId": "4bd560a1-729e-45f1-a3d9-b2a33d61046b",
  "DataKeyName": "example-data-key",
  "DataKeyVersionName": "kms-datakeyversion!example-data-key!xH6OPUmz",
  "DataKeyVersionId": "xH6OPUmz\n",
  "Plaintext": "CYueyVmZJ2MfA1VSZV2jCbFT8bO7StAvBnHacplr9aI="
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.