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: |
Request body
| value * | string | New plaintext bytes, base64-encoded over the wire. Example: "bjN3LXMzY3IzdC12YWx1ZQ==" |
Responses
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | The secret's new version. | |
| 400 | The path or the body isn't valid. | |
| 401 | The request carries no authenticated caller. | |
| 403 | The caller can see the secret but doesn't own it. | |
| 404 | No 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 |
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
}