Organizations API
Manage organizations and cross-space aggregation for multi-tenant deployments.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| GET | /organizations | List organizations |
| POST | /organizations | Create organization |
| GET | /organizations/{slug} | Get organization |
| PATCH | /organizations/{slug} | Update organization |
| DELETE | /organizations/{slug} | Delete organization |
| POST | /organizations/{slug}/spaces | Add space |
| DELETE | /organizations/{slug}/spaces/{space_id} | Remove space |
| POST | /organizations/{slug}/users | Add user |
| PATCH | /organizations/{slug}/users/{user_id} | Update user role |
| DELETE | /organizations/{slug}/users/{user_id} | Remove user |
Aggregation Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /organizations/{slug}/products | Aggregated products |
| GET | /organizations/{slug}/contracts | Aggregated contracts |
| GET | /organizations/{slug}/issues | Aggregated issues |
| GET | /organizations/{slug}/quality | Aggregated quality checks |
| GET | /organizations/{slug}/stats | Organization statistics |
List Organizations
GET /organizations
Returns organizations the current user has access to.
Response
[
{
"id": "...",
"name": "Acme Corp",
"slug": "acme",
"spaces": [
{"id": "...", "name": "Analytics", "slug": "analytics"},
{"id": "...", "name": "Marketing", "slug": "marketing"}
],
"user_count": 45,
"created_at": "2025-01-01T00:00:00Z"
}
]
Create Organization
POST /organizations
Requires superadmin privileges.
{
"name": "Acme Corp",
"slug": "acme"
}
Add Space to Organization
POST /organizations/{slug}/spaces
{
"space_id": "space-uuid"
}
Add User to Organization
POST /organizations/{slug}/users
{
"user_email": "user@example.com",
"role": "member"
}
Organization Roles
| Role | Description |
|---|---|
admin | Full organization management |
member | View organization content |
Aggregated Products
GET /organizations/{slug}/products
Returns products from all spaces in the organization that the user can access.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number |
size | integer | Items per page |
search | string | Search filter |
Aggregated Issues
GET /organizations/{slug}/issues
Query Parameters
| Parameter | Type | Description |
|---|---|---|
status | string | Filter by status (comma-separated) |
priority | string | Filter by priority |
assignee_id | uuid | Filter by assignee |
limit | integer | Max results |
Organization Statistics
GET /organizations/{slug}/stats
Response
{
"total_spaces": 5,
"total_products": 234,
"total_users": 45,
"quality_score": 0.92,
"open_issues": 12,
"active_contracts": 8
}
Organization Quality
GET /organizations/{slug}/quality
Aggregates quality checks across all spaces.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
include_archived | boolean | Include archived checks |
Error Responses
| Status | Description |
|---|---|
403 | Not authorized for this organization |
404 | Organization not found |