Logotipo Hedhog

Get Hedhog updates in your inbox

New releases, fresh recipes, and breaking changes — no spam.

Back to LMS modulesLMS Submodule

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

FieldTypeRequiredNotes
categorystringyesOne 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

FieldTypeRequiredNotes
format'scorm_1_2'yes
visualSettingsScormVisualSettingsDtonoprimaryColor, fontFamily, fontSize, sidebarWidth, sidebarPosition, progressStyle, sidebarTheme
subtitleLocaleIdsnumber[]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

FieldTypeRequiredNotes
slugstringyesKebab-case, max 255 chars
namestringnoMax 32 chars
titlestringnoPublic title, max 255 chars
descriptionstringno
requirementsstringno
objectivesstringno
targetAudiencestringno
durationHoursnumberno
certificateWorkloadnumberno
level'beginner' | 'intermediate' | 'advanced'no
status'draft' | 'published' | 'archived'no
offeringType'scheduled' | 'on_demand' | 'blended'no
isFeaturedbooleanno
hasCertificatebooleanno
isListedbooleanno
primaryColorstringnoHex #RRGGBB
secondaryColorstringnoHex #RRGGBB
certificateModelstring | nullno
logoFileIdnumber | nullno
bannerFileIdnumber | nullno
operationsProjectIdnumber | nullno
codestringnoUppercase/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

FieldTypeRequiredNotes
recursosCourseResourceDto[]yes{ nome, fileId?, type?, is_public? }[]

Adds a session (module) to the course.

Params
id (int)

Body

FieldTypeRequiredNotes
titulostringyesMax 255 chars
duracaonumberyesDuration in seconds, min 0
codigostringnoMax 32 chars
descricaostringno
publishedbooleanno

Reorders sessions.

Params
id (int)

Body

FieldTypeRequiredNotes
sessionIdsnumber[]yesArrayMinSize(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

FieldTypeRequiredNotes
titulostringyesMax 255 chars
tipo'video' | 'questao' | 'post'yes
codigostringnoMax 32 chars
descricaoPublicastringno
descricaoPrivadastringno
duracaonumbernoSeconds, default 0
publishedbooleanno
statusProducao'preparada' | 'gravada' | 'editada' | 'finalizada' | 'publicada'no
videoProvedor'youtube' | 'vimeo' | 'file_storage' | 'bunny' | 'custom'no
videoUrlstringno
exameVinculadonumbernoLinked exam ID, for tipo=questao
conteudoPoststringnoFor tipo=post
instructorIdsnumber[]no
recursosCourseLessonResourceDto[]no

Copies previously-copied lessons into this session.

Params
id, sessionId (int)

Body

FieldTypeRequiredNotes
lessonIdsnumber[]yesArrayMinSize(1)

Reorders lessons within a session.

Params
id, sessionId (int)

Body

FieldTypeRequiredNotes
lessonIdsnumber[]yesArrayMinSize(1)

Updates lesson metadata.

Params
id, sessionId, lessonId (int)

Moves a lesson to a different session/position.

Params
id, sessionId, lessonId (int)

Body

FieldTypeRequiredNotes
toSessionIdnumberyes
toIndexnumbernoZero-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

FieldTypeRequiredNotes
originalFileIdnumberyes

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

FieldTypeRequiredNotes
timeSecondsnumberyes
fileIdnumberyes

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

FieldTypeRequiredNotes
jobType'transcription' | 'xp_recalculation' | 'video_processing' | 'translate_transcription'yes
reprocessAlreadyProcessedbooleanno
targetLocaleIdnumberno

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

FieldTypeRequiredNotes
projectIdnumber | nullno
taskMode'per_lesson' | 'per_production_status' | nullno
completionStatusstring | nullno

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

FieldTypeRequiredNotes
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

FieldTypeRequiredNotes
targetLocaleIdnumberyes
sourceLocaleIdnumber | nullno

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

FieldTypeRequiredNotes
keystringno
fileNamestringno
configurebooleanno
storageProfileIdnumberno
lambdaRoleArnstringno

Regenerates and syncs the bulk-upload webhook token.

Starts a new bulk-upload session tracking record.

Body

FieldTypeRequiredNotes
appNamestringno
folderPathstring | nullno
files{ uploadId?, fileName?, sizeBytes? }[]no

Updates progress/status of an in-flight bulk-upload session and its items.

Body

FieldTypeRequiredNotes
sessionIdnumberno
statusstringno
progressPercentnumberno
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

FieldTypeRequiredNotes
files{ fileName?, sizeBytes? }[]no

Deletes historical bulk-upload session records matching given statuses/time window.

Body

FieldTypeRequiredNotes
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

FieldTypeRequiredNotes
courseIdnumberyes
sessionIdnumberyes
lessonIdnumberyes

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.list

    Lists courses with optional pagination and filters

  • lms.courses.stats

    Returns summary statistics for courses

  • lms.courses.get

    Returns a single course by ID with full details

  • lms.courses.create

    Creates a new course

  • lms.courses.update

    Updates an existing course

  • lms.courses.delete

    Removes a course by ID

  • lms.courses.structure.get

    Returns the full content structure of a course (modules/sessions and their lessons)

  • lms.courses.structure.sessions.create

    Creates a new module/session in a course structure

  • lms.courses.structure.sessions.reorder

    Reorders modules/sessions within a course structure

  • lms.courses.structure.sessions.update

    Updates a module/session in a course structure

  • lms.courses.structure.sessions.delete

    Deletes a module/session from a course structure

  • lms.courses.structure.sessions.duplicate

    Duplicates a module/session with all its lessons

  • lms.courses.structure.lessons.create

    Creates a new lesson inside a module/session

  • lms.courses.structure.lessons.paste

    Pastes (copies) lessons from another session into a session

  • lms.courses.structure.lessons.reorder

    Reorders lessons within a session

  • lms.courses.structure.lessons.update

    Updates a lesson in the course structure

  • lms.courses.structure.lessons.move

    Moves a lesson to a different session

  • lms.courses.structure.lessons.delete

    Deletes a lesson from the course structure

  • lms.courses.structure.lessons.duplicate

    Duplicates a lesson within its session

  • lms.courses.structure.resources.get

    Returns the resource list (file attachments, links) for a course

  • lms.courses.structure.resources.update

    Updates the resource list for a course