Skip to main content
HR & People

Training

Learning management system (LMS) covering courses, programs, lessons, materials, quizzes, and student enrollment management.

Base URL: /api/v1/training

Auth required: Yes (auth:api) for all endpoints.

The Training module provides a learning management system (LMS) for internal teams and clients. It covers Courses, Programs (curricula), Lessons, Materials, Quizzes, and student enrollment management.


Courses

Base URL: /api/v1/training/courses

A course is a standalone learning unit with lessons, materials, and quizzes. Courses can be grouped into programs.

Model Properties

Property Type Required Description
id integer auto Unique identifier
name string Yes Course name (min 2, max 255 chars)
description string No Course description
published boolean No Whether the course is publicly visible
free boolean No Whether the course is free
buyable boolean No Whether the course can be purchased
price decimal No Price (if buyable)
audience string No Target audience: team or clients
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

GET /v1/training/courses

List all courses.

Response 200: Array of course objects.


POST /v1/training/courses

Create a course.

Body (JSON): Course attributes. name is required.

Response 201: Created course object. Response 422: Validation error.


GET /v1/training/courses/{id}

Show a course with lessons, materials, quizzes, programs, and students.

Response 200: Course object. Response 404: Not found.


PUT /v1/training/courses/{id}

Update a course.

Response 200: Updated course object. Response 404: Not found. Response 422: Validation error.


DELETE /v1/training/courses/{id}

Delete a course.

Response 200: Success. Response 404: Not found.


Course Students (Enrollment)

Base URL: /api/v1/training/courses/{course}/students

Manage student (contact) enrollment for a specific course.

Endpoint Method Description
/v1/training/courses/{course}/students GET List enrolled students
/v1/training/courses/{course}/students POST Enroll students (add without removing existing)
/v1/training/courses/{course}/students PUT Sync students (replace entire enrollment list)
/v1/training/courses/{course}/students/{id} GET Show a student enrollment
/v1/training/courses/{course}/students/{id} DELETE Remove a student enrollment

POST/PUT body (JSON):

Field Type Required Description
students array Yes Array of contact IDs to enroll

The enrollment pivot includes completed_at (datetime, set when the student completes the course).


Programs (Curricula)

Base URL: /api/v1/training/programs

Programs are ordered collections of courses forming a curriculum.

Model Properties

Property Type Required Description
id integer auto Unique identifier
name string Yes Program name
description string No Program description
published boolean No Whether the program is visible
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

GET /v1/training/programs

List all programs.

Response 200: Array of program objects.


POST /v1/training/programs

Create a program. Supports attaching courses with order via courses (array of IDs).

Response 201: Created program object.


GET /v1/training/programs/{id}

Show a program with courses (with pivot order), materials, quizzes, and students.

Response 200: Program object. Response 404: Not found.


PUT /v1/training/programs/{id}

Update a program.

Response 200: Updated program object.


DELETE /v1/training/programs/{id}

Delete a program.

Response 200: Success.


Program Students (Enrollment)

Base URL: /api/v1/training/programs/{program}/students

Manage student enrollment for a specific program. Same interface as Course Students.

Endpoint Method Description
/v1/training/programs/{program}/students GET List enrolled students
/v1/training/programs/{program}/students POST Enroll students
/v1/training/programs/{program}/students PUT Sync students
/v1/training/programs/{program}/students/{id} GET Show student enrollment
/v1/training/programs/{program}/students/{id} DELETE Remove enrollment

Lessons

Base URL: /api/v1/training/lessons

Lessons are the individual units of content within a course.

GET /v1/training/lessons

List lessons. Filterable by ?course_id=.

Response 200: Array of lesson objects.


Standard CRUD: /v1/training/lessons[/{id}]

Endpoint Method Description
/v1/training/lessons POST Create a lesson. course_id is required
/v1/training/lessons/{id} GET Show a lesson with materials and quizzes
/v1/training/lessons/{id} PUT Update a lesson
/v1/training/lessons/{id} DELETE Delete a lesson

Training Materials

Base URL: /api/v1/training/materials

