Revoke a secret
const url = 'https://example.com/v1/secrets/example?envName=example&scopeKind=tenant';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'https://example.com/v1/secrets/example?envName=example&scopeKind=tenant' \ --header 'Authorization: Bearer <token>'Requires the secrets:revoke capability (soft-revoke), or secrets:revoke:hard when ?hard=true: that erases the value at Kindgi and hard-deletes it in a secret manager, and can’t be undone. Backups, and a secret manager’s own retention, may keep copies for a time. If your secret manager keeps a recoverable copy, the answer’s recoverableUntil says until when. Optional ?reason=<text> records the revoke reason.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Responses
Section titled “Responses”Revoke outcome.
object
Examplegenerated
{ "revoked": true, "hard": true, "recoverableUntil": "2026-04-15T12:00:00Z"}Missing or malformed scope / envName, or reserved-name-prefix for a kindgi. name.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Bearer token missing revoke capability. Without an authorization store, key-project-mismatch (details.keyProjectId): the API key or session is limited to a project, and this writes above it, to the workspace, an org or a team (with a store, that is permission-denied).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Unknown secret.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}secret-provider-rate-limited: the secret manager is limiting the runtime’s requests. A soft revoke isn’t made, so revoke it again. A hard one revoked the secret, so reads stop, but its value may still be in the secret manager: a hard revoke again erases it. Or rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”secret-store-error: the secrets store or the secret manager failed, so revoke it again. Or a hard revoke’s erase in the secret manager didn’t finish, as the message says. If writes to the secret kept landing while it erased, it stays revoked, so reads stop, and a hard revoke again finishes the erase. If the erase took over 10 minutes and a set or another hard revoke came in, the secret manager may still hold a value, or a set made since may have lost the value it wrote: set it again, or revoke it hard again. Or a hard revoke of a secret that another secret manager keeps, or whose stored name is no longer a valid one: it’s revoked, but its value is left in that secret manager, to remove there.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The store doesn’t revoke (secret-operation-unsupported): under kindgi dev secrets live in the env files; the message says to remove the name there.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}secret-provider-unauthorized: the secret manager refused the runtime’s credentials. A soft revoke isn’t made, so revoke it again. A hard one revoked the secret, so reads stop, but its value may still be in the secret manager: a hard revoke again erases it.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}secret-provider-unavailable: the secret manager can’t be reached. A soft revoke isn’t made, so revoke it again. A hard one revoked the secret, so reads stop, but its value may still be in the secret manager: a hard revoke again erases it. Or another hard revoke of the secret is still erasing it: revoke it again in a few minutes if it’s still there (a revoke whose runtime stopped partway holds the next off for up to 10 minutes). authz-backend-unavailable (with Retry-After): the authorization store couldn’t be reached, so the request wasn’t run. database-busy (with Retry-After): the database was too busy for the authorization check, so the request wasn’t run.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/secrets/{name}: Get secret metadataGET /v1/secrets/{name}/versions: List secret versionsGET /v1/secrets/{name}/versions/{versionId}: Get one secret-version recordPOST /v1/secrets/{name}/rotate: Rotate a secret (sync or async)- Keep secrets in your own secret manager
- Kindgi 0.2.0
- Error code
authz-backend-unavailable - Error code
database-busy - Error code
key-project-mismatch - Error code
permission-denied - Error code
rate-limit-exceeded - Error code
reserved-name-prefix - Error code
secret-operation-unsupported - Error code
secret-provider-rate-limited - Error code
secret-provider-unauthorized - Error code
secret-provider-unavailable - Error code
secret-store-error - Every error code