Role Route Guard
API Contract
REST
/api/v1/route-guards
5 endpoints
GET
/api/v1/route-guards/api/v1/route-guards
List all route permission rules
Public
Response Example
{
"data": [
{
"guard_id": "guard_a1b2c3d4",
"route_path": "/dashboard/coordinator",
"permitted_roles": [
"coordinator",
"admin"
],
"redirect_path": "/unauthorized",
"shell_branch": "coordinator_shell",
"created_at": "2026-01-15T00:00:00Z"
},
{
"guard_id": "guard_e5f6a7b8",
"route_path": "/admin/settings",
"permitted_roles": [
"admin"
],
"redirect_path": "/dashboard",
"shell_branch": "admin_shell",
"created_at": "2026-01-15T00:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 18
}
}
GET
/api/v1/route-guards/api/v1/route-guards/:guardId
Get a specific route permission rule
Public
Response Example
{
"guard_id": "guard_a1b2c3d4",
"route_path": "/dashboard/coordinator",
"permitted_roles": [
"coordinator",
"admin"
],
"redirect_path": "/unauthorized",
"shell_branch": "coordinator_shell",
"created_at": "2026-01-15T00:00:00Z"
}
POST
/api/v1/route-guards/api/v1/route-guards
Define a new route permission rule
Public
Request Example
{
"route_path": "/reports/export",
"permitted_roles": [
"coordinator",
"admin"
],
"redirect_path": "/unauthorized",
"shell_branch": "coordinator_shell"
}
Response Example
{
"guard_id": "guard_z9y8x7w6",
"route_path": "/reports/export",
"permitted_roles": [
"coordinator",
"admin"
],
"redirect_path": "/unauthorized",
"shell_branch": "coordinator_shell",
"created_at": "2026-03-26T10:20:00Z"
}
PUT
/api/v1/route-guards/api/v1/route-guards/:guardId
Update permitted roles or redirect for a route rule
Public
Request Example
{
"permitted_roles": [
"coordinator",
"admin",
"supervisor"
],
"redirect_path": "/access-denied"
}
Response Example
{
"guard_id": "guard_a1b2c3d4",
"route_path": "/dashboard/coordinator",
"permitted_roles": [
"coordinator",
"admin",
"supervisor"
],
"redirect_path": "/access-denied",
"shell_branch": "coordinator_shell",
"created_at": "2026-01-15T00:00:00Z"
}
DELETE
/api/v1/route-guards/api/v1/route-guards/:guardId
Remove a route permission rule
Public
Response Example
{
"deleted": true,
"guard_id": "guard_z9y8x7w6"
}