Materials are files (documents, images, videos, audio) attached to courses, lessons, or individual contacts.

Model Properties

Property Type Required Description
id integer auto Unique identifier
name string Yes Material name
type string Yes Material type: document, image, video, or audio
filename string auto Stored filename (set on upload, cannot be set manually)
mimetype string auto MIME type (set on upload, cannot be set manually)
external boolean No Whether this is an external link rather than an uploaded file
url string No External URL (if external is true)
expires_at date No Expiry date (format: Y-m-d)
courses array No Array of course IDs to associate
lessons array No Array of lesson IDs to associate
contacts array No Array of contact IDs to associate
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

Read-only computed fields:

Property Type Description
expired boolean Whether expires_at is in the past

GET /v1/training/materials

List materials. Filterable by ?course_id=, ?lesson_id=, or ?contact_id=.

Response 200: Array of material objects.


POST /v1/training/materials

Upload or create a material.

Body: Multipart form data (when uploading a file) or JSON (for external links). type is required.

Response 201: Created material object.


GET /v1/training/materials/{id}

Show a material.

Response 200: Material object. Response 404: Not found.


PUT /v1/training/materials/{id}

Update a material. Supports updating course/lesson/contact associations.

Response 200: Updated material object.


DELETE /v1/training/materials/{id}

Delete a material and remove its file from storage.

Response 200: Success.


GET /v1/training/materials/{id}/content

Download the material file.

Response 200: File stream. Response 404: Not found.


Quizzes

Base URL: /api/v1/training/quizzes

Quizzes can be attached to courses, programs, or lessons.

Model Properties

Property Type Required Description
id integer auto Unique identifier
name string Yes Quiz name
description string No Quiz description
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

GET /v1/training/quizzes

List all quizzes.

Response 200: Array of quiz objects.


POST /v1/training/quizzes

Create a quiz. A default group is automatically created.

Response 201: Created quiz object.


GET /v1/training/quizzes/{id}

Show a quiz with groups and questions.

Response 200: Quiz object. Response 404: Not found.


PUT /v1/training/quizzes/{id}

Update a quiz.

Response 200: Updated quiz object.


DELETE /v1/training/quizzes/{id}

Delete a quiz.

Response 200: Success.


Quiz Groups

Base URL: /api/v1/training/quiz-groups

Groups organise questions within a quiz.

Endpoint Method Description
/v1/training/quiz-groups GET List groups (filterable by ?quiz_id=)
/v1/training/quiz-groups POST Create a group
/v1/training/quiz-groups/{id} GET Show a group with questions
/v1/training/quiz-groups/{id} PUT Update a group
/v1/training/quiz-groups/{id} DELETE Delete a group

Quiz Questions

Base URL: /api/v1/training/quiz-questions

GET /v1/training/quiz-questions/types

Get the list of available question types.

Response 200: Array of type strings. Available types: single_choice, multiple_choice, true_false, short_answer, essay.


GET /v1/training/quiz-questions

List questions. Filterable by ?group_id=.

Response 200: Array of question objects.


POST /v1/training/quiz-questions

Create a question. type must be one of the allowed types.

Body (JSON):

Field Type Required Description
type string Yes Question type
label string Yes Question text
group_id integer Yes FK to quiz group
points numeric No Points awarded for a correct answer

Response 201: Created question object.


Standard CRUD: /v1/training/quiz-questions[/{id}]

Endpoint Method Description
/v1/training/quiz-questions/{id} GET Show a question
/v1/training/quiz-questions/{id} PUT Update a question
/v1/training/quiz-questions/{id} DELETE Delete a question

Quiz Replies

Base URL: /api/v1/training/quiz-replies

Quiz replies are student answers to quiz questions.

Endpoint Method Description
/v1/training/quiz-replies GET List replies (filterable by ?question_id= or ?contact_id=)
/v1/training/quiz-replies POST Create a reply
/v1/training/quiz-replies/{id} GET Show a reply
/v1/training/quiz-replies/{id} PUT Update a reply
/v1/training/quiz-replies/{id} DELETE Delete a reply