Subjects are the top-level learning categories in Sealearn — think “Mathematics”, “History”, or “Python Programming”. Each subject owns an ordered collection of Units, and each unit contains the individual Lessons a learner progresses through. Every authenticated user can browse and read subjects; write operations (create, update, delete) are restricted to administrators.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DerBasilisk/SEA-ServicioEvaluaconAsistida/llms.txt
Use this file to discover all available pages before exploring further.
Data models
Subject
Display name of the subject. Must be unique across the platform. No enforced character limit in the schema.
URL-safe identifier auto-generated from
name on save (lowercase, diacritics stripped, spaces replaced with hyphens). Used as the lookup key in GET /api/subjects/:slug.Short description of what the subject covers. Maximum 300 characters.
Emoji or icon string displayed in the UI alongside the subject name. Defaults to
📚.Hex color string used for the subject’s theme card. Defaults to
#4F46E5.Integer sort position used when listing subjects. Lower values appear first. Defaults to
0.Soft-delete flag. Only subjects with
isActive: true are returned to learners. Defaults to true. Setting this to false via DELETE /api/subjects/:id hides the subject without destroying its data.Optional free-text prompt context injected into AI question generation calls for this subject. Helps the model stay on topic. Defaults to an empty string.
Virtual array of Unit documents that reference this subject. Populated on demand — not stored directly on the subject document.
Unit
Display name of the unit (e.g. “Linear Equations”, “World War II”).
Brief description of the unit’s content. Maximum 500 characters.
Emoji or icon string. Defaults to
📖.Position of the unit within its parent subject’s map. Combined with
subject, this value must be unique — no two units in the same subject can share an order number.Minimum XP the user must have earned in this subject before the unit unlocks. Defaults to
0.Reference to the parent
Subject document.Soft-delete flag. Defaults to
true.Virtual array of Lesson documents that belong to this unit. Populated when fetching a subject by slug.
Endpoints
GET /api/subjects
Returns all active subjects, each enriched with the authenticated user’s progress data: total lessons, how many they have completed, and an overall completion percentage. Authentication: Bearer token required.true on success.Array of subject objects.
GET /api/subjects/:slug
Returns a single active subject identified by its slug, with all of its units and their lessons fully populated. Each lesson carries the requesting user’s personal status (locked, available, in_progress, or completed), best score, completion count, and the next spaced-repetition review date when applicable.
Authentication: Bearer token required.
Path parameters
URL slug of the subject (e.g.
mathematics).true on success.Subject object with units and progress summary.
The first lesson in each unit always has a default status of
available when no progress record exists. All subsequent lessons start as locked and are unlocked after the preceding lesson is completed at least 4 times.POST /api/subjects
Creates a new subject. Theslug is auto-generated from name if not provided.
Authentication: Bearer token + admin role required.
Request body
Unique display name for the subject.
Short description. Maximum 300 characters.
Emoji or icon string. Defaults to
📚.Hex color string (e.g.
#10B981). Defaults to #4F46E5.Sort position in the subject list. Defaults to
0.Whether the subject is immediately visible to learners. Defaults to
true.Optional context string passed to the AI when generating questions for any lesson within this subject.
201 Created with the new subject document under data.
PUT /api/subjects/:id
Updates an existing subject. Only the fields included in the request body are modified. Runs schema validators on the provided values. Authentication: Bearer token + admin role required. Path parametersMongoDB ObjectId of the subject to update.
POST /api/subjects above).
200 OK with the updated subject document under data. Returns 404 if the subject does not exist.
DELETE /api/subjects/:id
Performs a soft delete: setsisActive to false so the subject no longer appears in learner-facing responses. No data is permanently removed.
Authentication: Bearer token + admin role required.
Path parameters
MongoDB ObjectId of the subject to deactivate.