Managing Secrets

This feature is currently available only to customers participating in a Private Preview. If you'd like to participate and be among the first to try this feature, ask our support or account team for details.

A secret in Workload Secrets Vault is a set of key/value pairs stored at a path, such as prod/orders/db. Every time you write to a path, Workload Secrets Vault stores a new version of the secret and keeps the earlier versions, so you can roll back a bad change or recover a deleted version.

This topic uses the Workload Secrets Vault CLI. The REST API Reference section lists the matching API calls.

Prerequisites: You need a role with the Workload Secrets Vault secret permissions and a policy that allows the action on the path. See Permissions and Policy Actions.

Secret Paths

A path identifies a secret, and it's also what policies grant access to. Use / to separate the segments of a path, for example team-a/prod/payments-db. Group secrets by team, application, or environment so that a single policy can cover a branch of the tree.

Workload Secrets Vault doesn't enforce naming rules, other than that a path can't be empty. Follow these guidelines when you name secrets:

  • Use lowercase letters, digits, hyphens (-), underscores (_), and periods (.) in each segment.

  • Don't start or end a path with /, and don't use empty segments (//).

  • Keep paths to 500 characters or fewer.

Paths are case-sensitive for storage, but policies match paths without regard to case. Team/DB and team/db are two different secrets that the same policy controls. Use lowercase paths to avoid confusion.

Secret Data

The data of a secret is a JSON object. Keys are strings, and values can be any JSON type, including nested objects. For example:

Copy
{
  "username": "orders_app",
  "password": "Example-Passw0rd",
  "host": "db01.example.com",
  "port": 5432
}
  • The serialized data of one write can be up to 256 KiB.

  • Each write replaces all the data of the secret. To change one key, write the whole object again with the new value. There's no partial update.

  • secret create always stores a static secret, whatever keys the data contains. Base secrets and Dynamic Secrets are written with their own API requests, POST secrets/base/{path} and POST secrets/dynamic/{path}, and you get a credential from a dynamic secret by Minting a Credential it.

  • A path keeps the kind of secret it was created with until the secret is purged. Writing another kind of secret to the path returns 409 with the error code secret_kind_immutable.

Creating or Updating a Secret

To create a secret, or to add a new version to an existing one, run secret create with the path, and with the data as a JSON object in --data:

Copy
delinea --json workload secret create prod/orders/db --data '{"username":"orders_app","password":"Example-Passw0rd","host":"db01.example.com"}'

The response shows the new version. The data isn't included.

Copy
{
  "data": {
    "version": 1,
    "createdTime": "2026-11-05T17:02:11.512Z",
    "deletedTime": null,
    "destroyed": false
  }
}

Run the same command again to store a new version. Version numbers start at 1 and are never reused.

The value of --data is visible in your shell history and to other processes on the same computer. On a shared computer, clear the history after you write a secret, or write it from a pipeline variable or through the API.

Workload Secrets Vault doesn't support check-and-set. secret create ignores any field in the body other than data, such as HashiCorp Vault's options.cas, so the write isn't checked. If two clients write to the same path at the same time, both writes succeed as separate versions. A write that collides with another change at the same moment fails with 409; run it again.

Reading a Secret

To read the current version of a secret:

Copy
delinea --json workload secret get prod/orders/db

The response holds the data and the version metadata:

Copy
{
  "data": {
    "data": {
      "host": "db01.example.com",
      "password": "Example-Passw0rd",
      "username": "orders_app"
    },
    "metadata": {
      "version": 1,
      "createdTime": "2026-11-05T17:02:11.512Z",
      "deletedTime": null,
      "destroyed": false
    }
  }
}

To read an earlier version, add --version, for example --version 2. To use one value in a script, extract it with a JSON tool such as jq:

Copy
DB_PASSWORD=$(delinea --json workload secret get prod/orders/db | jq -r '.data.data.password')

A read returns 404 when the path doesn't exist and when the requested version is deleted or destroyed. If the current version is deleted, a read without --version also returns 404, even if earlier versions exist. Deleting, Restoring, and Rolling Back to make the secret readable again.

Viewing a Secret's Metadata

To see a secret's version information without reading its data, run secret describe:

Copy
delinea --json workload secret describe prod/orders/db
Copy
{
  "data": {
    "kind": "static",
    "metadata": {
      "version": 3,
      "createdTime": "2026-11-05T17:40:02.118Z",
      "deletedTime": null,
      "destroyed": false
    }
  }
}
  • kind is static for an ordinary secret, dynamic for a dynamic secret, and base for a base secret.

  • For a dynamic secret, definition shows its settings, but only if your policies also allow read on its base secret. For a base secret, baseSecret shows its settings without the password. These fields appear only for the current version, and only if it isn't deleted or destroyed. Otherwise they're left out. Describing a dynamic secret never creates a credential.

  • Add --version to see a specific version. Unlike a read, describe works for deleted and destroyed versions and shows their deletedTime and destroyed values.

  • There's no command that lists every version of a secret. Describe one version at a time.

Listing Secrets

To list the names under a path:

Copy
delinea --json workload secret list prod/orders
Copy
{
  "data": {
    "keys": [
      "cache/",
      "db"
    ]
  }
}
  • A list shows one level of names. A name that ends in / is a folder that contains more secrets. Lists never include values, and there's no paging.

  • With the list policy action on the path, you see every secret name under it, including the names of secrets you can't read and secrets whose current version is deleted. A secret whose versions are all destroyed isn't listed, but you can still describe it, and the next write to its path continues the version numbering.

  • Without the list action, the names come from the targets of your policies that allow list, read, or create, not from the stored secrets. You see the next level of each target below the path, even if nothing is stored there. For example, with only read on secret/prod/orders/*, secret list prod returns orders/, but secret list prod/orders returns an empty list, even if secrets are stored under it.

  • A path with nothing under it returns an empty list, not an error.

Deleting, Restoring, and Rolling Back

Workload Secrets Vault separates reversible deletes from permanent ones. Soft-deleted versions can be restored. Destroyed versions and purged secrets can't be recovered.

Task Command and result Reversible

Soft-delete the current version

secret delete prod/orders/db

Marks the current version as deleted. Add --version N to delete a specific version instead.

Yes

Soft-delete several versions

secret version delete prod/orders/db --versions '[1,2]'

Marks the listed versions as deleted.

Yes

Restore deleted versions

secret restore prod/orders/db --versions '[2]'

Clears the deleted mark on the listed versions. Destroyed versions are skipped.

Not applicable

Roll back to an earlier version

secret rollback prod/orders/db --version 2

Copies the data of version 2 into a new current version. The versions in between stay in the history. You can roll back to a soft-deleted version, but not to a destroyed one.

Yes, roll forward again

Destroy versions

secret destroy prod/orders/db --versions '[1]'

Permanently erases the data of the listed versions. Their metadata stays in the history.

No

Purge a secret

secret metadata delete prod/orders/db

Permanently removes the secret and all its versions. The next write to the path starts again at version 1.

No

All commands in the table start with delinea workload.

Version numbers that don't exist are ignored without an error when you delete, restore, or destroy versions. Run secret describe afterward to confirm the result.

While leases minted from a base secret are still open, you can't delete or destroy its current version or purge it. The request returns 409 with the error code secret_base_secret_in_use. Leases and Revocation or wait for them to expire, and then try again.

Permissions and Policy Actions

Each operation needs a Delinea Platform permission from one of your roles and an action in a policy that applies to the path. A policy target for a secret has the form secret/<path>. For details, see Controlling Access to Workload Secrets Vault.

Operation Permission Policy action
Create a secret or a new version delinea.workloadsecrets/secret/create create
Read or describe a secret delinea.workloadsecrets/secret/read read
List secrets delinea.workloadsecrets/secret/read list
Restore versions delinea.workloadsecrets/secret/update restore
Roll back delinea.workloadsecrets/secret/update update
Soft-delete versions delinea.workloadsecrets/secret/delete delete
Destroy versions or purge a secret delinea.workloadsecrets/secret/delete destroy

Purging a secret needs the destroy action, not delete, because it permanently removes every version.

REST API Reference

All paths are relative to https://<your-tenant>/workload-secrets/api/v1/. For authentication and general conventions, see Workload Secrets Vault REST API.

Operation Request Success response
Create or update POST secrets/data/{path} with body {"data":{...}} 201 for version 1, 200 for later versions
Read GET secrets/data/{path}, optional ?version=N 200
Describe GET secrets/metadata/{path}, optional ?version=N 200
List GET secrets/list/{path} 200
Soft-delete one version DELETE secrets/data/{path}, optional ?version=N 204
Soft-delete versions POST secrets/delete/{path} with body {"versions":[...]} 204
Restore versions POST secrets/restore/{path} with body {"versions":[...]} 204
Roll back POST secrets/rollback/{path}?version=N 200
Destroy versions POST secrets/destroy/{path} with body {"versions":[...]} 204
Purge DELETE secrets/metadata/{path} 204

The secrets API follows the path layout of HashiCorp Vault's KV version 2 engine (data/, metadata/), but it isn't a drop-in replacement. The routes for deleting, restoring, and destroying versions differ, errors use the Problem Details format, and requests use Delinea Platform access tokens.

Errors

Status Error code Cause
400 secret_missing_required_field The path is empty, or data is an empty object.
400 secret_payload_too_large The data is larger than 256 KiB.
400 secret_missing_versions The versions list is empty.
400 secret_invalid_version A rollback has no version, or the version isn't a positive number.
400 request_validation_failed The request body is malformed, or data is missing.
403 None (no response body) A permission is missing, no policy allows the action, or a policy denies it. See Troubleshooting Access.
404 secret_not_found The path doesn't exist, or the version doesn't exist or is deleted or destroyed.
409 secret_mint_required The path holds a dynamic secret, which has no data to read. Minting a Credential instead, or describe the secret.
409 secret_kind_immutable The path already holds another kind of secret, for example when you run secret create on the path of a dynamic secret. A path keeps the kind it was created with.
409 secret_base_secret_in_use You tried to delete or destroy the current version of a base secret, or purge it, while leases minted from it are still open. Revoke the leases or wait for them to expire.
409 secret_target_type_immutable A new version or a rollback would change the type or targetType of a base secret. Create a new base secret for the other target.
409 secret_concurrent_modification Another change to the same secret happened at the same moment. Run the request again.

Not Supported

The following aren't available in Workload Secrets Vault:

  • Check-and-set writes and partial updates

  • Expiration dates (TTL) for static secrets

  • Custom metadata and tags

  • Searching secrets, recursive listing, and paging

  • Limits on the number of versions kept, and automatic removal of old versions