Active Chapter State
API Contract
REST
/api/v1/active-unit
5 endpoints
GET
/api/v1/active-unit/api/v1/active-unit
Get the currently active unit for the authenticated user
Public
Response Example
{
"data": [
{
"user_id": "usr-77",
"active_unit_id": "unit-002",
"unit_name": "Oslo Chapter",
"set_at": "2026-03-26T08:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}
GET
/api/v1/active-unit/api/v1/active-unit/current
Get active unit detail for current session
Public
Response Example
{
"user_id": "usr-77",
"active_unit_id": "unit-002",
"unit_name": "Oslo Chapter",
"level_type": "chapter",
"organization_id": "org-42",
"set_at": "2026-03-26T08:00:00Z"
}
POST
/api/v1/active-unit/api/v1/active-unit
Set the active unit for the current user session
Public
Request Example
{
"unit_id": "unit-019"
}
Response Example
{
"user_id": "usr-77",
"active_unit_id": "unit-019",
"unit_name": "Bergen Chapter",
"set_at": "2026-03-26T12:00:00Z"
}
PUT
/api/v1/active-unit/api/v1/active-unit/current
Switch active unit (replaces previous selection)
Public
Request Example
{
"unit_id": "unit-002"
}
Response Example
{
"user_id": "usr-77",
"active_unit_id": "unit-002",
"previous_unit_id": "unit-019",
"updated_at": "2026-03-26T13:00:00Z"
}
DELETE
/api/v1/active-unit/api/v1/active-unit/current
Clear the active unit selection for the current user
Public
Response Example
{
"cleared": true,
"user_id": "usr-77"
}