List Enrollments
Retrieves all enrollments for the authenticated user.Response
array
Array of enrollment objects
Example Request
Example Response
Create Enrollment
Enrolls a user in a course. Checks prerequisites and updates enrollment count.Request Body
number
required
Course ID to enroll in
string
Admin only: Enroll another user by their UUID
boolean
Admin only: Skip prerequisite checks (default: false)
Response
object
Created enrollment object
Example Request
Example Response
Update Enrollment Status
Updates the status of an enrollment (e.g., mark as completed).Request Body
number
required
Course ID
string
required
New status: “active”, “completed”, “suspended”
Response
object
Updated enrollment object
Example Request
Notes
- Setting status to “completed” automatically sets
completed_attimestamp and progress to 100% - Triggers email notifications for course completion
- Sends admin notification about the completion
Prerequisite Validation
When enrolling in a course with prerequisites, the API validates:- All prerequisite courses must be completed
- Completion is verified by
completed_attimestamp being set - In-progress enrollments are not sufficient
Prerequisite Error Response
Enrollment Notifications
The API automatically triggers email notifications:- On Enrollment: Welcome email with course access details
- On Completion: Congratulations email with certificate link (if enabled)
- Admin Notification: Notifies admin when a user completes a course
Admin Enrollment
Admins can enroll other users by providing theuserId parameter: