Organizations
GET /api/orgs
Section titled “GET /api/orgs”List Orgs
List all organizations the authenticated user belongs to.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgResponse[] |
| 422 | Validation Error | HTTPValidationError |
POST /api/orgs
Section titled “POST /api/orgs”Create Org
Create a new organization.
The authenticated user becomes the OWNER of the new organization. With no
slug the service derives and uniquifies one from the name; an explicit
slug is validated (shape, length, reserved words) and must be free.
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| description | string | no | |
| name | string | yes | |
| slug | string | no |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | OrgResponse |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/{org_id}
Section titled “GET /api/orgs/{org_id}”Get Org
Get organization details.
Requires membership in the organization (user) or belonging to it (agent).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgResponse |
| 422 | Validation Error | HTTPValidationError |
PATCH /api/orgs/{org_id}
Section titled “PATCH /api/orgs/{org_id}”Update Org
Update organization details.
Requires ADMIN or OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Request body (required)
| Field | Type | Required | Description |
|---|---|---|---|
| description | string | no | |
| name | string | no | |
| slug | string | no |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | OrgResponse |
| 422 | Validation Error | HTTPValidationError |
DELETE /api/orgs/{org_id}
Section titled “DELETE /api/orgs/{org_id}”Delete Org
Delete an organization.
Requires OWNER role.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string (uuid) | yes |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | Successful Response | |
| 422 | Validation Error | HTTPValidationError |
GET /api/orgs/slug-rules
Section titled “GET /api/orgs/slug-rules”Get Slug Rules
The rules an organization address must satisfy.
Served so the create-organization wizard can flag a reserved or malformed
address as the user types, without a hand-copied duplicate of the reserved
list rotting in the frontend. The server-side check in create_org is
still the authority.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | SlugRulesResponse |
| 422 | Validation Error | HTTPValidationError |