Enrolling is just adding a user to a course (which would be web service function enrol_manual_enrol_users). However, it sounds like you want to create new user accounts. That is the job of authentication plugins. Look at some of the auth functions on https://docs.moodle.org/dev/Web_service_API_functions.
General developer forum
User enrolment via API/Web Service
This discussion has been locked so you can no longer reply to it.