Admin State BLoC
API Contract
REST
/api/v1/admin/state
7 endpoints
GET
/api/v1/admin/state/api/v1/admin/state/dashboard
Fetch current dashboard state snapshot for the authenticated admin
Public
Response Example
{
"data": {
"org_id": "org_kNr8aQ",
"selected_org_node_id": "org_tY2zLm",
"dashboard_stats": {
"active_mentors": 42,
"monthly_activities": 317,
"pending_reimbursements": 9,
"total_users": 184
},
"refreshed_at": "2026-03-26T11:00:00Z"
}
}
POST
/api/v1/admin/state/api/v1/admin/state/dashboard/refresh
Trigger a dashboard state refresh
Public
Request Example
{
"org_id": "org_kNr8aQ"
}
Response Example
{
"data": {
"org_id": "org_kNr8aQ",
"refreshed_at": "2026-03-26T11:30:00Z"
}
}
GET
/api/v1/admin/state/api/v1/admin/state/users
Get paginated user list state with current filter applied
Public
Response Example
{
"data": [
{
"user_id": "usr_hA3mXp",
"full_name": "Astrid Haugen",
"role": "mentor",
"status": "active"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 184
},
"active_filters": {
"role": "mentor",
"status": "active"
}
}
PUT
/api/v1/admin/state/api/v1/admin/state/users
Update the active user list filters
Public
Request Example
{
"org_id": "org_kNr8aQ",
"filters": {
"role": "mentee",
"status": "active"
}
}
Response Example
{
"data": {
"org_id": "org_kNr8aQ",
"active_filters": {
"role": "mentee",
"status": "active"
},
"updated_at": "2026-03-26T11:32:00Z"
}
}
GET
/api/v1/admin/state/api/v1/admin/state/selected-org
Get the currently selected org node in the admin's session
Public
Response Example
{
"data": {
"admin_id": "usr_hA3mXp",
"selected_org_node_id": "org_tY2zLm",
"selected_org_name": "Rogaland Nord",
"selected_at": "2026-03-26T10:00:00Z"
}
}
POST
/api/v1/admin/state/api/v1/admin/state/selected-org
Set the admin's selected org node
Public
Request Example
{
"admin_id": "usr_hA3mXp",
"org_node_id": "org_xW7pNq"
}
Response Example
{
"data": {
"admin_id": "usr_hA3mXp",
"selected_org_node_id": "org_xW7pNq",
"selected_org_name": "Haugaland Sør og Vest",
"selected_at": "2026-03-26T11:35:00Z"
}
}
DELETE
/api/v1/admin/state/api/v1/admin/state/selected-org
Clear the admin's org node selection (reset to root scope)
Public
Response Example
{
"data": {
"admin_id": "usr_hA3mXp",
"selected_org_node_id": null,
"cleared_at": "2026-03-26T11:36:00Z"
}
}