JavaScript
Workspace Secrets
Update a workspace secret
Rotate a secret’s value in place, or rename it. You cannot read the value back to confirm it.
PATCH
JavaScript
Rotate a workspace secret without changing where it is referenced. Every adapter that names
The new value takes effect immediately. The old one stops resolving.
Because you cannot read the old value, keep it in your own secret manager if you need a rollback. Cadenya holds it only to resolve at call time.
You would only reach for
${THIS_SECRET} picks up the new value at the next call, no reconfiguration.
You rotate blind
spec.value is write-only, so the response and every later read redact it to "". You cannot read the value back to check the rotation landed. Confirm it a different way: watch a tool call that uses the secret succeed, or check resolvedSecrets on a tool call to see the scope resolved.
The value is a zero-value-safe field
A non-empty new value lands through a plain merge;updateMask is not required to rotate:
updateMask to set an empty value, which is rarely what you want for a secret. To rename, send metadata.name; the merge leaves the value untouched.
Related
Create a workspace secret
Storing the value, and the three-scope precedence.
Store and use secrets
Where
${NAME} resolves, and the rotation cutover.Get a tool call
resolvedSecrets, the way to confirm a secret resolved.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The workspace the secret belongs to.
Example:
"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
The secret to update.
Example:
"wsecret_01HXKD2E5NQM3T9AYWCF586W5A"
Body
application/json