Queries all versions of a specified CMK.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListKeyVersions

The operation that you want to perform. Set the value to ListKeyVersions.

KeyId String Yes 0b30658a-ed1a-4922-b8f7-a673ca9c****

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.

PageNumber Integer Yes 1

The number of the page to return.

Pages start from page 1.

Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Valid values: 0 to 101.

Default value: 10.

Response parameters

Parameter Type Example Description
KeyVersions Array

An array that consists of key versions.

KeyVersion
CreationDate String 2016-03-25T10:42:40Z

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

KeyId String 0b30658a-ed1a-4922-b8f7-a673ca9c****

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.
KeyVersionId String 1e3304fd-68ac-4d5b-8886-ae5f01a1****

The globally unique ID of the CMK version.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

RequestId String f71204c4-53cd-4eea-b405-653ba2db7e86

The ID of the request.

TotalCount Integer 3

The total number of returned key versions.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListKeyVersions
&KeyId=1234abcd-12ab-34cd-56ef-12345678****
&PageNumber=1
&<Common request parameters>

Sample success responses

XML format

<KMS>
          <RequestId>f71204c4-53cd-4eea-b405-653ba2db7e86</RequestId>
          <KeyVersions>
                    <KeyVersion>
                              <KeyId>0b30658a-ed1a-4922-b8f7-a673ca9c****</KeyId>
                              <KeyVersionId>1e3304fd-68ac-4d5b-8886-ae5f01a1****</KeyVersionId>
                              <CreationDate>2019-08-06T10:22:03Z</CreationDate>
                    </KeyVersion>
                    <KeyVersion>
                              <KeyId>0b30658a-ed1a-4922-b8f7-a673ca9c****</KeyId>
                              <KeyVersionId>2ab1a983-7072-4bbc-a582-584b5bd8****</KeyVersionId>
                              <CreationDate>2019-08-06T10:19:18Z</CreationDate>
                    </KeyVersion>
                    <KeyVersion>
                              <KeyId>0b30658a-ed1a-4922-b8f7-a673ca9c****</KeyId>
                              <KeyVersionId>6a69c763-388a-4708-9fc0-4322266b****</KeyVersionId>
                              <CreationDate>2019-08-06T10:17:04Z</CreationDate>
                    </KeyVersion>
          </KeyVersions>
          <TotalCount>3</TotalCount>
          <PageNumber>1</PageNumber>
          <PageSize>10</PageSize>
</KMS>

JSON format

{
    "KMS": {
        "RequestId": "f71204c4-53cd-4eea-b405-653ba2db7e86",
        "KeyVersions": {
            "KeyVersion": [
                {
                    "KeyId": "0b30658a-ed1a-4922-b8f7-a673ca9c****",
                    "KeyVersionId": "1e3304fd-68ac-4d5b-8886-ae5f01a1****",
                    "CreationDate": "2019-08-06T10:22:03Z"
                },
                {
                    "KeyId": "0b30658a-ed1a-4922-b8f7-a673ca9c****",
                    "KeyVersionId": "2ab1a983-7072-4bbc-a582-584b5bd8****",
                    "CreationDate": "2019-08-06T10:19:18Z"
                },
                {
                    "KeyId": "0b30658a-ed1a-4922-b8f7-a673ca9c****",
                    "KeyVersionId": "6a69c763-388a-4708-9fc0-4322266b****",
                    "CreationDate": "2019-08-06T10:17:04Z"
                }
            ]
        },
        "TotalCount": 3,
        "PageNumber": 1,
        "PageSize": 10
    }
}

Error codes

For a list of error codes, visit the API Error Center.