Get Secrets - Get Secrets

List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list permission.

GET {vaultBaseUrl}/secrets?api-version=7.0
GET {vaultBaseUrl}/secrets?maxresults={maxresults}&api-version=7.0

URI Parameters

Name In Required Type Description
vaultBaseUrl
path True
  • string

The vault name, for example https://myvault.vault.azure.net.

maxresults
query
  • integer
int32

Maximum number of results to return in a page. If not specified, the service will return up to 25 results.

api-version
query True
  • string

Client API version.

Responses

Name Type Description
200 OK

A response message containing a list of secrets in the vault along with a link to the next page of secrets.

Other Status Codes

Key Vault error response describing why the operation failed.

Examples

GetSecrets

Sample Request

GET {vaultBaseUrl}/secrets?maxresults=1&api-version=7.0

Sample Response

{
  "value": [
    {
      "contentType": "plainText",
      "id": "https://testvault1021.vault.azure.net/secrets/listsecrettest0",
      "attributes": {
        "enabled": true,
        "created": 1482189047,
        "updated": 1482189047
      }
    }
  ],
  "nextLink": "https://testvault1021.vault.azure.net:443/secrets?api-version=7.0&$skiptoken=eyJOZXh0TWFya2VyIjoiMiE4OCFNREF3TURJeUlYTmxZM0psZEM5TVNWTlVVMFZEVWtWVVZFVlRWREVoTURBd01ESTRJVEl3TVRZdE1USXRNVGxVTWpNNk1UQTZORFV1T0RneE9ERXhNRm9oIiwiVGFyZ2V0TG9jYXRpb24iOjB9&maxresults=1"
}

Definitions

DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval.

Error

The key vault server error.

KeyVaultError

The key vault error exception.

SecretAttributes

The secret management attributes.

SecretItem

The secret item containing secret metadata.

SecretListResult

The secret list result.

DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for keys in the current vault. If it contains 'Purgeable' the key can be permanently deleted by a privileged user; otherwise, only the system can purge the key, at the end of the retention interval.

Name Type Description
Purgeable
  • string
Recoverable
  • string
Recoverable+ProtectedSubscription
  • string
Recoverable+Purgeable
  • string

Error

The key vault server error.

Name Type Description
code
  • string

The error code.

innererror

The key vault server error.

message
  • string

The error message.

KeyVaultError

The key vault error exception.

Name Type Description
error

The key vault server error.

SecretAttributes

The secret management attributes.

Name Type Description
created
  • integer

Creation time in UTC.

enabled
  • boolean

Determines whether the object is enabled.

exp
  • integer

Expiry date in UTC.

nbf
  • integer

Not before date in UTC.

recoveryLevel

Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval.

updated
  • integer

Last updated time in UTC.

SecretItem

The secret item containing secret metadata.

Name Type Description
attributes

The secret management attributes.

contentType
  • string

Type of the secret value such as a password.

id
  • string

Secret identifier.

managed
  • boolean

True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true.

tags
  • object

Application specific metadata in the form of key-value pairs.

SecretListResult

The secret list result.

Name Type Description
nextLink
  • string

The URL to get the next set of secrets.

value

A response message containing a list of secrets in the key vault along with a link to the next page of secrets.