Get Hedhog updates in your inbox
New releases, fresh recipes, and breaking changes — no spam.
LMS Submodule
courses
Core course catalog management — CRUD, the session/lesson content tree, Operations task integration, audio transcription/translation, SCORM export, and S3 bulk video upload.
Source path: libraries/lms/src/course
Module file: course.module.ts
Introduction
The Courses submodule is the largest in LMS and owns the full authoring pipeline for a course, from the catalog record down to individual video frames inside a lesson. `CourseController` exposes catalog-level operations — create/update/delete, filterable listing by status/level/category/offering type, aggregate stats, a content-overview endpoint that reports module/lesson counts and transcription/XP coverage, storage-cleanup jobs scoped by file category, and SCORM 1.2 export job management with configurable visual theming (colors, fonts, sidebar layout).
`CourseStructureController` is the editing surface for the nested session → lesson tree that makes up a course's content. Sessions (modules) contain lessons; lessons carry a `tipo` of video, questao (linked exam), or post, plus rich metadata for video provider (YouTube, Vimeo, internal file storage, Bunny, or custom), production status, and an optional resource list. Reordering, duplication, cross-session moves, and paste-from-clipboard are all first-class operations rather than being reconstructed client-side from full-tree PATCHes — this keeps large course trees editable without re-sending the entire structure on every change. Frames (still images extracted from a lesson video at a timestamp) are managed as their own sub-resource, supporting use cases like auto-generated thumbnails or chapter markers. A dedicated bulk-jobs endpoint lets an editor re-trigger transcription, XP recalculation, video processing, or transcription translation across every lesson in a course in one call, returning a per-lesson queued/skipped breakdown.
Video handling spans three controllers working together: `CourseStructureController` exposes video-processing-stats and enqueues per-lesson HLS conversion jobs; `CourseLessonController` (mounted at `/lms/lessons`) owns transcription segments (time-coded captions), lesson audio files, and kicks off transcription/translation background jobs; `LmsBulkUploadController` provides the direct-to-S3 upload pipeline used for ingesting large video files — issuing temporary STS credentials, verifying upload completion, tracking session/item progress for the admin UI, and linking a finished upload directly to a lesson to trigger automated conversion. `LmsSettingController` exposes the resulting feature-flag surface (whether transcription, image extraction, YouTube/Vimeo embedding, and bulk upload are enabled, plus the resolved S3 bucket/IAM configuration) so the admin frontend can conditionally render upload/transcription UI.
Notably, several of the newer endpoints (lesson transcription translation, most of the bulk-upload session/webhook endpoints) accept plain inline TypeScript body shapes rather than class-validator DTOs, so they receive no runtime payload validation — a deliberate or incidental gap worth knowing about before building strict client-side contracts against them.
HTTP Endpoints
54 endpoints
Paginated, filterable course list.
- Query
- page, pageSize, search, status, level, category, offeringTypes
Aggregate stats: total, published, featured courses, and total students.
Content overview: module/lesson counts by type and published state, transcription/XP coverage, extracted images, and storage file counts.
- Params
- id (int)
Enqueues an async job to delete all storage files of one category for the course.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| category | string | yes | One of: video_original, video_profile, lesson_audio, extracted_image, student_download, supplementary_material, course_image, course_file, other_lesson_file, course_export |
Lists SCORM export job history for the course.
- Params
- id (int)
Enqueues a SCORM 1.2 export job for the course with optional visual theming.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| format | 'scorm_1_2' | yes | — |
| visualSettings | ScormVisualSettingsDto | no | primaryColor, fontFamily, fontSize, sidebarWidth, sidebarPosition, progressStyle, sidebarTheme |
| subtitleLocaleIds | number[] | no | — |
Deletes a course export record/artifact.
- Params
- id, exportId (int)
Full course details including categories, images, and lesson instructors.
- Params
- id (int)
Creates a course.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| slug | string | yes | Kebab-case, max 255 chars |
| name | string | no | Max 32 chars |
| title | string | no | Public title, max 255 chars |
| description | string | no | — |
| requirements | string | no | — |
| objectives | string | no | — |
| targetAudience | string | no | — |
| durationHours | number | no | — |
| certificateWorkload | number | no | — |
| level | 'beginner' | 'intermediate' | 'advanced' | no | — |
| status | 'draft' | 'published' | 'archived' | no | — |
| offeringType | 'scheduled' | 'on_demand' | 'blended' | no | — |
| isFeatured | boolean | no | — |
| hasCertificate | boolean | no | — |
| isListed | boolean | no | — |
| primaryColor | string | no | Hex #RRGGBB |
| secondaryColor | string | no | Hex #RRGGBB |
| certificateModel | string | null | no | — |
| logoFileId | number | null | no | — |
| bannerFileId | number | null | no | — |
| operationsProjectId | number | null | no | — |
| code | string | no | Uppercase/numbers, min 2 chars |
Updates course fields (all optional, same shape as create).
- Params
- id (int)
Deletes a course.
- Params
- id (int)
Returns the full nested session → lesson tree.
- Params
- id (int)
Returns course-level supplementary resources.
- Params
- id (int)
Replaces the course-level resource list.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| recursos | CourseResourceDto[] | yes | { nome, fileId?, type?, is_public? }[] |
Adds a session (module) to the course.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| titulo | string | yes | Max 255 chars |
| duracao | number | yes | Duration in seconds, min 0 |
| codigo | string | no | Max 32 chars |
| descricao | string | no | — |
| published | boolean | no | — |
Reorders sessions.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| sessionIds | number[] | yes | ArrayMinSize(1) |
Updates session metadata.
- Params
- id, sessionId (int)
Deletes a session and its lessons.
- Params
- id, sessionId (int)
Deep-copies a session with all its lessons.
- Params
- id, sessionId (int)
Adds a lesson to a session.
- Params
- id, sessionId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| titulo | string | yes | Max 255 chars |
| tipo | 'video' | 'questao' | 'post' | yes | — |
| codigo | string | no | Max 32 chars |
| descricaoPublica | string | no | — |
| descricaoPrivada | string | no | — |
| duracao | number | no | Seconds, default 0 |
| published | boolean | no | — |
| statusProducao | 'preparada' | 'gravada' | 'editada' | 'finalizada' | 'publicada' | no | — |
| videoProvedor | 'youtube' | 'vimeo' | 'file_storage' | 'bunny' | 'custom' | no | — |
| videoUrl | string | no | — |
| exameVinculado | number | no | Linked exam ID, for tipo=questao |
| conteudoPost | string | no | For tipo=post |
| instructorIds | number[] | no | — |
| recursos | CourseLessonResourceDto[] | no | — |
Copies previously-copied lessons into this session.
- Params
- id, sessionId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| lessonIds | number[] | yes | ArrayMinSize(1) |
Reorders lessons within a session.
- Params
- id, sessionId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| lessonIds | number[] | yes | ArrayMinSize(1) |
Updates lesson metadata.
- Params
- id, sessionId, lessonId (int)
Moves a lesson to a different session/position.
- Params
- id, sessionId, lessonId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| toSessionId | number | yes | — |
| toIndex | number | no | Zero-based; appended at end if omitted |
Starts the video pipeline (HLS/profile conversion) for an uploaded original video file.
- Params
- id, sessionId, lessonId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| originalFileId | number | yes | — |
Deletes a lesson.
- Params
- id, sessionId, lessonId (int)
Adds a frame (extracted image at a timestamp) tied to an already-uploaded file.
- Params
- id, sessionId, lessonId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| timeSeconds | number | yes | — |
| fileId | number | yes | — |
Updates a lesson frame.
- Params
- id, sessionId, lessonId, frameId (int)
Deletes a lesson frame.
- Params
- id, sessionId, lessonId, frameId (int)
Duplicates a lesson within its session.
- Params
- id, sessionId, lessonId (int)
Counts of video lessons: with/without an original file, already processed.
- Params
- id (int)
Locales with transcription segments across the course's lessons.
- Params
- id (int)
Bulk-enqueues a background job type across every lesson in the course; returns queued/skipped counts.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| jobType | 'transcription' | 'xp_recalculation' | 'video_processing' | 'translate_transcription' | yes | — |
| reprocessAlreadyProcessed | boolean | no | — |
| targetLocaleId | number | no | — |
Operations-module integration config for the course (linked project, task mode, completion status).
- Params
- id (int)
Updates the Operations integration config.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| projectId | number | null | no | — |
| taskMode | 'per_lesson' | 'per_production_status' | null | no | — |
| completionStatus | string | null | no | — |
Creates any missing Operations tasks for the course's lessons.
- Params
- id (int)
Time-coded transcription segments for a lesson, optionally filtered by locale.
- Params
- id (int, lessonId)
- Query
- locale_id?
Locales for which this specific lesson has transcription segments.
- Params
- id (int)
Replaces all transcription segments for the lesson/locale.
- Params
- id (int)
- Query
- locale_id?
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| segments | { startSeconds, endSeconds, text }[] | yes | — |
Lists lesson_audio files attached to the lesson.
- Params
- id (int)
Enqueues audio transcription for the lesson using its audio files.
- Params
- id (int)
Enqueues a translation job for an existing transcription to another locale.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| targetLocaleId | number | yes | — |
| sourceLocaleId | number | null | no | — |
Bulk-upload config (bucket, STS duration, storage profile).
Issues temporary STS credentials for direct-to-S3 upload.
Verifies an uploaded file on S3, or (with configure:true) updates the bulk-upload storage profile/Lambda role.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| key | string | no | — |
| fileName | string | no | — |
| configure | boolean | no | — |
| storageProfileId | number | no | — |
| lambdaRoleArn | string | no | — |
Regenerates and syncs the bulk-upload webhook token.
Starts a new bulk-upload session tracking record.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| appName | string | no | — |
| folderPath | string | null | no | — |
| files | { uploadId?, fileName?, sizeBytes? }[] | no | — |
Updates progress/status of an in-flight bulk-upload session and its items.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| sessionId | number | no | — |
| status | string | no | — |
| progressPercent | number | no | — |
| items | { uploadId?, status?, progressPercent?, errorMessage?, uploadedKey? }[] | no | — |
Bulk-upload session/item history.
- Query
- page, pageSize, search, status
Checks which of the given files were already uploaded (dedupe).
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| files | { fileName?, sizeBytes? }[] | no | — |
Deletes historical bulk-upload session records matching given statuses/time window.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| statuses | ('received' | 'done' | 'error' | 'cancelled')[] | no | — |
| timeWindow | 'last_hour' | 'last_day' | 'last_week' | 'all_time' | no | — |
Presigned video URL for a bulk-upload item.
- Params
- id (int)
Manually links an uploaded bulk video item to a course/session/lesson, triggering conversion automation.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| courseId | number | yes | — |
| sessionId | number | yes | — |
| lessonId | number | yes | — |
LMS feature flags (video conversion, transcription, YouTube/Vimeo, bulk-upload bucket/role config).
MCP Tools
Named tools callable by AI models via the Model Context Protocol (MCP).
lms.courses.listLists courses with optional pagination and filters
lms.courses.statsReturns summary statistics for courses
lms.courses.getReturns a single course by ID with full details
lms.courses.createCreates a new course
lms.courses.updateUpdates an existing course
lms.courses.deleteRemoves a course by ID
lms.courses.structure.getReturns the full content structure of a course (modules/sessions and their lessons)
lms.courses.structure.sessions.createCreates a new module/session in a course structure
lms.courses.structure.sessions.reorderReorders modules/sessions within a course structure
lms.courses.structure.sessions.updateUpdates a module/session in a course structure
lms.courses.structure.sessions.deleteDeletes a module/session from a course structure
lms.courses.structure.sessions.duplicateDuplicates a module/session with all its lessons
lms.courses.structure.lessons.createCreates a new lesson inside a module/session
lms.courses.structure.lessons.pastePastes (copies) lessons from another session into a session
lms.courses.structure.lessons.reorderReorders lessons within a session
lms.courses.structure.lessons.updateUpdates a lesson in the course structure
lms.courses.structure.lessons.moveMoves a lesson to a different session
lms.courses.structure.lessons.deleteDeletes a lesson from the course structure
lms.courses.structure.lessons.duplicateDuplicates a lesson within its session
lms.courses.structure.resources.getReturns the resource list (file attachments, links) for a course
lms.courses.structure.resources.updateUpdates the resource list for a course