Enroll learner
enrollment_createEnroll one learner in a course by email, finding or creating their account (new accounts are passwordless students on this site); use enrollment_bulk_create for many learners, and application_review to approve someone who applied. Price, the application requirement and enrollment dates are not checked; prerequisites are checked for a new enrollment unless skipPrerequisiteCheck:true, and an account is still created when they refuse it. Cubite emails no one unless sendInvite:true; by default you get magicLinkUrl, a single-use sign-in link for your own welcome email. A new enrollment gets the status label "completed" and the course's access period, and fires the site's enrollment.created webhook. Use it to add enrollments; to change an existing one, use enrollment_update. Calling it for a learner who is already enrolled creates nothing new (created:false) and keeps the expiry and waitlist flag, but resets the status label to "completed". Returns {enrollment, user, magicLinkUrl, created, emailSent, externalReference}. Get course ids from course_list.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Display name for a NEW account (default: the part of the email before @); an existing user's name is not changed. | |
| Yes | Learner email (required), matched case-insensitively to an existing account; a new email creates one. | ||
| courseId | Yes | Id of a course on this site (required). For a course linked to Open edX this creates only the Cubite enrollment, not the learner's Open edX one. | |
| redirectTo | No | Path on this site to open after sign-in, starting with "/" (e.g. "/course/<slug>/courseware", the lessons). Anything else is ignored and the learner lands on their dashboard. Use the courseware path for a paid course: this call records no payment, so the learner's dashboard card and the course page still show a checkout button. | |
| sendInvite | No | Have Cubite email the learner itself: a one-click sign-in invite (7-day link, lands on redirectTo, also returned as magicLinkUrl) when a link can be issued, otherwise the plain course-enrolment email. Default false. The site can turn these emails off; the response's emailSent says whether an email went out. It also emails a learner who is already enrolled, e.g. someone you just let in off the waitlist with enrollment_update. | |
| issueMagicLink | No | Return magicLinkUrl, a single-use sign-in link valid for 24 hours (default true). Minting it cancels any earlier link for this email. It is null when the person has a password, is an admin, or belongs to another Cubite site. Ignored when sendInvite is true. | |
| externalReference | No | Your own correlation value, echoed back unchanged in the response; not stored. | |
| skipPrerequisiteCheck | No | true enrolls even if the course's prerequisites are not met (default false); otherwise unmet prerequisites fail the call. |