Modules Resource

Description

Modules represent self-contained training content that users can complete. Each module contains metadata such as a title, description, categories, and a hosted content URL (typically on S3). Modules can be created and managed by Admins or Content Managers.

Modules

Modules are the core content item assigned to users and grouped using categories and tags.


Example

Module:

{
  "_id": "mod123",
  "title": "Introduction to Cybersecurity",
  "description": "A beginner-friendly course on cybersecurity fundamentals.",
  "categories": ["cat123", "cat456"], // array of category IDs
  "estimatedDuration": 45,
  "isActive": true,
  "tags": ["security", "entry-level", "tech"],
  "createdAt": 1672444800000,
  "updatedAt": 1672444800000,
  "schemaVersion": 2,
  "version": 2 // 1 or 2
}

Create Module – (!Admin or Content Manager!)

POST /api/v1/modules

Example Request:

Example Response (201 Created):


Get All Modules & Optionally Categorize

GET /api/v1/modules

With category filter:

GET /api/v1/modules?categoryId={categoryID}

Example Response (200 OK):

Example Response (Filtered by Category)


Get Module by ID

GET /api/v1/modules/:id

Example Response (200 OK):


Update Module – (!Admin or Content Manager!)

PATCH /api/v1/modules/:id

Example Request:

Example Response (200 OK):


Delete Module – (!Admin Only!)

DELETE /api/v1/modules/:id

Example Response (200 OK):

Last updated