Update enrollment
enrollment_updateChange one existing enrollment in place, keeping it and the learner's progress: set or clear its access expiry, move the learner off or onto the waitlist, or relabel its status. Use it for every change to an enrollment that exists; to add one use enrollment_create, to remove one enrollment_revoke. Identify the learner by email or userId; a learner not enrolled in that course is a not-found error, and omitted fields stay unchanged. To let a waitlisted learner in, send isWaitListed:false with status:"completed": self-waitlisted learners hold "pending", and learner pages show Start/Continue only for "completed". No email is sent. Returns the updated enrollment {courseId, userId, status, isWaitListed, enrolledAt, expiresAt, user}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| No | Learner's email; pass this or userId. | ||
| status | No | Free-text status label, stored as given (trimmed, cut to 64 chars); Cubite itself writes "completed", "pending" or, for learning-path enrollments, "active". Learner pages give the Start/Continue button only to "completed" (on a paid course, only once the learner has paid); with any other label the dashboard card and the course page show an enrollment step instead ("Start Now", "Complete Enrollment" or checkout). Omit it to keep the current label. | |
| userId | No | Learner's user id; pass this or email (userId wins if both are sent). | |
| courseId | Yes | Course id (required). For a course linked to Open edX this changes only the Cubite enrollment; to also enroll a waitlisted learner in Open edX, use the dashboard's Unlock button. | |
| expiresAt | No | New access expiry as an ISO 8601 date string (e.g. "2026-12-31"); null removes the expiry (never expires); omit to leave it unchanged. | |
| isWaitListed | No | false promotes the learner off the waitlist; true moves them back onto it. Either way the status label stays as it is unless you also send status. |