API Reference
This page documents the current backend API surface of the ILS application.
It is based on the route mounting in ILS-dev/backend/index.js and the route handlers in ILS-dev/backend/routes.
Mounted API groups
The backend mounts these top-level groups under /api.
| Route group | Purpose |
|---|---|
/api/health |
Service health check |
/api/auth |
Authentication endpoints |
/api/institutions, /api/campuses, /api/courses |
Curriculum and organization management |
/api/modules, /api/assignments |
Module and assignment authoring |
/api/modules/:id/items, /api/library |
Module composition and content library services |
/api/themes, /api/outcomes, /api/outcome-categories, /api/frameworks |
Learning intelligence metadata |
/api/rubrics, /api/rubrics/categories, /api/rubrics/criteria |
Rubric authoring and criteria management |
/api/assessment-types, /api/reference, /api/matrix, /api/periods |
Lookup and reference data |
/api/grading, /api/heatmap, /api/cockpit |
Scoring, mastery reporting, and classroom analytics |
/api/classes, /api/users |
Class delivery, students, and enrollment context |
/api/student, /api/curriculum, /api/quizzes |
Student experience, curriculum composer, and quiz workflows |
/api/projects, /api/period-templates |
Project workflows and reusable period template operations |
/api/events, /api/academic-calendar |
Unified calendar feeds, custom events, and academic calendar management |
/api/submissions, /api/ai |
Submission file handling and AI-assisted quiz generation |
/api/admin/* |
Maintenance and administrative utilities |
High-value workflows
The core app workflows are driven by these endpoints:
| Route | Method | Purpose |
|---|---|---|
/api/grading/classes |
GET |
Class picker for grading cockpit |
/api/grading/classes/:classId/assignments |
GET |
Assignment list with rubric and grading counts |
/api/grading/assignments/:assignmentId/classes/:classId/students |
GET |
Student submission list for one assignment |
/api/grading/classes/:classId/submissions |
GET |
Class submissions grouped by assignment |
/api/grading/submissions/:submissionId |
GET |
Grading cockpit detail for one submission |
/api/grading/submissions/:submissionId/score |
POST |
Save rubric scores and finalize grading |
/api/grading/submissions/:submissionId/return |
PATCH |
Return an assignment submission to the student |
/api/grading/quiz-submissions/:submissionId/return |
PATCH |
Return a quiz submission to the student |
/api/grading/quiz-submissions/:submissionId/reset |
PATCH |
Reset a quiz submission grade |
/api/cockpit/summary |
GET |
Classroom risk and health summary |
/api/heatmap/classes/:classId |
GET |
Heatmap grid for a class |
/api/heatmap/classes/:classId/drilldown |
GET |
Assignment-level evidence for a heatmap cell |
/api/events |
GET |
Unified calendar feed for assignment/quiz due dates, custom events, and academic events |
/api/academic-calendar |
GET |
Institution academic-calendar events expanded for calendar rendering |
Grading API
GET /api/grading/classes
Returns the grading cockpit class picker with module and course metadata.
The response includes assessment_mode for each class.
GET /api/grading/classes/:classId/assignments
Returns assignments in a class with linked rubric metadata and graded/ungraded counts.
GET /api/grading/assignments/:assignmentId/classes/:classId/students
Returns students and submission status for a specific assignment and class. The response includes scored criteria counts and total rubric criteria counts.
GET /api/grading/classes/:classId/submissions
Returns all submissions for a class grouped by assignment.
The response includes overall_score, submission status, and rubric coverage indicators.
GET /api/grading/submissions/:submissionId
Loads full grading detail for one submission. The response includes:
- submission metadata
- student context
- assignment context
- rubric criteria
- linked outcome metadata
- rating options for each criterion
assessment_mode
POST /api/grading/submissions/:submissionId/score
Saves selected rubric scores for a submission.
Request payload:
scores— array of objects withcriterion_id,rating_id,score, and optionalgrader_notesgrader_notes— optional overall notes for the submissionfinalize— boolean to request finalization of grading
Behavior:
- inserts or updates
submission_criterion_scores - computes the submission total score
- updates
submissions.overall_scoreandsubmissions.grade_status - optionally finalizes grading and writes outcome snapshots
PATCH /api/grading/submissions/:submissionId/return
Returns an assignment submission to the student for revision. This is only enabled when the student still has remaining retry attempts.
PATCH /api/grading/quiz-submissions/:submissionId/return
Returns a quiz submission to the student for revision while preserving the quiz attempt count semantics.
PATCH /api/grading/quiz-submissions/:submissionId/reset
Resets a quiz submission grade to allow a fresh grading workflow or retry evaluation.
Cockpit API
GET /api/cockpit/summary
Supported query parameters:
campusId— optional campus filterperiodId— optional academic period filterclassIds— optional comma-separated list of class IDs
Returns:
pulse— top-level counts for at-risk, inactive, pending, and flagged classesclasses— per-class health rows with thresholds and rule metadataat_risk_students— prioritized student list for teacher action
This endpoint reads mastery state from student_outcome_snapshots and computes pending/overdue workload using class enrollments and submission status. It is the main backend data source for the Teacher Student Cockpit.
Heatmap API
GET /api/heatmap/classes/:classId
Supported query parameters:
moduleId— optional filter to outcomes linked by assignments in a moduleincludeTrends=true— optional trend enrichment
Returns:
outcomes— outcome columns used by the classstudents— students with current mastery scores and pending submission markerssummary— graded and pending counts, average score, and at-risk totals
This endpoint is the main backend data source for the Classroom Intelligence frontend page.
Classroom Intelligence uses the returned outcomes, students, and summary payload to derive cohort patterns, teaching insights, and suggested interventions.
GET /api/heatmap/classes/:classId/drilldown
Required query parameters:
outcomeIduserId
Optional query parameter:
moduleId
Returns rows of assignment and criterion-level evidence for the selected student and outcome.
Course and module APIs
GET /api/courses
Returns all courses.
POST /api/courses
Creates a course record. Supported fields include:
titledescriptioncodeshort_codedurationleveltotal_creditsstatusenrollment_typeprimary_colordefault_teaching_method_iddefault_assessment_type_id
GET /api/modules
Returns modules with aggregated outcome and theme counts.
GET /api/modules/bank/outcomes
Returns a lightweight outcomes bank for module and assignment editors.
GET /api/modules/bank/ref_teaching_methods
Returns reference teaching methods used by the module editor.
GET /api/modules/bank/assignments
Returns a bank of assignments for module-related editor screens.
POST /api/modules
Creates a minimal module record. Required fields:
titlecourse_id
Optional fields include:
codedurationlevelweight
PUT /api/modules/:id
Updates module metadata and child collections. Supported payload fields include:
title,code,duration,level,weight,course_idoutcome_idsstructuresteaching_method_idsassessmentsassessment_idstheme_ids
Updates are performed transactionally in backend/routes/module.js.
GET /api/modules/:id/items
Returns ordered module content items used by module composition pages. The response includes mixed content types such as assignments and quizzes.
POST /api/modules/:id/items
Adds a content item to a module.
The payload includes content_type and content_id.
PATCH /api/modules/:id/items/reorder
Updates content ordering for module items in bulk.
PATCH /api/modules/:id/items/:itemId
Updates module-item lock settings for sequence prerequisites.
Supported payload fields:
locked_by_previous— booleanunlock_on— one ofsubmit,grade,pass
This endpoint is used by Module Composer to define prerequisite progression between adjacent items in a module sequence.
DELETE /api/modules/:id/items/:itemId
Removes an item from a module.
GET /api/assignments
Returns all assignments with module context for admin views.
POST /api/assignments
Creates a new assignment. Required field:
module_id
Optional fields include:
titledescriptionpoints_possibledue_dateavailable_fromavailable_untilweightstatusdisplay_grade_assubmission_typerubric_ids
GET /api/assignments/:id
Returns a single assignment with linked rubrics.
PUT /api/assignments/:id
Updates assignment fields and optional rubric_ids.
Quiz APIs
The quiz route group supports authoring, item management, student attempts, and results.
GET /api/quizzesPOST /api/quizzesGET /api/quizzes/:idPUT /api/quizzes/:idDELETE /api/quizzes/:idPOST /api/quizzes/:id/itemsPUT /api/quizzes/:id/items/:itemIdDELETE /api/quizzes/:id/items/:itemIdPATCH /api/quizzes/:id/items/reorderPOST /api/quizzes/:id/startPOST /api/quizzes/:id/submitGET /api/quizzes/:id/resultsGET /api/quizzes/:id/my-result
Calendar APIs
The calendar layer is currently exposed via two route groups: /api/events and /api/academic-calendar.
GET /api/events
Required query parameters:
from(YYYY-MM-DD)to(YYYY-MM-DD)
Optional scope filters:
classIdstudentIdteacherId
Returns a unified event list combining:
- computed assignment due events (
assignment_due) - computed assignment opening events (
assignment_open) - computed quiz and exam due events (
quiz_due,exam) - custom events from
calendar_events(including recurring expansion) - academic calendar events from
academic_calendar_events(expanded to per-day entries)
Event objects include core fields such as:
id,type,titledate,starts_at,ends_at,all_dayentity_type,entity_idclass_id,class_name
POST /api/events
Creates a custom event.
Body fields:
title(required)starts_at(required)event_type(optional, defaultcustom)description,locationfrequency,frequency_untilends_at,all_dayclass_id,course_id
PATCH /api/events/:id
Updates a custom event (partial update for editable fields such as title, dates, type, class link, recurrence, and description).
DELETE /api/events/:id
Soft-deletes a custom event.
GET /api/academic-calendar
Required query parameters:
from(YYYY-MM-DD)to(YYYY-MM-DD)
Optional query parameter:
institutionId
Returns institution-wide academic events (for example holidays and exam periods) expanded to one event row per day within the requested range.
POST /api/academic-calendar
Creates an academic calendar event.
Body fields:
title(required)starts_on(required)event_type(optional, validated set)description,ends_oninstitution_id,academic_year
PATCH /api/academic-calendar/:id
Updates academic event metadata and dates.
DELETE /api/academic-calendar/:id
--
Detailed examples: Calendar & Module Items
These examples are extracted from the running backend route handlers in ILS-dev and show the concrete field names and typical shapes returned by the database queries.
Example: GET /api/events?from=2026-05-01&to=2026-05-31
Response (array of event objects):
[{
"id": "assignment-due-123",
"type": "assignment_due",
"title": "Essay: Climate Change",
"date": "2026-05-12",
"starts_at": "2026-05-12T00:00:00",
"ends_at": "2026-05-12T00:00:00",
"all_day": true,
"entity_type": "assignment",
"entity_id": 123,
"class_id": 45,
"class_name": "Enviro 101"
},
{
"id": "custom-77-2026-05-05",
"type": "holiday",
"title": "Mid-term Holiday",
"date": "2026-05-05",
"starts_at": "2026-05-05T00:00:00",
"ends_at": "2026-05-05T23:59:59",
"all_day": true,
"entity_type": "calendar_event",
"entity_id": 77,
"class_id": null,
"class_name": null,
"description": "Campus closed",
"frequency": "does_not_repeat"
},
{
"id": "academic-3-2026-05-01",
"type": "academic_holiday",
"title": "Semester Break",
"date": "2026-05-01",
"starts_at": "2026-05-01",
"ends_at": "2026-05-07",
"all_day": true,
"entity_type": "academic_calendar",
"entity_id": 3,
"description": "Semester break",
"institution_name": "Springfield University",
"academic_year": "2025-2026"
}]
Notes:
- The GET /api/events handler composes computed events (assignment due/open, quiz/exam due), expands recurring calendar_events via the frequency/frequency_until fields, and expands multi-day academic_calendar_events into one row per date.
- Query parameters from and to are required. Use classId, studentId, or teacherId to scope results.
Example: POST /api/events (create custom event)
Request body:
{
"event_type": "custom",
"title": "Study Group",
"description": "Room 101",
"starts_at": "2026-05-20T18:00:00",
"ends_at": "2026-05-20T19:30:00",
"all_day": false,
"class_id": 45
}
Response: the inserted calendar_events row is returned (all columns present).
Example: GET /api/academic-calendar?from=2026-05-01&to=2026-05-31
Response (expanded per-day academic events):
[{ "id": "academic-3-2026-05-01", "type": "academic_holiday", "title": "Semester Break", "date": "2026-05-01", "starts_at": "2026-05-01", "ends_at": "2026-05-07", "all_day": true, "entity_type": "academic_calendar", "entity_id": 3, "description": "Semester break", "institution_name": "Springfield University", "academic_year": "2025-2026" }]
Validation:
- POST /api/academic-calendar validates event_type against a server list: ['holiday','exam_period','semester_start','semester_end','break','registration'].
Example: GET /api/modules/:id/items (module composition)
Response (ordered array):
[{ "id": 501, "module_id": 34, "content_type": "assignment", "content_id": 123, "position": 10, "title": "Essay: Climate Change", "status": "published", "due_date": "2026-05-12", "points_possible": "100", "rubric_total_points": "40", "locked_by_previous": true, "unlock_on": "grade" },
{ "id": 502, "module_id": 34, "content_type": "quiz", "content_id": 88, "position": 20, "title": "Quiz 1", "status": "published", "due_date": "2026-05-05", "quiz_type": "formative", "item_count": "10", "locked_by_previous": false, "unlock_on": null }]
Supported module-item mutations:
- POST /api/modules/:id/items — add an item. Body: { content_type: 'assignment'|'quiz'|'project', content_id: number }. Returns 201 with created row or 409 if already exists.
- PATCH /api/modules/:id/items/reorder — body: { items: [{ id, position }, ...] } to atomically update positions.
- PATCH /api/modules/:id/items/:itemId — body may include locked_by_previous (boolean) and unlock_on (submit|grade|pass). Invalid unlock_on values return 400.
- DELETE /api/modules/:id/items/:itemId — deletes the module_item row.
Implementation notes:
- The module-items queries coalesce related assignment/quiz metadata (title, due_date, points) into the response for easier UI rendering.
- position uses spaced increments (e.g., +10) and POST computes new position as max_pos + 10.
Soft-deletes an academic calendar event.
Curriculum composer APIs
The curriculum route group supports period trees, course structure slots, module library selection, and class-to-course mappings.
GET /api/curriculum/courses/:courseId/structureGET /api/curriculum/modules/libraryPOST /api/curriculum/courses/:courseId/periodsPATCH /api/curriculum/periods/:periodIdDELETE /api/curriculum/periods/:periodIdPATCH /api/curriculum/courses/:courseId/periods/reorderPOST /api/curriculum/courses/:courseId/structurePATCH /api/curriculum/structure/:idPATCH /api/curriculum/courses/:courseId/structure/reorderDELETE /api/curriculum/structure/:idPOST /api/curriculum/modules/:moduleId/forkPATCH /api/curriculum/modules/:moduleId/libraryGET /api/curriculum/courses/:courseId/classesGET /api/curriculum/classes/availablePOST /api/curriculum/courses/:courseId/classes/:classIdDELETE /api/curriculum/courses/:courseId/classes/:classId
Period templates
GET /api/period-templates— list saved period templates with item countsGET /api/period-templates/:id— fetch one template with its full period treePOST /api/period-templates— create a new period templatePUT /api/period-templates/:id— update an existing template and replace its itemsDELETE /api/period-templates/:id— remove a templatePOST /api/period-templates/:id/apply— apply a template to a course’s academic periods
Student APIs
The student route group powers student-facing pages for work lists, curriculum, assignment details, submissions, and dashboard summaries.
GET /api/student/my-workGET /api/student/coursesGET /api/student/courses/:courseId/curriculumGET /api/student/courses/:courseId/enrolled-modulesGET /api/student/course-structureGET /api/student/assignments/:assignmentIdPOST /api/student/submissionsPATCH /api/student/submissions/:id/submitGET /api/student/dashboard
AI quiz generation API
POST /api/ai/quiz/generate
Generates quiz-question candidates from selected outcomes. This endpoint returns quiz-item-compatible objects for quiz authoring flows.
Class and user APIs
GET /api/classes
Returns classes with module and assignment context for the admin view.
GET /api/classes/:id
Returns detailed metadata for one class, including module, course, campus, and period context.
GET /api/classes/my
Returns classes assigned to the current teacher (requires teacher role).
GET /api/classes/:id/students
Returns students enrolled in a class along with enrollment status, cohort, and last submission timestamp.
GET /api/classes/:id/modules
Returns modules assigned to a class, including assigned module teachers.
GET /api/classes/:id/projects
Returns projects assigned to a class, including project status and due/available dates.
GET /api/classes/health
Returns readiness and health metrics for all classes, or only the current teacher's classes when mine=true.
GET /api/users
Returns users, including students and teachers.
Rubric APIs
GET /api/rubrics
Returns a list of rubrics with category metadata, criteria counts, and total points.
GET /api/rubrics/:id
Returns a full rubric with criteria, ratings, and linked outcomes.
POST /api/rubrics
Creates a rubric and nested criteria and ratings.
PUT /api/rubrics/:id
Updates rubric metadata and replaces criteria and ratings when provided.
DELETE /api/rubrics/:id
Deletes a rubric and its child criteria and ratings.
GET /api/rubrics/categories
Returns rubric categories.
GET /api/rubrics/criteria
Returns the full rubric criteria bank across all rubrics, including linked outcome metadata.
Reference APIs
The backend also exposes support and lookup endpoints for curriculum setup:
/api/themes/api/outcomes/api/outcome-categories/api/frameworks/api/reference
For calendar UI configuration, reference endpoints include:
GET /api/reference/event-typesPOST /api/reference/event-typesPUT /api/reference/event-types/:idDELETE /api/reference/event-types/:id
GET /api/reference/event-types supports optional query parameter category (individual or academic) for filtered event-type lists.
- /api/assessment-types
- /api/periods
- /api/matrix
/api/matrix returns curriculum mapping data used by the admin matrix page.
Library APIs
The library route group provides content discovery and metadata for authoring workflows.
GET /api/library/usage
Returns usage statistics for content items (assignments and quizzes) across modules.
Returns a JSON object mapping content identifiers to their usage information:
{
"assignment:12": {
"usage_count": 3,
"course_titles": ["Mathematics 101", "STEM 201"]
},
"quiz:45": {
"usage_count": 1,
"course_titles": ["Physics 110"]
}
}
Use this endpoint to show authors how many modules use each piece of content.
GET /api/library/disciplines
Returns a sorted list of distinct discipline values from assignments and quizzes.
This endpoint supports content filtering and categorization in library browsing interfaces.
Admin maintenance APIs
Maintenance routes under /api/admin include:
/api/admin/seed-assessment-descriptions/api/admin/describe-module-teaching-methods/api/admin/describe-outcomes/api/admin/migrate-outcomes
These administrative utility endpoints support schema inspection, seed data population, and migration support. They are not part of the main teacher or admin workflows.
Last updated: 2026-07-08