Org Selection Service
API Contract
REST
/api/v1/organizations
8 endpoints
GET
/api/v1/organizations/api/v1/organizations
List all available organizations for the current user
Public
Response Example
{
"data": [
{
"organization_id": "org-abc123",
"name": "Acme Corp",
"logo_url": "https://cdn.example.com/logos/acme.png",
"member_count": 42
},
{
"organization_id": "org-def456",
"name": "Beta Ltd",
"logo_url": null,
"member_count": 7
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 2
}
}
GET
/api/v1/organizations/api/v1/organizations/:id
Get a single organization by ID
Public
Response Example
{
"organization_id": "org-abc123",
"name": "Acme Corp",
"logo_url": "https://cdn.example.com/logos/acme.png",
"member_count": 42,
"created_at": "2024-01-15T09:00:00Z"
}
POST
/api/v1/organizations/api/v1/organizations
Create a new organization record
Public
Request Example
{
"name": "New Org Inc",
"logo_url": "https://cdn.example.com/logos/neworg.png"
}
Response Example
{
"organization_id": "org-ghi789",
"name": "New Org Inc",
"logo_url": "https://cdn.example.com/logos/neworg.png",
"member_count": 1,
"created_at": "2026-03-26T10:00:00Z"
}
PUT
/api/v1/organizations/api/v1/organizations/:id
Update an organization's details
Public
Request Example
{
"name": "Acme Corporation",
"logo_url": "https://cdn.example.com/logos/acme-v2.png"
}
Response Example
{
"organization_id": "org-abc123",
"name": "Acme Corporation",
"logo_url": "https://cdn.example.com/logos/acme-v2.png",
"updated_at": "2026-03-26T10:05:00Z"
}
DELETE
/api/v1/organizations/api/v1/organizations/:id
Delete an organization
Public
Response Example
{
"deleted": true,
"organization_id": "org-abc123"
}
GET
/api/v1/organizations/api/v1/organizations/selection
Get the currently selected organization ID — maps to getSelectedOrganization()
Public
Response Example
{
"organization_id": "org-abc123"
}
POST
/api/v1/organizations/api/v1/organizations/selection
Select an organization — maps to selectOrganization(id)
Public
Request Example
{
"organization_id": "org-abc123"
}
Response Example
{
"organization_id": "org-abc123",
"selected_at": "2026-03-26T10:01:00Z"
}
DELETE
/api/v1/organizations/api/v1/organizations/selection
Clear the current organization selection — maps to clearSelection()
Public
Response Example
{
"cleared": true
}