Skip to content

Upsert a tenant-config entry

View as Markdown
PATCH
/v1/tenant/config
curl --request PATCH \
--url https://example.com/v1/tenant/config \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "kind": "env", "key": "example", "value": "example", "sensitive": true, "ifRevision": 1 }'

Set / update an entry keyed by (kind, key). An env or secret entry (or one sent with sensitive: true) is stored under the env the runtime serves (servedEnv in whoami), where its tools read it; a config entry, a tenant setting, under default whatever it serves. On a runtime that serves none, both are under default. Optional ifRevision provides optimistic-concurrency: the write fails with tenant-config-revision-conflict (409) unless the stored revision matches. Omit for last-write-wins.

Idempotency-Key
string
>= 1 characters

Caller-supplied idempotency key, scoped to the caller: the same key from someone else in the tenant is their own request (from 0.1.5). Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1). A retry sent while the first request still runs is answered 409 idempotency-key-in-flight with Retry-After, on a runtime whose store holds keys (from 0.1.5); retry after it, and you get the first request’s answer. An answer that carries a secret (a new API key or public run token, a session token, a generated signing secret) isn’t kept: a retry gets 409 idempotency-key-replay-withheld, with the first request’s status and when it succeeded (from 0.1.5).

Media typeapplication/json
object
kind
required

Slot for a tenant config entry (tenant-scoped). env and config both address EnvBinding; secret addresses SecretBinding. Prefer /v1/env/* + /v1/secrets/* for new callers.

string
Allowed values: env config secret
key
required
string
>= 1 characters
value
required
string
sensitive

When true, the write is routed to SecretBinding regardless of kind. kind: "secret" implies sensitive: true.

boolean
ifRevision

Optimistic-concurrency guard — the write fails with tenant-config-revision-conflict (409) unless the stored revision matches. Omit for last-write-wins.

integer

Entry upserted.

Media typeapplication/json
object
entry
required
object
tenantId
required
string
kind
required

Slot for a tenant config entry (tenant-scoped). env and config both address EnvBinding; secret addresses SecretBinding. Prefer /v1/env/* + /v1/secrets/* for new callers.

string
Allowed values: env config secret
key
required
string
value
required

Entry value. For kind: "secret" this is ALWAYS [redacted] on this admin surface; use the /v1/secrets/* routes and SecretBinding.resolve on the dispatch path to read plaintext.

string
sensitive
required
boolean
revision
required
integer
updatedAt
required
string
Example
{
"entry": {
"kind": "env"
}
}

A body that fails validation (bad-input), or a secret the store refuses for its name or its value: reserved-name-prefix, secret-name-invalid (a new name that isn’t 1 to 255 ASCII letters, digits, ., - and _ starting with a letter, digit or _, with any . between two non-. characters, or, under kindgi dev, isn’t capital letters, digits and underscores, starts with a digit, or is KINDGI_*; the message says the rule), secret-value-too-large, or secret-value-invalid (under kindgi dev, a value no env-file quoting can hold so that it reads back unchanged; the message says why).

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"
}
}

ifRevision was set and did not match the stored revision.

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 request body is over the API’s limit (request-too-large; details.maxBytes says how much).

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 secrets store’s external provider is limiting the runtime’s requests.

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"
}
}

Server error (unmapped domain code or framework crash).

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 secrets store’s external provider refused the runtime’s credentials.

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 secrets store’s external provider can’t be reached.

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"
}
}

See also