Last updated: 2019-12-14 14:05:33

1. API Description

API domain name:

This API describes the details for customer master keys (CMKs) based on the specified Offset and Limit value.

API request rate limit: 100 requests/sec.

2. Input Parameters

The list below contains only the API request parameters and certain common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter. The value used for this API: ListKeyDetail
Version Yes String Common parameter. The version of this API: 2019-01-18
Region Yes String Common parameter. For more information, see the List of Regions supported by the product.
Offset No Integer This parameter is the same as Offset in SQL, indicating the starting point to return rows from an ordered result set. Default value is 0
Limit No Integer This parameter has the same meaning of the Limit in an SQL query, indicating that up to "Limit value" elements can be obtained this time. The default value is 10 and the maximum value is 200
Role No Integer Filter by creator role. 0 (default value): the CMK is created by the user; 1: the CMK is created automatically by an authorized Tencent Cloud product
OrderType No Integer Sort by CMK creation time. 0: descending; 1: ascending
KeyState No Integer Filter by CMK status. 0: all CMKs; 1: enabled CMKs only; 2: disabled CMKs only
SearchKeyAlias No String Perform a fuzzy query by KeyId or Alias

3. Output Parameters

Parameter name Type Description
TotalCount Integer Total number of CMKs
KeyMetadatas Array of KeyMetadata Returned attribute information list
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String Unique ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Examples

Example 1. Getting CMK List Details

Input Sample Code
&<Common request parameter>

Output Sample Code

  "Response": {
    "RequestId": "1b580852-1e38-11e9-b129-5cb9019b4b00",
    "KeyMetadatas": [
        "KeyId": "23e80852-1e38-11e9-b129-5cb9019b4b01",
        "Alias": "myalias",
        "CreateTime": 1548210729,
        "Description": "test cmk",
        "KeyState": "Enabled",
        "KeyUsage": "ENCRYPT_DECRYPT",
        "Type": 1,
        "CreatorUin": 1001,
        "KeyRotationEnabled": true,
        "Owner": "user",
        "NextRotateTime": 1553151489
        "KeyId": "23e80852-1e38-11e9-b129-5cb9019b4b02",
        "Alias": "testalias",
        "CreateTime": 1548210730,
        "Description": "test cmk",
        "KeyState": "Disabled",
        "KeyUsage": "ENCRYPT_DECRYPT",
        "Type": 1,
        "CreatorUin": 1001,
        "KeyRotationEnabled": true,
        "Owner": "user",
        "NextRotateTime": 1553151489
    "TotalCount": 100

5. Developer Resources

API Explorer

*This tool makes it easy for you to call Tencent Cloud APIs, authenticate signature, generate SDK codes, and search for APIs. *

6. Error Codes

The following only lists the error codes related to this API. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error.
InvalidParameter Incorrect parameter.
UnauthorizedOperation Unauthorized operation.