Skip to main content
PUT/vault/secrets/{path}

Update Secret

Stores a new value for a secret as its next version.

Only the owner can update a secret.

Parameters
projectId *query

The project's id.

path *path

The secret's path: /-delimited segments, such as database/prod/password.

Request body
value *string

New plaintext bytes, base64-encoded over the wire.

Example: "bjN3LXMzY3IzdC12YWx1ZQ=="
Responses
HTTPK9O CodeDescription
200The secret's new version.
400The path or the body isn't valid.
401The request carries no authenticated caller.
403The caller can see the secret but doesn't own it.
404No such secret visible to the caller.
409`K9O_REKEY_IN_PROGRESS` or `K9O_CUSTODY_TRANSITION_IN_PROGRESS`: a key rotation or custody change is running. Retry when it completes.
Response body (200)
id *string

sec_<base62>.

Example: "sec_4fK9xQ2mZ7"
name *string

The secret's path.

Example: "database/prod/password"
version *integer <int64>

The new version, one above the previous.

Example: 3
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.kibo.vault.secrets.update('<name>', {
  value: 'n3w-s3cr3t-value'
})

Showing example in TypeScript

Request example
{
  "value": "bjN3LXMzY3IzdC12YWx1ZQ=="
}
Response example (200)
{
  "id": "sec_4fK9xQ2mZ7",
  "name": "database/prod/password",
  "version": 3
}

More in Secrets