Keyring

Response objects

The JSON shapes a workspace, a project, a tenant, an API key and a secret key are returned as.

Generated from packages/api/src/resources/serialize.ts by packages/docs/tools/generate-reference.mjs.

Every resource carries an object field naming its type. Timestamps are ISO 8601 strings or null. A minted or rotated key adds key and key_shown_once: true to the object below, in that one response and never again.

workspace

FieldSource
object'workspace' as const
idrow.id
namerow.name
slugrow.slug
billing_emailrow.billing_email
embed_originsrow.embed_origins
created_atiso(row.created_at)
updated_atiso(row.updated_at)

project

FieldSource
object'project' as const
idrow.id
namerow.name
slugrow.slug
policy_versionNumber(row.policy_version)
default_rate_limitsrow.default_rate_limits
created_atiso(row.created_at)
updated_atiso(row.updated_at)

tenant

FieldSource
object'tenant' as const
idrow.id
external_idrow.external_id
namerow.name
metarow.meta
embed_epochrow.embed_epoch
created_atiso(row.created_at)
updated_atiso(row.updated_at)

api_key

Neither hash is in the column list these rows come from, so no serialiser can leak one by forgetting to omit it. The plaintext is not on the row at all -- it exists only in the response the mint or rotate handler builds by hand.

FieldSource
object'api_key' as const
idrow.id
project_idrow.project_id
tenant_idrow.tenant_id
envrow.env
display_prefixrow.display_prefix
namerow.name
scopesrow.scopes
metarow.meta
rate_limitsrow.rate_limits
expires_atiso(row.expires_at)
revoked_atiso(row.revoked_at)
revoked_reasonrow.revoked_reason
quarantined_atiso(row.quarantined_at)
quarantine_reasonrow.quarantine_reason
rotated_fromrow.rotated_from
created_atiso(row.created_at)
last_used_atiso(row.last_used_at)

secret_key

FieldSource
object'secret_key' as const
idrow.id
envrow.env
display_prefixrow.display_prefix
namerow.name
metarow.meta
expires_atiso(row.expires_at)
revoked_atiso(row.revoked_at)
revoked_reasonrow.revoked_reason
quarantined_atiso(row.quarantined_at)
quarantine_reasonrow.quarantine_reason
rotated_fromrow.rotated_from
created_atiso(row.created_at)
last_used_atiso(row.last_used_at)

subscription

active_tenants_this_month is the one definition of the billing number, read through keyring.billable_tenant_month and not recomputed -- the same rule GET /v1/usage/billing follows. It arrives as a bigint string from count(distinct …).

budget_cap_cents is the overage the workspace has opted in to per month, in currency's minor unit and on the overage alone; 0 is "none allowed". effective_tenant_ceiling is the tenant count it buys (null: unbounded) and tenants_held is the number the tenant gate compares against it.

FieldSource
object'subscription' as const
plan_coderow.plan_code
included_tenantsrow.included_tenants
overage_cents_per_tenantrow.overage_cents_per_tenant
currencyrow.currency
amount_centsrow.amount_cents
intervalrow.interval
statusrow.status
collection_staterow.collection_state
grace_untiliso(row.grace_until)
active_tenants_this_monthNumber(row.active_tenants_this_month)
budget_cap_centsrow.budget_cap_cents
effective_tenant_ceilingrow.effective_tenant_ceiling
tenants_heldNumber(row.tenants_held)

On this page