Development

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

How to Enroll Students via the Tutor LMS REST API

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_id or user_id. The response lists the fields.
  • Enrollment failed: the course is not published or private, or a tutor_allow_course_enrollment filter on the site refused it.
  • 401/403: wrong credentials, a Read-only key, or a stripped Authorization header.

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.

Vishavjeet
· Enterprise LMS Architect | WordPress & LMS Expert | WooCommerce | AI Automation

I’m Vishavjeet Choubey, an Enterprise LMS Architect with 10+ years of experience helping businesses, coaches, universities, and online academies build and scale powerful digital learning platforms. I specialize in enterprise LMS architecture, WordPress, WooCommerce, LifterLMS, LearnDash, Moodle, custom plugin development, and AI-driven automation. I build scalable LMS platforms, high-converting eCommerce solutions, and custom WordPress applications designed to improve user experiences, streamline operations, and drive measurable business growth. My approach combines deep WordPress and LMS engineering expertise with modern AI automation to reduce manual work, improve efficiency, and help organizations launch, scale, and grow faster.

Keep reading

Need a custom Tutor LMS solution?

Tell us what you are building or what is broken. A Tutor LMS developer reads every inquiry and replies with next steps and a free estimate.

Get a free Tutor LMS consultation

Tell us what you are building or fixing. A Tutor LMS developer replies with honest advice and next steps.

  • No obligation
  • Tutor LMS and Pro specialists
  • Your details stay private

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.