v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1422123151.4 KB

Lists the secrets that are stored by Secrets Manager in the Amazon Web Services account, not including secrets that are marked for deletion. To see secrets marked for deletion, use the Secrets Manager console.

ListSecrets is eventually consistent, however it might not reflect changes from the last five minutes. To get the latest information for a specific secret, use DescribeSecret.

To list the versions of a secret, use ListSecretVersionIds.

To get the secret value from SecretString or SecretBinary, call GetSecretValue.

For information about finding secrets in the console, see Find secrets in Secrets Manager.

Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see Logging Secrets Manager events with CloudTrail.

Required permissions: secretsmanager:ListSecrets. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.

post/#X-Amz-Target=secretsmanager.ListSecrets

Query parameters

MaxResultsstring

Pagination limit

NextTokenstring

Pagination token

Headers

X-Amz-Target'secretsmanager.ListSecrets' required

Request body

IncludePlannedDeletionboolean

Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.

MaxResultsinteger
<p>The number of results to include in the response.</p> <p>If there are more results available, in the response, Secrets Manager includes <code>NextToken</code>. To get the next results, call <code>ListSecrets</code> again with the value from <code>NextToken</code>.</p>
NextTokenstring

A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call <code>ListSecrets</code> again with this value.

SortOrder'asc' | 'desc'

Secrets are listed by <code>CreatedDate</code>.

Response

Success

NextTokenstring

Secrets Manager includes this value if there's more output available than what is included in the current response. This can occur even when the response includes no values at all, such as when you ask for a filtered view of a long list. To get the next results, call <code>ListSecrets</code> again with this value.

Example response

{
  "SecretList": [
    {
      "ARN": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3",
      "Description": "My test database secret",
      "LastChangedDate": 1523477145.729,
      "Name": "MyTestDatabaseSecret",
      "SecretVersionsToStages": {
        "EXAMPLE1-90ab-cdef-fedc-ba987EXAMPLE": [
          "AWSCURRENT"
        ]
      }
    },
    {
      "ARN": "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret1-d4e5f6",
      "Description": "Another secret created for a different database",
      "LastChangedDate": 1523482025.685,
      "Name": "MyTestDatabaseSecret1",
      "SecretVersionsToStages": {
        "EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE": [
          "AWSCURRENT"
        ]
      }
    }
  ]
}