1. API Purpose
The Student Management API is the central registry of the Skole platform. It powers all other modules by establishing student identities and linking them to parents, staff, and school-specific data.2. Endpoint Definition
| Method | Route | Auth | Description |
|---|---|---|---|
| GET | /parent-app/student-detail | 🔐 JWT | View child’s full profile |
| GET | /teachers-app/students | 🔐 JWT | List assigned students (Teacher) |
| GET | /web-app/students | 🔐 JWT | Full student registry (Admin) |
| PUT | /web-app/students/:id | 🔐 JWT | Update student record |
| POST | /web-app/students/:id/archive | 🔐 JWT | Archive student record |
| POST | /web-app/students/:id/reset-password | 🔐 JWT | Reset parent PIN |
3. Authentication Flow
- Guardians: Access is restricted to children linked to the parent’s
phone_noin the database. - Teachers: Access is restricted to students assigned to them via the
staff_studentjunction table. - Admins: Full access scoped by
skole_id.
4. Request Structure
GET /teachers-app/students
Query Parameters:| Field | Type | Required | Description |
|---|---|---|---|
| skole_id | string | Yes | School identifier. |
| grade | string | No | Filter by grade/class. |
GET /web-app/students
Query Parameters:| Field | Type | Required | Description |
|---|---|---|---|
| skole_id | string | Yes | School identifier. |
| search | string | No | Search by name or roll number. |
| grade | string | No | Filter by grade/class. |
| status | string | No | Enum: active, archived, all. |
| page | number | No | Default: 1. |
| limit | number | No | Default: 10. |
PUT /web-app/students/:id
Request Body:POST /web-app/students/:id/archive
URL Parameters:| Field | Type | Description |
|---|---|---|
| id | number | Student ID to archive. |
POST /web-app/students/:id/reset-password
Request Body:5. Response Structure
Success: Child Profile Detail (200 OK)
Route:GET /parent-app/student-detail
Success: Teacher Student List (200 OK)
Route:GET /teachers-app/students
Success: Admin Student Registry (200 OK)
Route:GET /web-app/students
Success: Student Updated (200 OK)
Route:PUT /web-app/students/:id
Success: Record Archived (200 OK)
Route:POST /web-app/students/:id/archive
Success: PIN Reset (200 OK)
Route:POST /web-app/students/:id/reset-password
6. Error Responses
| HTTP Code | Description |
|---|---|
| 404 | Student not found |
| 403 | Attempting to access a student not assigned to the user |
7. Security Considerations
- PIN Security: Resetting a PIN requires Admin-level JWT.
- Isolation: Cross-tenant access is blocked via the global
SkoleGuard.
8. Token Usage
9. Token Refresh
N/A.10. Logout / Session Invalidation
N/A.11. Usage Example (cURL)
12. Notes / Special Behaviors
- Lifecycle: Students can move from
registeredtoactive,inactive, and eventuallyarchived. - Roll Numbers: Roll numbers must be unique within a school (
skole_id).