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). 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. Retries with the same key return the original response byte-identical (per docs/API-ROUTE-CONVENTIONS.md §3.1).
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" }}Malformed request body.
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" }}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" }}