API Reference
OrganizationsEnterprise
Listing, creating, renaming and deleting organizations.
The organizations endpoints manage the named organizations in an account. The account itself is listed as an organization with is_account true. Creating and deleting need a key of the account organization, and keys limited to some routers cannot use these endpoints. See Organizations.
| Method | Path | Description | Scope |
|---|---|---|---|
| GET | /v1/organizations | List the organizations the key can see. Paginated. | organizations:read |
| POST | /v1/organizations | Create an organization with a name of 2 to 80 characters. Returns 201. Accepts an Idempotency-Key. | organizations:write |
| GET | /v1/organizations/{id} | Get an organization, with counts of its contents. | organizations:read |
| PATCH | /v1/organizations/{id} | Rename it. Accepts dry_run. | organizations:write |
| DELETE | /v1/organizations/{id} | Delete an empty organization. | organizations:delete |
contents counts the organization's routers, API keys, provider keys, prompt repos, prompts and people. An organization is deleted only when every count is zero.
| Code | Status | Meaning |
|---|---|---|
account_token_required | 403 | A create or delete uses a key of a named organization. |
router_scoped_token | 403 | The key is limited to some routers. |
organization_not_found | 404 | No organization has that id in the account. |
organization_not_empty | 409 | A delete names an organization that still holds something. contents gives the counts. |
account_organization | 409 | The account organization cannot be renamed or deleted. |
organization_limit_reached | 409 | The account has its maximum number of organizations. |
organization_changed | 409 | The organization changed at the same time. Retry. |
Was this helpful?