Workload Secrets Vault REST API

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.

Every Workload Secrets Vault operation is available through a REST API in your tenant. The CLI and the SDKs use the same API.

  • Base URL: https://<your-tenant>.delinea.app/workload-secrets/api/v1/

  • Interactive reference: https://<your-tenant>.delinea.app/workload-secrets/help/ shows every operation with its request and response schemas. To try requests there, provide an access token.

  • OpenAPI description: https://<your-tenant>.delinea.app/workload-secrets/swagger/v1/swagger.json

Authenticating to the API

Applications authenticate as a Delinea Platform service user with the OAuth 2.0 client credentials grant, and send the resulting access token with each request. For how to create a service user, see Service Users. The service user needs Workload Secrets Vault permissions and policies like any other identity. See Controlling Access to Workload Secrets Vault.

  1. Request a token from your tenant. Send the service user's username as client_id and its password as client_secret in the form-encoded request body. HTTP Basic authentication isn't accepted.

    Copy
    TOKEN=$(curl -sS -X POST "https://$TENANT/identity/api/oauth2/token/xpmplatform" \
      --data-urlencode "grant_type=client_credentials" \
      --data-urlencode "scope=xpmheadless" \
      --data-urlencode "client_id=$CLIENT_ID" \
      --data-urlencode "client_secret=$CLIENT_SECRET" | jq -r '.access_token')

    The token is valid for about one hour, as shown by expires_in in the response. Request a new token when it expires.

  2. Send the token in the Authorization header of every request:

    Copy
    curl -sS -X POST "https://$TENANT/workload-secrets/api/v1/secrets/data/payments/prod/orders-db" \
      -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
      -d '{"data":{"username":"orders_app","password":"Example-Passw0rd"}}'

    curl -sS "https://$TENANT/workload-secrets/api/v1/secrets/data/payments/prod/orders-db" \
      -H "Authorization: Bearer $TOKEN" | jq -r '.data.data.password'

For more about Delinea Platform access tokens, see Authenticating with Platform APIs.

Conventions

  • The API version is part of the path (v1). There's no version header or query parameter.

  • Requests and successful responses are JSON (application/json). Errors are application/problem+json.

  • Secret and key paths go directly in the URL, with / between segments, for example secrets/data/payments/prod/orders-db.

  • Lists return everything in one response, except the list of leases. GET leases returns one page at a time: limit sets the page size (1 to 100, 50 by default), and offset sets how many leases to skip.

  • The interactive reference shows an optional X-MT-SecondaryId header on every operation. You don't need to send it: the API finds your tenant from the host name in the URL.

  • For the operations in each area, see the REST API Reference section of REST API Reference, Managing Policies, REST API Reference, REST API Reference, and REST API Reference. For dynamic secrets, see Minting a Credential and Leases and Revocation. The interactive reference covers PKI and every other operation.

Errors

Errors use the Problem Details format (RFC 9457), with an errorCode field that identifies the error:

Copy
{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.5",
  "title": "Secret not found",
  "status": 404,
  "errorCode": "secret_not_found"
}
  • Build your error handling on status and errorCode. The title and detail text can change.

  • A request that fails basic request validation, for example because its body isn't valid JSON, returns 400 with the error code request_validation_failed and an errors object that lists the problems by field. Other 400 responses have a more specific error code, such as policy_invalid.

  • 401 (missing or expired token) and 403 (access denied) responses have no body. See Troubleshooting Access.

  • A 500 response never includes details about the cause.

Limits

Item Limit
Time to complete a request 30 seconds
Secret data per write 256 KiB
Plaintext per encryption request 64 KiB
Value of a secret share 64 KiB
Secret share lifetime and views Up to 7 days and 10 views
Dynamic secret lease 1 minute to 8 hours
Key path length 500 characters
Restore period for deleted keys 30 days

Retrying Requests

When the service is busy or a dependency is unavailable, it answers 503 with a Retry-After header and doesn't process the request. The error codes are admission_capacity_exceeded, data_store_throttled, mint_capacity_exceeded, and policy_decision_unavailable. The service doesn't use 429.

Follow these rules in your client:

  • Retry any request that got a 503 with a Retry-After header, after waiting the number of seconds it gives.

  • Retry 408, 502, and 504 only for operations that are safe to repeat. The OpenAPI description marks each operation with x-retry-safe: true means you can repeat the operation without a second side effect. For example:

    • Reading a secret (GET secrets/data/{path}) is safe to repeat.

    • Revoking a lease (POST leases/{id}/revoke) is safe to repeat.

    • Minting a credential (POST secrets/mint/{path}) isn't safe to repeat, because each call that reaches the service creates a new credential. Never retry a mint automatically.

  • Don't retry other requests after a timeout or a 5xx response unless you've checked that the first attempt didn't take effect.

  • A mint that fails with 503 and the error code transit_no_engine_available has no Retry-After header. It means that no engine at the base secret's site answered. Check the engine before you mint again.

  • Use exponential backoff with jitter, and give up after a few attempts. The Workload Secrets Vault SDKs make at most four attempts.