Get Deleted Keys - Get Deleted Keys

Lists the deleted keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a deleted key. This operation includes deletion-specific information. The Get Deleted Keys operation is applicable for vaults enabled for soft-delete. While the operation can be invoked on any vault, it will return an error if invoked on a non soft-delete enabled vault. This operation requires the keys/list permission.

GET {vaultBaseUrl}/deletedkeys?api-version=7.1
GET {vaultBaseUrl}/deletedkeys?maxresults={maxresults}&api-version=7.1

URI Parameters

Name In Required Type Description
vaultBaseUrl
path True
  • string

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

api-version
query True
  • string

Client API version.

maxresults
query
  • integer
int32

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

Responses

Name Type Description
200 OK

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

Other Status Codes

Key Vault error response describing why the operation failed.

Examples

GetDeletedKeys

Sample Request

GET https://myvault.vault.azure.net//deletedkeys?maxresults=1&api-version=7.1

Sample Response

{
  "value": [
    {
      "recoveryId": "https://myvault.vault.azure.net/deletedkeys/listdeletedkeytest0",
      "deletedDate": 1493938031,
      "scheduledPurgeDate": 1501714031,
      "kid": "https://myvault.vault.azure.net/keys/listdeletedkeytest0",
      "attributes": {
        "enabled": true,
        "created": 1493938031,
        "updated": 1493938031,
        "recoveryLevel": "Recoverable+Purgeable"
      }
    }
  ],
  "nextLink": "https://myvault.vault.azure.net:443/deletedkeys?api-version=7.1&$skiptoken=eyJOZXh0TWFya2VyIjoiMiExMzYhTURBd01EVTJJV3RsZVM5TVNWTlVSRVZNUlZSRlJFdEZXVlJGVTFRd0x6RkRRa0ZGTkVaQk5qQTBNelJGTmtZNE9FUXdORE5GTkRFM09FUkNPVFE1SVRBd01EQXlPQ0V5TURFM0xUQTFMVEEwVkRJeU9qUTNPakU1TGpVeU1UZ3dPVEZhSVEtLSIsIlRhcmdldExvY2F0aW9uIjowfQ&maxresults=1"
}

Definitions

DeletedKeyItem

The deleted key item containing the deleted key metadata and information about deletion.

DeletedKeyListResult

A list of keys that have been deleted in this vault.

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.

KeyAttributes

The attributes of a key managed by the key vault service.

KeyVaultError

The key vault error exception.

DeletedKeyItem

The deleted key item containing the deleted key metadata and information about deletion.

Name Type Description
attributes

The key management attributes.

deletedDate
  • integer

The time when the key was deleted, in UTC

kid
  • string

Key identifier.

managed
  • boolean

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

recoveryId
  • string

The url of the recovery object, used to identify and recover the deleted key.

scheduledPurgeDate
  • integer

The time when the key is scheduled to be purged, in UTC

tags
  • object

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

DeletedKeyListResult

A list of keys that have been deleted in this vault.

Name Type Description
nextLink
  • string

The URL to get the next set of deleted keys.

value

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

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
CustomizedRecoverable
  • string

Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval and while the subscription is still available.

CustomizedRecoverable+ProtectedSubscription
  • string

Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7<= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled.

CustomizedRecoverable+Purgeable
  • string

Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription is cancelled.

Purgeable
  • string

Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.)

Recoverable
  • string

Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not recovered

Recoverable+ProtectedSubscription
  • string

Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered

Recoverable+Purgeable
  • string

Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered

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.

KeyAttributes

The attributes of a key managed by the key vault service.

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.

recoverableDays
  • integer

softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0.

recoveryLevel

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.

updated
  • integer

Last updated time in UTC.

KeyVaultError

The key vault error exception.

Name Type Description
error

The key vault server error.