tencent cloud

APIs

ListSecrets

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-11-30 19:10:24

1. API Description

Domain name for API request: ssm.intl.tencentcloudapi.com.

This API is used to obtain a detailed list of all credentials. You can specify filter fields, sorting methods, and so on.

A maximum of 30 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: ListSecrets.
Version Yes String Common Params. The value used for this API: 2019-09-23.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Offset No Integer

Start position of the query list, starting from 0. The default value is 0 if not set.

Limit No Integer

Maximum number of results returned for a single query. The default value is 20 if it is set to 0 or not set.

OrderType No Integer

Sorting method by creation time. The default value is 0, which indicates descending order. 1 indicates ascending order.

State No Integer

Filters by credential status.
The default value is 0, which indicates querying all.
1 -- Indicates querying the list of Enabled credentials.
2 -- Indicates querying the list of Disabled credentials.
3 -- Indicates querying the list of PendingDelete credentials.
4 -- Indicates PendingCreate.
5 -- Indicates CreateFailed.
The PendingCreate and CreateFailed statuses only take effect when SecretType is a cloud product credential.

SearchSecretName No String

Filters by credential name. An empty value indicates no filtering.

TagFilters.N No Array of TagFilter

Tag filter condition.

SecretType No Integer

0 -- Indicates a user-defined credential. The default value is 0.
1 -- Indicates a user cloud product credential.
2 -- Indicates an SSH key pair credential.
3 -- Indicates a cloud API key pair credential.

ProductName No String

This parameter only takes effect when the SecretType parameter value is 1.
When the SecretType value is 1:
If the ProductName value is empty, it indicates querying all types of cloud product credentials.
If the ProductName value is a specified cloud product value such as Mysql, it indicates querying Mysql database credentials.
If the ProductName value contains multiple cloud product values, such as Mysql,Tdsql-mysql,Tdsql_C_Mysql (multiple values separated by commas), it indicates querying credentials of three cloud product types.
For the supported cloud product list, call the DescribeSupportedProducts API.

EncryptType No Integer

Credential encryption type

Valid values:

  • 0: KMS key encryption
  • 1: Soft key encryption

Default value: 0

InstanceID No String

Cloud product instance ID

3. Output Parameters

Parameter Name Type Description
TotalCount Integer

Total number of credentials filtered by State and SearchSecretName.

SecretMetadatas Array of SecretMetadata

Returns the list of credential information.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Getting the Credential List Based on Filter Criteria

Input Example

POST / HTTP/1.1
Host: ssm.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ListSecrets
<Common request parameters>

{}

Output Example

{
    "Response": {
        "SecretMetadatas": [
            {
                "AssociatedInstanceIDs": [],
                "CreateTime": 1784724042,
                "CreateUin": 700000579952,
                "CreateUinString": "700000579952",
                "DeleteTime": 0,
                "Description": "",
                "EncryptSwitching": false,
                "EncryptType": 0,
                "KmsKeyId": "31da3478-85b2-11f1-9b54-525400f44230",
                "KmsKeyType": "CUSTOMER",
                "NextRotationTime": 0,
                "ProductName": "default",
                "ProjectID": 0,
                "ResourceID": "251237300_700000579952_customize_1784724042855182311_RcI",
                "ResourceName": "",
                "RotationBeginTime": "",
                "RotationFrequency": 0,
                "RotationStatus": 0,
                "SecretName": "x1_003",
                "SecretType": 0,
                "Status": "Enabled",
                "TargetUin": 0,
                "TargetUinString": "0"
            }
        ],
        "TotalCount": 3,
        "RequestId": "2b80ea44-668c-456f-b298-2bdef4374efc"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

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

Error Code Description
FailedOperation Operation failed.
InternalError Internal error.
InvalidParameterValue Parameter value error.
ResourceUnavailable.NotPurchased The service has not been purchased.
UnauthorizedOperation Unauthorized operation.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백