1. API Purpose
The Staff Management API allows school administrators to manage their team. It defines designations with specific permissions that gate access to features within the Teacher App.2. Endpoint Definition
3. Authentication Flow
Standard JWT validation.- Only users with Admin roles can access these endpoints.
- Staff members can view their own profile data via the Auth response or the Profile API.
4. Request Structure
GET /web-app/staff
Query Parameters:POST /web-app/staff
Request Body:GET /web-app/staff/:id
URL Parameters:PUT /web-app/staff/:id
Request Body:POST /web-app/staff/:id/assign-students
Request Body:POST /web-app/staff/:id/unassign-students
Request Body:POST /web-app/staff/:id/reset-pin
Request Body:POST /web-app/staff/:id/archive
URL Parameters:5. Response Structure
Success: Staff List (200 OK)
Route:GET /web-app/staff
Success: Staff Registered (201 Created)
Route:POST /web-app/staff
Success: Staff Profile View (200 OK)
Route:GET /web-app/staff/:id
Success: Profile Updated (200 OK)
Route:PUT /web-app/staff/:id
Success: Students Assigned (201 Created)
Route:POST /web-app/staff/:id/assign-students
Success: Students Unassigned (201 Created)
Route:POST /web-app/staff/:id/unassign-students
Success: PIN Reset (201 Created)
Route:POST /web-app/staff/:id/reset-pin
Success: Record Archived (201 Created)
Route:POST /web-app/staff/:id/archive
6. Error Responses
7. Security Considerations
- Encryption: Staff PINs are hashed using
bcrypt. - RBAC Enforcement: The Teacher App reads the RBAC JSON on login to dynamically enable/disable menu items and UI controls.
8. Token Usage
9. Token Refresh
N/A.10. Logout / Session Invalidation
N/A.11. Usage Example (cURL)
12. Notes / Special Behaviors
- Status Toggle: Setting a staff memberβs status to
0immediately revokes their Teacher App access, even if their token hasnβt expired (checked via session middleware). - Multi-School Staff: A staff member can theoretically belong to multiple schools, but their session is always scoped to a single
skole_id.