Upsert a tenant-config entry
const url = 'https://example.com/v1/tenant/config';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kind":"env","key":"example","value":"example","sensitive":true,"ifRevision":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”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).
Request Bodyrequired
Section titled “Request Bodyrequired”object
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.
When true, the write is routed to SecretBinding regardless of kind. kind: "secret" implies sensitive: true.
Optimistic-concurrency guard — the write fails with tenant-config-revision-conflict (409) unless the stored revision matches. Omit for last-write-wins.
Responses
Section titled “Responses”Entry upserted.
object
object
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.
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.
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).
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" }}ifRevision was set and did not match the stored revision.
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 request body is over the API’s limit (request-too-large; details.maxBytes says how much).
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 secrets store’s external provider is limiting the runtime’s requests.
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" }}Server error (unmapped domain code or framework crash).
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 secrets store’s external provider refused the runtime’s credentials.
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 secrets store’s external provider can’t be reached.
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" }}See also
GET /v1/tenant/config: List the tenant's config entries- Error code
bad-input - Error code
request-too-large - Error code
reserved-name-prefix - Error code
secret-name-invalid - Error code
secret-provider-rate-limited - Error code
secret-provider-unauthorized - Error code
secret-provider-unavailable - Error code
secret-value-invalid - Error code
secret-value-too-large - Every error code