How to Enroll Students via the Tutor LMS REST API
Enroll students from another system with the Tutor LMS Pro REST API: create the user, POST to /enrollments, change status, read a course's enrollments, and handle errors.
Checked against the plugin source: Tutor LMS 4.1.3, Tutor LMS Pro 4.1.3

A common integration: a sale, HR record or form submission in another system should give someone access to a course on your Tutor LMS site. With Tutor LMS Pro you can do this over HTTP. This guide follows Tutor LMS Pro 4.1.3.
Before you start
- Create an API key with Write, Read/Write or All permission; see API authentication.
- The student must already have a WordPress account. The enrollment endpoint takes a
user_id; it does not create users. Create the user first with the WordPress users endpoint (with WordPress authentication) or with a small custom endpoint.
Enroll
curl -X POST "https://lms.example.com/wp-json/tutor/v1/enrollments" \
-u "KEY:SECRET" \
-d "course_id=123" \
-d "user_id=45"
Both fields are required. The endpoint calls Tutor LMS's normal enrollment function, so tutor_after_enroll fires and duplicates are avoided (an existing active enrollment is returned). The response includes enrollment_id.
As with code, enrolling in a paid course creates a pending enrollment. Activate it in the next step.
Change an enrollment's status
Send PUT or PATCH to /wp-json/tutor/v1/enrollments/{status} with enrollment_id. Allowed statuses include completed, pending, cancel, expired, failed, on-hold and processing.
curl -X PATCH "https://lms.example.com/wp-json/tutor/v1/enrollments/completed" \
-u "KEY:SECRET" \
-d "enrollment_id=987"
This endpoint updates the status directly, so Tutor LMS's enrollment action hooks do not fire for it. If your site relies on those hooks, run the follow-up logic yourself or use a custom endpoint that calls the enrollment functions.
List a course's enrollments
GET /wp-json/tutor/v1/enrollments?course_id=123 returns approved enrollments for the course. In version 4.1.3 the endpoint returns the first 10 only, so it is suited to spot checks, not full exports. For full lists, use the Pro Reports export or a custom endpoint.
Error handling
- Validation errors: a missing or non-numeric
course_idoruser_id. The response lists the fields. - Enrollment failed: the course is not published or private, or a
tutor_allow_course_enrollmentfilter on the site refused it. - 401/403: wrong credentials, a Read-only key, or a stripped
Authorizationheader.
Log every request and response on your side, and retry with care: repeat calls are safe for creating enrollments, because an existing active enrollment is returned instead of duplicated.
Alternatives
- Same-site code: enroll with PHP.
- No-code: Tutor LMS Pro's manual and bulk enrollment in the admin.
Connecting a CRM, HR system or store? Our API development team builds reliable enrollment integrations.
Save this practical guide
Add us as a preferred Google source, or ask an AI assistant to summarize this page and link back to the original guide when it is useful.
