Skip to content

Secret version management

Each secret value is a numbered version. This page covers version lifecycle, destroying individual versions, and deleting entire secrets.

Version lifecycle

Create secret → version 1 (current)
    │
    ├─ putSecretValue → version 2 (current), version 1 (readable)
    │
    ├─ putSecretValue → version 3 (current), versions 1–2 (readable)
    │
    ├─ getSecretValue → read current or any readable version
    │
    ├─ destroySecretVersion → version N marked destroyed (unreadable)
    │
    └─ deleteSecret → all versions removed, path available for reuse

Current version

The latest active version is marked with stage current. When you call getSecretValue without specifying a version, the current version is returned.

Each putSecretValue increments currentVersion and advances the current stage to the new revision.

Version history

Retrieve version history without values:

GET /v1/secrets/{region}/secret/app/production/db/password?includeVersions=true

The response includes per-version metadata:

FieldDescription
versionVersion number
statusactive or destroyed
stagecurrent for the latest active version
valueFormatstring or keyValue
createdAtCreation timestamp
lastAccessedAtLast successful reveal timestamp

Destroyed versions remain in history for audit purposes but cannot be decrypted.

Destroy a version

Mark a specific version as destroyed:

DELETE /v1/secrets/{region}/secret/app/production/db/password/versions?version=2

After destruction:

  • The version value cannot be read again
  • Other versions and the secret container are unaffected
  • The version remains in history with status destroyed
  • Billing for that version stops

Requires delete permission on the path.

When to destroy versions

After rotating a secret:

  1. Add the new version with putSecretValue
  2. Confirm all consumers use the new value
  3. Destroy superseded versions to limit exposure and reduce version storage billing

Do not destroy the current version while applications still depend on it.

Delete a secret

Delete the entire secret and all its versions:

DELETE /v1/secrets/{region}/secret/app/production/db/password

This is a soft delete from the customer’s perspective:

  • The secret and all versions are removed
  • The path becomes available for reuse
  • There is no cancel-deletion or recovery API

Treat delete as permanent. Requires delete permission on the path.

Before deleting a secret, confirm no applications, CI pipelines, or integrations still reference the path.

KMS key lifecycle interaction

KMS key stateMetadata APIsgetSecretValue / putSecretValue
active
disabled✗ (400)
pending_deletion✗ (400)

Disabling or deleting a KMS key breaks secret value operations for secrets bound to that key. Metadata remains readable. See KMS integration.

Billing impact

ActionBilling effect
Create secretVersion 1 is billable
putSecretValueNew version is billable
destroySecretVersionBilling stops for that version
deleteSecretBilling stops for all versions

See Billing for metering details.

Related documentation