Skip to main content

Enroll user to course

Endpoint URL

POST /api/v2/enrollments

Enroll user to course. Enrolls a user into a specific course. Provide the course's unique ID using the course_id attribute and identify the user either by their unique ID using the user_id attribute or by their email address using the user_email attribute. course_id is required, and one of user_id or user_email is required. When both user_id and user_email are provided, user_id is used and user_email is ignored. Optionally provide role (learner or instructor) to choose the course role; when omitted, or when the user type does not allow the requested role, the default role of the user type is used. If the request is valid and both the user and course exist, the API creates the enrollment and returns the user's role in the course.​

Request​

Responses​

Successful response