Skip to content

Revoke a secret

View as Markdown
DELETE
/v1/secrets/{name}
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.

name
required
string
>= 1 characters

Secret name (opaque string within the workspace + envName).

envName
required

Per-environment slug. [a-z][a-z0-9-]{0,62} — RFC-1035-like label.

string
/^[a-z][a-z0-9-]{0,62}$/

[a-z][a-z0-9-]{0,62}. Required on every env + secrets route.

scopeKind
required

Discriminator for the ?scopeKind + ?scopeId + ?inherit triplet. Tenant carries no id (implicit from session); org/project require scopeId.

string
Allowed values: tenant org project

Required on every env + secrets route. Tenant carries no scopeId; org / project require scopeId.

scopeId
string
>= 1 characters

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.

hard
boolean

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.

reason
string

Human-readable revoke reason retained in the tombstone.

Revoke outcome.

Media typeapplication/json
object
revoked
required
boolean
hard
required
boolean
recoverableUntil

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.

string format: date-time
Examplegenerated
{
"revoked": true,
"hard": true,
"recoverableUntil": "2026-04-15T12:00:00Z"
}

Missing or malformed scope / envName, or reserved-name-prefix for a kindgi. name.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Missing / malformed / expired / revoked bearer token.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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).

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Unknown secret.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}
Retry-After
integer
>= 1

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.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
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.

Media typeapplication/json
object
error
required
object
code
required

Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).

string
message
required
string
details

Optional, kind-specific.

object
key
additional properties
any
requestId
required

Server-assigned request id; also echoed via X-Request-Id header.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}
Retry-After
integer
>= 1

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