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”Secret name (opaque string within the workspace + envName).
Query Parameters
Section titled “Query Parameters”Per-environment slug. [a-z][a-z0-9-]{0,62} — RFC-1035-like label.
[a-z][a-z0-9-]{0,62}. Required on every env + secrets route.
Discriminator for the ?scopeKind + ?scopeId + ?inherit triplet. Tenant carries no id (implicit from session); org/project require scopeId.
Required on every env + secrets route. Tenant carries no scopeId; org / project require scopeId.
Required IF scopeKind is org or project. MUST be absent if scopeKind=tenant (the workspace is implicit from the session). Malformed combinations return 400 scope-invalid.
Set to true to erase the value, which 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.
Human-readable revoke reason retained in the tombstone.
Responses
Section titled “Responses”Revoke outcome.
object
A hard revoke left a copy your secret manager can still recover (for example Azure Key Vault’s soft delete, when the vault doesn’t allow a purge or the runtime isn’t permitted to purge): when the secret manager purges it on its own. Setting the same name again before then can keep that copy, its values disabled, until the name is hard-revoked again. Absent on a soft revoke, and when a hard revoke left nothing recoverable.
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
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
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
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Unknown secret.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
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
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.
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
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
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
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
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
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
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
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Whole seconds to wait before sending the request again, at least 1. Sent with the codes the answer names as sending it, so it may be absent.
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