Skip to content

Fetch the caller's tenant

View as Markdown
GET
/v1/tenant
curl --request GET \
--url https://example.com/v1/tenant \
--header 'Authorization: Bearer <token>'

Returns the tenant the bearer token authenticates as. There is no /v1/tenants collection — tenants are the sovereignty boundary, not a listable resource under a tenant. A runtime that gates production adds productionAllowed (and productionNext while it’s false), and one that sets limits adds the tenant’s limits.

Tenant.

Media typeapplication/json
object
id
required
string format: uuid
name
required
string
slug
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
productionAllowed

Whether the tenant may put projects in production. Absent from a runtime that doesn’t gate production.

boolean
productionNext

Where to go to be allowed to put projects in production, for example a billing page. Only while productionAllowed is false, and only when the runtime names one.

string
state

On a runtime serving many tenants: closing (readable and exportable for its window, nothing changes) or suspended (the same, until restored). closing wins. Absent: active.

string
Allowed values: active suspended closing
limits

The tenant’s limits that are set. A limit that isn’t set is absent, and isn’t enforced.

object
apiRequestsPerMinute

API requests a minute. Past it: 429 rate-limit-exceeded.

integer
>= 1
webhookReceivesPerMinute

Webhook deliveries received a minute, across the tenant’s triggers. Past it: 429.

integer
>= 1
runsAtOnce

Runs executing at once. Past it, a new run waits as pending.

integer
>= 1
runsPending

Runs waiting as pending. Past it, a new run is refused with 429.

integer
>= 1
toolCallsInFlight

Tool calls in flight to the tenant’s pack services. Past it, a call waits for a slot.

integer
>= 1
approvalsPending

Approvals waiting for a decision. Past it, the step that asks fails, naming the limit.

integer
>= 1
projectsInProduction

Projects in production at once. Past it, putting another project in production is refused with 403 production-limit-reached. Lowering it takes no project out of production.

integer
>= 1
Example
{
"state": "active"
}

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

The tenant id on the token does not resolve to a stored row.

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