Skip to main content
Enrollments represent the relationship between a user and a course. When a learner is enrolled, they gain access to the course content and can submit assessments. The API tracks progress and completion status throughout the learner’s journey.

Enrollment status transitions

Enrollments move through the following statuses. Direct transitions from completed back to active are not permitted — re-enrollment creates a new enrollment record instead.

The enrollment object

id
string
required
Unique identifier for the enrollment. Format: enr_<alphanumeric>.
user_id
string
required
The ID of the enrolled user.
course_id
string
required
The ID of the course the user is enrolled in.
status
string
required
Current enrollment status. One of active, completed, or dropped.
progress_percent
number
required
Completion progress from 0 to 100. Automatically updated as the learner completes course modules.
enrolled_at
string
required
ISO 8601 timestamp of when the enrollment was created.
completed_at
string
ISO 8601 timestamp of when the enrollment status changed to completed. null if not yet completed.

List enrollments

GET /api/v1/enrollments Returns a paginated list of enrollments. Admins see all enrollments; learners only see their own.

Query parameters

user_id
string
Filter enrollments by a specific user ID.
course_id
string
Filter enrollments by a specific course ID.
status
string
Filter by enrollment status. One of active, completed, or dropped.
page
number
default:"1"
Page number to retrieve.
per_page
number
default:"20"
Number of enrollments per page. Maximum 100.

Example

curl "https://your-domain.com/api/v1/enrollments?user_id=usr_lrn001&status=active" \
  -H "Authorization: Bearer <access_token>"

Get an enrollment

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

Create an enrollment

POST /api/v1/enrollments Enrolls a user in a course. Admins can enroll any user. Learners can self-enroll in published courses.

Request body

user_id
string
required
The ID of the user to enroll.
course_id
string
required
The ID of the course to enroll the user in. Must be a published course.

Example

curl -X POST https://your-domain.com/api/v1/enrollments \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "usr_lrn001",
    "course_id": "crs_ghi789"
  }'
If the user is already enrolled in the same course with active or completed status, the API returns a 422 error. Dropped enrollments can be reactivated via a PUT request instead.

Update an enrollment

PUT /api/v1/enrollments/:id Updates the status of an enrollment. Typically used to drop or reactivate an enrollment.
status
string
required
New status for the enrollment. One of active or dropped. The completed status is set automatically by the system when progress reaches 100%.
curl -X PUT https://your-domain.com/api/v1/enrollments/enr_mn0456 \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{"status": "dropped"}'

Delete an enrollment

DELETE /api/v1/enrollments/:id Permanently removes an enrollment record. Requires the admin role.
Deleting an enrollment also deletes all associated assessment submissions for that learner in that course. Use the dropped status to deactivate without losing data.
curl -X DELETE https://your-domain.com/api/v1/enrollments/enr_rs3456 \
  -H "Authorization: Bearer <access_token>"

Build docs developers (and LLMs) love