draft or published), belongs to a category, and is associated with an instructor. Only published courses are visible to learners.
Only users with the
admin or instructor role can create, update, or delete courses. Learners can only read published courses they are enrolled in.The course object
Unique identifier for the course. Format:
crs_<alphanumeric>.The display title of the course.
Full description of the course content and objectives.
Course category label (e.g.,
"Compliance", "Leadership", "Technical").Publication status. One of
draft or published. Only published courses appear in learner-facing views.The
id of the user who owns and delivers this course.Total number of active and completed enrollments for this course.
ISO 8601 timestamp of when the course was created.
ISO 8601 timestamp of the last update to the course.
List courses
GET /api/v1/courses
Returns a paginated list of courses. Admins and instructors see all courses; learners only see published courses.
Query parameters
Page number to retrieve.
Number of courses per page. Maximum 100.
Filter by course status. One of
draft or published.Filter courses by category label (case-insensitive).
Example
Get a course
GET /api/v1/courses/:id
Returns a single course by its ID.
Create a course
POST /api/v1/courses
Creates a new course. Requires the admin or instructor role.
Request body
The course title. Must be between 3 and 200 characters.
Full course description. Supports plain text.
Category label for the course. Used for filtering and organization.
Initial publication status. One of
draft or published. Defaults to draft.Example
Newly created courses default to
draft status and are not visible to learners until published. Change status to published via a PUT request when the course is ready.Update a course
PUT /api/v1/courses/:id
Updates an existing course. Send only the fields you want to change; omitted fields retain their current values.
Delete a course
DELETE /api/v1/courses/:id
Permanently deletes a course. Requires the admin role.
200 with an empty data field:
