# Courses API The Courses module manages subject courses (e.g., Mathematics 10A, English Literature). ## Model ```json { "id": "uuid", "name": "Mathematics 10A", "code": "MATH-10A-2024", "short_name": "Math 10A", "academic_session_id": "session-uuid", "semester_id": "semester-uuid", "subject_id": "subject-uuid", "subject": {"id": "...", "name": "Mathematics"}, "program_id": "program-uuid", "education_level_id": "level-uuid", "primary_teacher_id": "teacher-uuid", "primary_teacher": {...}, "teacher_assistants": [...], "status": "inprocess", "type": "core", "canvas_id": "12345", "team_id": "team-uuid" } ``` ## Status Values | Status | Description | |--------|-------------| | `planing` | Course being planned | | `inprocess` | Currently running | | `completed` | Course finished | ## Course Types | Type | Description | |------|-------------| | `core` | Required course | | `elective` | Elective course | | `optional` | Optional course | ## Endpoints ### Standard CRUD | Method | Endpoint | Description | |--------|----------|-------------| | POST | `/api/courses/list` | List courses | | GET | `/api/courses/:id` | Get course details | | POST | `/api/courses` | Create course | | PUT | `/api/courses/:id` | Update course | | DELETE | `/api/courses/:id` | Delete course | ### Get Enrolled Students **Endpoint:** `GET /api/courses/:id/students` Returns students enrolled in the course with optional attendance data. ### Import Courses **Endpoint:** `POST /api/courses/import` ### Import Enrollments **Endpoint:** `POST /api/courses/import-enroll` ### Export Courses **Endpoint:** `POST /api/courses/export` ## Teacher Assignment - `primary_teacher_id`: Main teacher responsible for the course - `teacher_assistants`: Additional teaching staff Changes to primary teacher trigger Canvas sync if integration enabled. ## Canvas Integration When Canvas is enabled: - Course creation creates Canvas course - Enrollments sync to Canvas - Assignments import from Canvas - Grades sync from Canvas gradebook Set `need_canvas_sync: true` to trigger sync.