The Alerts API surfaces issues that theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/vruizz22/innova-backend-serverless/llms.txt
Use this file to discover all available pages before exploring further.
alertGenerator Lambda detects hourly from mastery data — such as students whose pKnown is dropping or consistently stuck below threshold. Teachers can also create alerts manually (e.g. after a classroom observation) and mark them resolved once the issue has been addressed. All active alerts have resolvedAt: null; only unresolved alerts are returned by the list endpoint.
Endpoints
GET /alerts
List active (unresolved) alerts. Filter bycourseId or its alias classroomId. Returns records ordered by createdAt descending.
Authentication: JWT required
UUID of the course to list alerts for.
Alias for
courseId — accepted for backward compatibility with older client versions.Alert UUID.
Type code — see Alert types below.
LOW, MED, or HIGH.UUID of the teacher who owns the alert.
UUID of the course the alert belongs to.
UUID of the topic associated with the alert, if applicable.
UUID of the student the alert concerns, if applicable.
Arbitrary diagnostic data — shape depends on
alertType. Common keys: pKnown (float), attemptsCount (int).ISO 8601 creation timestamp.
ISO 8601 resolution timestamp, or
null if still active.POST /alerts
Create an alert manually. Useful when a teacher notices a pattern during class that hasn’t yet triggered an automated alert. Authentication: JWT requiredUUID of the course this alert belongs to.
UUID of the teacher creating the alert.
Alert type code (e.g.
LOW_MASTERY, HIGH_ERROR_RATE).UUID of the topic the alert concerns. Optional.
UUID of the student the alert concerns. Optional — omit for class-wide alerts.
LOW, MED, or HIGH. Defaults to MED if omitted.Arbitrary JSON payload for diagnostic context. Optional.
201 Created — the created AlertView object.
PATCH /alerts/:id/resolve
Mark an alert as resolved. SetsresolvedAt to the current timestamp. The alert will no longer appear in GET /alerts responses.
Authentication: JWT required
UUID of the alert to resolve.
Alert UUID.
ISO 8601 timestamp at which the alert was resolved.
Resolving an alert is idempotent from a data-safety standpoint — calling this endpoint on an already-resolved alert will update
resolvedAt again. If you need idempotent resolving, check resolvedAt before calling.Alert types
alertType | Description |
|---|---|
LOW_MASTERY | Student’s pKnown for a topic has dropped below the low-mastery threshold (typically < 0.40). |
DECLINING_MASTERY | Student’s pKnown shows a sustained downward trend over recent sessions. |
HIGH_ERROR_RATE | A specific error code is appearing at an unusually high rate for a student or class. |
STUCK_STUDENT | Student has made many attempts on a topic without improvement — may need direct intervention. |
alertType is an open string field — integrating systems or teacher-authored alerts can use custom types beyond this list. The four above are the canonical types generated by the alertGenerator Lambda.Auto-generation
ThealertGenerator Lambda runs on an hourly schedule (driven by the SQS_HOURLY_ALERTS_URL queue). On each run it:
- Scans
StudentTopicMasteryrecords for all active enrollments. - Computes
pKnowntrajectories and compares them against configured thresholds. - Creates
TeacherAlertrecords when a threshold is breached — one alert per (student, topic, alertType) combination to avoid duplicates. - Skips students who already have an unresolved alert of the same type for the same topic.
hourlyAlertsEnabled flag visible in GET /admin/status. Unlike the grader and classifier, this killswitch is always reported as true (there is no SSM parameter to pause it independently).