How can I programmatically unenroll users as an admin (not as the learner) in Open edX?

I’m not exactly certain about this, haven’t tried any of it at all, but from what I can piece together you’ll need to use the /api/enrollment/v1/enrollment endpoint with a POST request with the key parameter used being is_active set to false.

There’s also a bulk enrollment api that can be enabled and used for unenrollment (according to this topic here: Programatically enroll or unenroll students)

1 Like