Skip to main content
Courses are the core content units of Karma LMS. Each course has a status (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

id
string
required
Unique identifier for the course. Format: crs_<alphanumeric>.
title
string
required
The display title of the course.
description
string
Full description of the course content and objectives.
category
string
Course category label (e.g., "Compliance", "Leadership", "Technical").
status
string
required
Publication status. One of draft or published. Only published courses appear in learner-facing views.
instructor_id
string
required
The id of the user who owns and delivers this course.
enrollment_count
number
Total number of active and completed enrollments for this course.
created_at
string
required
ISO 8601 timestamp of when the course was created.
updated_at
string
required
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
default:"1"
Page number to retrieve.
per_page
number
default:"20"
Number of courses per page. Maximum 100.
status
string
Filter by course status. One of draft or published.
category
string
Filter courses by category label (case-insensitive).

Example

curl https://your-domain.com/api/v1/courses?status=published&per_page=10 \
  -H "Authorization: Bearer <access_token>"

Get a course

GET /api/v1/courses/:id Returns a single course by its ID.
curl https://your-domain.com/api/v1/courses/crs_abc123 \
  -H "Authorization: Bearer <access_token>"

Create a course

POST /api/v1/courses Creates a new course. Requires the admin or instructor role.

Request body

title
string
required
The course title. Must be between 3 and 200 characters.
description
string
Full course description. Supports plain text.
category
string
Category label for the course. Used for filtering and organization.
status
string
default:"draft"
Initial publication status. One of draft or published. Defaults to draft.

Example

curl -X POST https://your-domain.com/api/v1/courses \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Data Privacy and GDPR Compliance",
    "description": "Understand your obligations under GDPR and how to handle personal data responsibly.",
    "category": "Compliance",
    "status": "draft"
  }'
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.
curl -X PUT https://your-domain.com/api/v1/courses/crs_ghi789 \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{"status": "published"}'

Delete a course

DELETE /api/v1/courses/:id Permanently deletes a course. Requires the admin role.
Deleting a course also deletes all associated assessments. Active enrollments are moved to dropped status. This action cannot be undone.
curl -X DELETE https://your-domain.com/api/v1/courses/crs_ghi789 \
  -H "Authorization: Bearer <access_token>"
A successful delete returns 200 with an empty data field:
{
  "data": null,
  "meta": null,
  "error": null
}

Build docs developers (and LLMs) love