Organizations API
GET /api/v1/admin/organization
Section titled “GET /api/v1/admin/organization”GET /api/v1/admin/organization · operation getOwnOrganization
T168 (organization_admins): an organization admin reads its own organization, its tenant ceilings (model ceiling, tenant quota policies and tenant rate policies, owned by the global administrator and read only), its teams, the budgets it manages (quota and rate policies on its teams, keys and users, with the quota version, base fingerprint and configuration version its writes carry; rate_read_only lists YAML rate policies) and, with organization_model_aliases, its model aliases. Any other session answers 404.
Authentication: adminSession
Responses
| Status | Description | Body |
|---|---|---|
200 |
organization, ceilings {restricted, allowed_models, quota_policies, rate_policies, read_only: true} and teams | application/json: object |
403 |
Model not allowed | application/json: Error |
404 |
Not an organization admin, or organizations disabled | — |
Response 200 fields:
application/json: objectorganization(Organization)ceilings(object)teams(array of object)budgets(object)model_aliases(array of OrganizationModelAlias, nullable)
GET /api/v1/admin/organizations
Section titled “GET /api/v1/admin/organizations”GET /api/v1/admin/organizations · operation listOrganizations
Requires organizations and organizations:read (admin, viewer). Organizations above teams (ADR 0089); org_default holds every team nobody moved. allowed_models is the model ceiling when restricted is true.
Authentication: adminSession
Responses
| Status | Description | Body |
|---|---|---|
200 |
Organizations with active team counts | application/json: object |
404 |
Feature disabled | — |
503 |
Storage unavailable | — |
Response 200 fields:
application/json: objectdata(array of Organization, required)
POST /api/v1/admin/organizations
Section titled “POST /api/v1/admin/organizations”POST /api/v1/admin/organizations · operation createOrganization
Global admin (organizations:manage) creates an organization; requires organization_management. Omit allowed_models for no ceiling; an array (even empty) restricts every key of its teams on the next request.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: OrganizationInput
Responses
| Status | Description | Body |
|---|---|---|
201 |
Created | application/json: Organization |
400 |
Invalid input | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Feature disabled | — |
409 |
Name already used | — |
PUT /api/v1/admin/organizations/{id}
Section titled “PUT /api/v1/admin/organizations/{id}”PUT /api/v1/admin/organizations/{id} · operation updateOrganization
Global admin renames an organization and sets its model ceiling with the current version. Organization administrators never change their own limits. YAML organizations return 409 organization_declared; org_default can be restricted but not deleted.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required | |
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: OrganizationInput and any- All of (1): OrganizationInput
- All of (2): any
Responses
| Status | Description | Body |
|---|---|---|
200 |
Updated | application/json: Organization |
400 |
Invalid input | application/json: Error |
403 |
Model not allowed | application/json: Error |
404 |
Unknown organization or feature disabled | — |
409 |
Stale version, duplicate name or declared in YAML | — |
DELETE /api/v1/admin/organizations/{id}
Section titled “DELETE /api/v1/admin/organizations/{id}”DELETE /api/v1/admin/organizations/{id} · operation deleteOrganization
Logical delete with the current version. Refused while the organization has active teams (organization_in_use), for org_default (organization_protected) and for YAML organizations.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required | |
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: objectversion(integer (int64), required, min 0)
Responses
| Status | Description | Body |
|---|---|---|
204 |
Deleted | — |
403 |
Model not allowed | application/json: Error |
404 |
Unknown organization or feature disabled | — |
409 |
In use, protected, declared or stale version | — |
GET /api/v1/admin/organizations/{id}/model-aliases
Section titled “GET /api/v1/admin/organizations/{id}/model-aliases”GET /api/v1/admin/organizations/{id}/model-aliases · operation listOrganizationModelAliases
T168 (organization_model_aliases): the model aliases owned by one organization, resolved only for keys of its teams before the gateway-wide aliases. The global administrator reads any organization; an organization admin only its own (another answers 404). shadows names the canonical model of the gateway-wide alias of the same name, which the organization’s keys no longer reach by that name; serving is false when the alias is disabled, the flag is off or its target no longer validates (problem says why).
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required |
Responses
| Status | Description | Body |
|---|---|---|
200 |
Aliases | application/json: object |
403 |
Model not allowed | application/json: Error |
404 |
Unknown organization, another organization’s, or feature disabled | — |
Response 200 fields:
application/json: objectorganization_id(string)active(boolean)items(array of OrganizationModelAlias)
PUT /api/v1/admin/organizations/{id}/model-aliases/{alias}
Section titled “PUT /api/v1/admin/organizations/{id}/model-aliases/{alias}”PUT /api/v1/admin/organizations/{id}/model-aliases/{alias} · operation putOrganizationModelAlias
Creates (no version, 201) or replaces (the current version, 200) a console alias. alias_of must be an exact, enabled canonical gateway model inside the organization’s model ceiling; the name may not be a gateway model’s, contains no / or *, and may equal a gateway-wide alias, which it then shadows for this organization’s keys only. An alias grants nothing: a key calls it only when it may call alias_of. YAML aliases (organizations[].model_aliases) answer 409 model_alias_declared.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required | |
alias |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:@-]{0,127}$ |
|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: objectalias_of(string, required)disabled(boolean)version(integer (int64), min 1)
Responses
| Status | Description | Body |
|---|---|---|
200 |
Replaced | application/json: OrganizationModelAlias |
201 |
Created | application/json: OrganizationModelAlias |
403 |
Model not allowed | application/json: Error |
404 |
Unknown organization, another organization’s, or feature disabled | — |
409 |
Stale version, already exists or declared in YAML | — |
422 |
invalid_model_alias or model_alias_limit (200 per organization) | — |
DELETE /api/v1/admin/organizations/{id}/model-aliases/{alias}
Section titled “DELETE /api/v1/admin/organizations/{id}/model-aliases/{alias}”DELETE /api/v1/admin/organizations/{id}/model-aliases/{alias} · operation deleteOrganizationModelAlias
Deletes a console alias with its current version; YAML aliases answer 409.
Authentication: adminSession
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id |
path | string, required | |
alias |
path | string, required, pattern ^[A-Za-z0-9][A-Za-z0-9._:@-]{0,127}$ |
|
X-CSRF-Token |
header | string, required | Token returned by admin login/session; required with the same-origin session cookie for writes. |
Request body (required)
application/json: objectversion(integer (int64), required, min 1)
Responses
| Status | Description | Body |
|---|---|---|
204 |
Deleted | — |
403 |
Model not allowed | application/json: Error |
404 |
Unknown organization or alias, another organization’s, or feature disabled | — |
409 |
Stale version or declared in YAML | — |