1. API Purpose
The Activities API serves as the schoolβs social feed. It communicates events, achievements, and general announcements to parents, fostering engagement through a familiar interactive interface.2. Endpoint Definition
3. Authentication Flow
Standard Bearer JWT validation. Access is scoped byskole_id. Staff require specific RBAC permissions to create or delete posts.
4. Request Structure
GET /parent-app/activities
Query Parameters:GET /teachers-app/activities
Query Parameters:POST /teachers-app/activities
Request Body:PUT /teachers-app/activities/:id
Request Body:DELETE /teachers-app/activities/:id
URL Parameters:GET /web-app/activities
Query Parameters:5. Response Structure
Success: Parent Feed View (200 OK)
Route:GET /parent-app/activities
Success: Teacher Activity List (200 OK)
Route:GET /teachers-app/activities
Success: Activity Created (201 Created)
Route:POST /teachers-app/activities
Success: Activity Updated (200 OK)
Route:PUT /teachers-app/activities/:id
Success: Activity Deleted (200 OK)
Route:DELETE /teachers-app/activities/:id
Success: Admin Dashboard Feed (200 OK)
Route:GET /web-app/activities
6. Error Responses
7. Security Considerations
- Soft Delete:
deleted_status = 1hides the item from all feeds without breaking database relations. - Tenant Isolation: Enforced via
skole_idin JWT payload.
8. Token Usage
9. Token Refresh
N/A.10. Logout / Session Invalidation
N/A.11. Usage Example (cURL)
12. Notes / Special Behaviors
- Engagement Integration: Comments and reactions for activities are handled by the separate Engagement API.
- Targeting: Activities can be βSchool-wideβ or targeted to a specific
student_id.