Update or rotate a credential
const url = 'https://example.com/v1/credentials/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","auth_type":"bearer","plaintext":"example","vault_ref":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/credentials/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "auth_type": "bearer", "plaintext": "example", "vault_ref": "example" }'All fields optional; an absent key leaves it unchanged. A present but empty plaintext is rejected (400) — it would otherwise overwrite the secret with the encryption of zero bytes.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The cred_<uuidv7> credential ID.
Request Bodyrequired
Section titled “Request Bodyrequired”All fields optional; an absent key leaves it unchanged.
object
Must not be empty when present.
Source=managed only. Re-encrypts under the current KEK. Must not be empty when present.
Source=vault only.
Responses
Section titled “Responses”The updated credential.
object
The cred_<uuidv7> resource ID.
Present only for source=managed — a redacted hint of the secret, never the secret itself.
Present only for source=vault.
Incremented on each rotation.
Example
{ "auth_type": "bearer", "source": "managed"}Invalid body, empty name/plaintext, or invalid auth_type.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}Missing or invalid bearer token, or the token’s tenant/user claims are absent. No body.
No resource with this ID exists in the caller’s tenant.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}The new name conflicts with another credential in the tenant.
The uniform error body for all 4xx responses that carry one.
object
A coarse, caller-safe message. Never contains internal state (invariant
Examplegenerated
{ "error": "example"}An unexpected server-side error. No body (internal detail is never returned to callers, invariant