All Products
Search
Document Center

Key Management Service:ListSecretVersionIds

Last Updated:Jul 31, 2026

Queries all version information of a secret.

Operation description

  • For details about the access policy required for a Resource Access Management (RAM) user or RAM role to invoke this operation, refer to Access control.

  • Version information does not include secret values. By default, only secret versions that have version stages are returned.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

SecretName

string

Yes

The secret name or secret Amazon Resource Name (ARN).

Note

When accessing a secret under another Alibaba Cloud account, you must specify the secret ARN. The format of the secret ARN is acs:kms:${region}:${account}:secret/${secret-name}.

secret001

IncludeDeprecated

string

No

Specifies whether to include secret versions that do not have version stages in the response.

Valid values:

  • false (default): does not include

  • true: includes

false

PageNumber

integer

No

The page number of the current page in a paged query. Default value: 1.

1

PageSize

integer

No

The number of entries per page in a paged query. Default value: 20.

10

Response elements

Element

Type

Description

Example

object

SecretName

string

The secret name.

secret001

RequestId

string

The ID of the request. The ID is a unique identifier that Alibaba Cloud generates for the request and can be used to troubleshoot issues.

5b75d8b1-5b6a-4ec0-8e0c-c08befdfad47

PageSize

integer

The page size of the current page.

10

PageNumber

integer

The current page number.

1

TotalCount

integer

The total number of entries.

1

VersionIds

object

VersionId

array<object>

The list of secret version information.

array<object>

The list of secret version information.

VersionId

string

The version number.

v1

CreateTime

string

The time when the version was created.

2024-02-21T15:39:26Z

VersionStages

object

VersionStage

array

The stage labels of the version.

string

The stage labels of the version.

{"VersionStage": ["ACSCurrent","uStage1"]}

Examples

Success response

JSON format

{
  "SecretName": "secret001",
  "RequestId": "5b75d8b1-5b6a-4ec0-8e0c-c08befdfad47",
  "PageSize": 10,
  "PageNumber": 1,
  "TotalCount": 1,
  "VersionIds": {
    "VersionId": [
      {
        "VersionId": "v1",
        "CreateTime": "2024-02-21T15:39:26Z",
        "VersionStages": {
          "VersionStage": [
            "{\"VersionStage\": [\"ACSCurrent\",\"uStage1\"]}"
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter some of the specified parameters "\" is not valid
500 InternalFailure Internal Failure
403 Forbidden.NoPermission This operation is forbidden by permission system
404 Forbidden.ResourceNotFound Resource not found

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.