All Products
Search
Document Center

Key Management Service:ListKeyVersions

Last Updated:Jul 29, 2025

Queries all versions of a key.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
KeyIdstringYes

The globally unique ID of the CMK. You can also set this parameter to an alias that is bound to the CMK. For more information, see Use aliases.

0b30658a-ed1a-4922-b8f7-a673ca9c****
PageNumberintegerNo

The number of the page to return.

Pages start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page.

Valid values: 0 to 101.

Default value: 10.

10

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The number of entries returned per page.

10
RequestIdstring

The ID of the request.

f71204c4-53cd-4eea-b405-653ba2db7e86
PageNumberinteger

The page number of the returned page.

1
TotalCountinteger

The total number of returned key versions.

3
KeyVersionsarray<object>

An array that consists of key versions.

KeyVersionobject
KeyIdstring

The globally unique ID of the CMK.

Note If you set the KeyId parameter to the alias of the CMK, the ID of the CMK to which the alias is bound is returned.
0b30658a-ed1a-4922-b8f7-a673ca9c****
KeyVersionIdstring

The globally unique ID of the CMK version.

1e3304fd-68ac-4d5b-8886-ae5f01a1****
CreationDatestring

The date and time when the CMK version was created. The time is displayed in UTC.

2016-03-25T10:42:40Z

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "f71204c4-53cd-4eea-b405-653ba2db7e86",
  "PageNumber": 1,
  "TotalCount": 3,
  "KeyVersions": {
    "KeyVersion": [
      {
        "KeyId": "0b30658a-ed1a-4922-b8f7-a673ca9c****",
        "KeyVersionId": "1e3304fd-68ac-4d5b-8886-ae5f01a1****",
        "CreationDate": "2016-03-25T10:42:40Z"
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.