Calls the ListKeys operation to query the IDs of all cmks in the region where you call the operation.


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 ListKeys

The operation that you want to perform. Value: ListKeys

PageNumber Integer Optional 1

The number of the page to return.

Value range: greater than 0.

Default value: 1.

PageSize  Integer Optional 10

The number of entries returned on each page.

Valid values: 1 to 100.

Default value: 10.

Response parameters

Prameter Type Sample response Description
TotalCount Integer   3

The total number of cmks.

PageNumber Integer   1

The number of the page to return.

PageSize  Integer 10

The number of entries returned on each page.

RequestId String 1050b8f1-b264-496 d-a782-6299cbaf15f8

The ID of the request.

Keys Array

The CMK.

KeyId String 08 c33a6 f-4e0a-4a1b-a3fa-7ddfa1d4 function compute instance *

The globally unique ID of the CMK.

KeyArn String acs:kms:cn-hangzhou:123456:key/80e9409f-78fa-42ab-84bd-83f40c81****

The ARN of the CMK.


Sample requests Action=ListKeys
&<Common request parameters>

Sample success responses

XML format

//xml response

JSON format

//json response
        "Keys": {
                "Key": [
                                "KeyId": "80e9409f-78fa-42ab-84bd-83f40c81****",
				                "KeyArn": "acs:kms:cn-hangzhou:123456:key/80e9409f-78fa-42ab-84bd-83f40c81****"                        
                                "KeyId": "8fbb1226-a06f-4c57-8887-daa5b627****",
				                "KeyArn": "acs:kms:cn-hangzhou:123456:key/8fbb1226-a06f-4c57-8887-daa5b627****"
                "TotalCount": 3,
        "PageNumber": 1,
        "PageSize": 10,
        "RequestId": "bc29ec35-3373-48d1-8202-520fd78d****"

Error codes

HTTP status code Error code Error message Description 
400 Throttling Request was denied due to request throttling. This message returned because your traffic in this period has exceeded the limit. If your business requirements are not met, submit a ticket.

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