REST APIs for Tutor LMS Pro

Tutor LMS is fully integrated with the WordPress REST API. This allows Tutor LMS data to be created, read, updated, and deleted using JSON requests. It supports standard HTTP verbs and WordPress REST API Authentication methods.

You can download the full Postman API collection from here.

Course API

The course API lets you create, view, update, and delete course data. You can also sort courses, provide course ratings, get course details, etc using these APIs.

Here are the attributes of Tutor LMS Course API:

AttributesTypeRequirementDescription
post_authorNumericRequiredPost author / admin ID
post_dateDate-timeOptionalThe date the course was created in the site’s timezone. The time will be in YYYY-MM-DD HH:MM:SS format.
post_date_gmtDate-timeOptionalThe date the course was created as GMT time. 
post_contentStringRequiredCourse content
post_titleStringRequiredCourse title
post_excerptStringOptionalCourse short description
post_statusStringRequiredCourse status
post_passwordStringOptionalA password to protect your course
comment_statusStringOptionalWhether or not comments are open on the object
post_modifiedDate-timeOptionalCourse update time in the site’s timezone and YYYY-MM-DD HH:MM:SS format.
post_modified_gmtDate-timeOptionalCourse update time in GMT and YYYY-MM-DD HH:MM:SS format.
post_content_filteredStringOptionalFilter course
additional_contentObjectOptionalSet additional course content like course benefits, target audience, and duration.
course_benefitsStringOptionalSet course benefits
course_target_audienceStringOptionalSet target audience
course_durationObjectOptionalSends course duration in hours and minutes
hoursNumericOptionalCourse duration in hours
minutesNumericOptionalCourse duration in minutes
course_material_includesStringOptionalGet course materials
course_requirementsStringOptionalRequirements for that course
videoObjectOptionalVideo objects like video source type and link
source_typeStringOptionalSet video source type. Supported sources are external_url, shortcode, YouTube, Vimeo, and embedded videos.
sourceStringOptionalVideo link
course_levelStringOptionalSet course level. The supported levels are beginner, intermediate, and expert.
course_categoriesArray [Numeric]OptionalCourse categories as  array 
course_tagsArray [Numeric]OptionalCourse tags in array format
thumbnail_idNumericOptionalSet course thumbnail ID

Here’s the JSON file of Course API:

{
  "post_author": 1,
  "post_date": "2023-01-01 12:00:00",
  "post_date_gmt": "2023-01-01 00:00:00",
  "post_content": "Introduction to Mathematics is a fundamental course covering arithmetic, algebra, geometry, and basic statistics. It develops problem-solving and critical thinking skills, providing a solid foundation for further mathematical studies and practical applications.",
  "post_title": "Introduction to Mathematics",
  "post_excerpt": "Introduction to Mathematics is a fundamental course covering arithmetic, algebra, geometry, and basic statistics.",
  "post_status": "publish",
  "comment_status": "open",
  "post_password": "",
  "post_modified": "2023-01-01 12:30:00",
  "post_modified_gmt": "2023-01-01 00:30:00",
  "post_content_filtered": "",
  "additional_content": {
    "course_benefits": "Course benefits",
    "course_target_audience": "Course target audience",
    "course_duration": {
        "hours": "1",
        "minutes": "10"
    },
    "course_material_includes": "Course material includes",
    "course_requirements": "Course requirements"
  },
   "video": {
        "source_type": "youtube",
        "source": "https://www.youtube.com/watch?v=iLlrIi9-NfQ"
   },
  "course_level": "beginner",
  "course_categories": [161,163],
  "course_tags": [18,19],
  "thumbnail_id": 0
}

1. Course Create

URL: https://yourdomain.com/wp-json/tutor/v1/courses
Type: POST

2. Course Read

URL: https://yourdomain.com/wp-json/tutor/v1/courses?order=desc&orderby=ID&paged=1
Type: GET

3. Course Update

URL: https://yourdomain.com/wp-json/tutor/v1/courses/{course_id}
Type: POST, PUT, PATCH

4. Course Delete

URL: https://yourdomain.com/wp-json/tutor/v1/courses/{course_id}
Type: DELETE

5. Course Detail

URL: https://yourdomain.com/wp-json/tutor/v1/course-detail/{course_id}
Type: GET

6. Course Topic

URL: https://yourdomain.com/wp-json/tutor/v1/course-topic/{course_id}
Type: GET

7. Course Mark as Complete

URL: https://yourdomain.com/wp-json/tutor/v1/course-mark-complete
Type: POST

8. Course Sorting by Price

URL: https://yourdomain.com/tutor/wp-json/tutor/v1/course-sorting-by-price?order=asc&page=1
Type: GET

9. Course Rating by Course ID

URL: https://yourdomain.com/tutor/wp-json/tutor/v1/course-rating/{course_id}
Type: GET

10. Course by Terms

URL: https://yourdomain.com/tutor/wp-json/tutor/v1/course-by-terms
Type: POST

Topic API

The topic API allows you to create, view, update, and delete Tutor LMS course topics.

Here are the topic attributes:

AttributesTypeRequirementDescription
topic_course_idNumericRequiredSet the unique topic ID 
topic_titleStringRequiredUse topic title
topic_summaryStringOptionalProvide a summary of the topic
topic_authorNumericRequiredSet admin/author ID

Here’s the JSON file of Topic API:

{
  "topic_course_id": 5607,
  "topic_title": "Introduction to Mathematics.",
  "topic_summary": "Introduction to Mathematics is a fundamental course covering arithmetic, algebra, geometry, and basic statistics.",
  "topic_author": 1
}

1. Topics Create

URL: https://yourdomain.com/wp-json/tutor/v1/topics
Type: POST

2. Topics Read

URL: https://yourdomain.com/wp-json/tutor/v1/course-topic/{topic_id}
Type: GET

3. Topics Update

URL: https://yourdomain.com/wp-json/tutor/v1/topics/{topic_id}
Type: POST, PUT, PATCH

4. Topics Delete

URL: https://yourdomain.com/wp-json/tutor/v1/topics/{topic_id}
Type: DELETE

Lesson API

The lesson API lets you create, update, and delete lesson data. You can also sort lessons, and mark lessons as complete using these APIs.

Here are the attributes of Tutor LMS Lesson API:

AttributesTypeRequirementDescription
topic_idNumericRequiredSet the lesson ID.
lesson_titleStringRequiredThe title of the lesson.
lesson_contentStringOptionalThe content of the lesson.
thumbnail_idNumericOptionalSet lesson thumbnail ID
lesson_authorNumericRequiredSet lesson author ID
videoObjectOptionalVideo objects like source type, source and runtime
source_typeStringOptionalSet video source type
sourceStringOptionalSet video source link
runtimeObjectOptionalRuntime objects like hours, minutes, and seconds
hoursNumericOptionalVideo length hours
minutesNumericOptionalVideo length minutes
secondsNumericOptionalVideo length seconds
attachmentsArray [Numeric]OptionalWordPress Media ID
previewBooleanOptionalSet if preview will be allowed or not

Here’s the JSON file of Lesson API:

{
        "topic_id": 5608,
        "lesson_title": "Introduction to Mathematics.",
        "lesson_content": "Introduction to Mathematics is a fundamental lesson covering arithmetic, algebra, geometry, and basic statistics.",
        "thumbnail_id": 1,
		"lesson_author": 1,
        "video": {
            "source_type": "youtube",
            "source": "https://www.youtube.com/watch?v=iLlrIi9-NfQ",
            "runtime": {
                "hours": "00",
                "minutes": "10",
                "seconds": "36"
            }
        },
        "attachments": [110],
        "preview": true
}

1. Lesson Create

URL: https://yourdomain.com/wp-json/tutor/v1/lessons/
Type: POST

2. Lesson by Topic ID

URL: https://yourdomain.com/wp-json/tutor/v1/lesson/{lesson_id}
Type: GET

3. Lesson Update

URL: https://yourdomain.com/wp-json/tutor/v1/lessons/{lesson_id}
Type: POST, PUT, PATCH

4. Lesson Delete

URL: https://yourdomain.com/wp-json/tutor/v1/lessons/{lesson_id}
Type: DELETE

5. Lesson Mark as Complete

URL: https://yourdomain.com/wp-json/tutor/v1/lesson-mark-complete
Type: POST

Assignment API

The assignment API of Tutor LMS will let you create, update, delete, and get assignment information by ID.

Here are the attributes of Assignment API:

AttributesTypeRequirementDescription
topic_idNumericRequiredAssignment ID
assignment_titleStringRequiredAssignment title
assignment_authorNumericRequiredAssignment author name
assignment_contentStringOptionalAssignment content
attachmentsArrayOptionalWordPress Media ID
assignment_optionsObjectRequiredAssignment 
time_durationObjectOptionalDeadline for submitting the assignment
valueNumericOptionalSpecify the time
unitStringOptionalDuration in days, weeks, months, or year
total_markNumericOptionalTotal mark for an assignment
pass_markNumericOptionalMininum number to pass the assignment
upload_files_limitNumericOptionalSet the upload file limit
upload_file_size_limitNumericOptionalSet the upload file size limit

Here’s the JSON file of Assignment API:

{
  "topic_id": 5587,
  "assignment_title": "Math Assignment 1",
  "assignment_author": 1,
  "assignment_content": "<p>Assignment content</p>",
  "attachments": [2278],
  "assignment_options": {
    "time_duration": {
      "value": 1,
      "unit": "weeks"
    },
    "total_mark": 10,
    "pass_mark": 2,
    "upload_files_limit": 1,
    "upload_file_size_limit": 2
  }
}

1. Course Assignment by ID

URL: https://yourdomain.com/wp-json/tutor/v1/course-assignment/{assignment_id}
Type: GET

2. Assignment Create

URL: https://yourdomain.com/wp-json/tutor/v1/assignments/
Type: POST

3. Assignment Update

URL: https://yourdomain.com/wp-json/tutor/v1/assignments/{assignment_id}
Type: POST, PUT, PATCH

4. Assignment Delete

URL: https://yourdomain.com/wp-json/tutor/v1/assignments/{assignment_id}
Type: DELETE

Quiz API

The quiz API lets you create, update and delete quizzes as well as quiz questions. You can also get quizzes, quiz questions, and quiz attempt details using quiz ID. 

Here are the attributes of quiz API:

AttributesTypeRequirementDescription
topic_idNumericRequiredUnique identifier for the quiz
quiz_titleStringRequiredTitle of the quiz
quiz_authorStringRequiredThe ID for the author of the quiz
quiz_descriptionStringOptionalDescription of the quiz
​​quiz_optionsStringRequiredQuiz options
time_limitObjectOptionalTime limit for the quiz
time_valueNumericOptionalSpecify the time
time_typeStringOptionalSpecify the time units. Allowed units are seconds, minutes, hours, days, and weeks.
feedback_modeStringOptionalProvide feedback. Allowed feedback modes are default, reveal, and retry.
question_layout_viewStringOptionalAppearance of the questions
attempts_allowedNumericOptionalSpecifies how many attempts are allowed
passing_gradeNumericOptionalSpecifies the passing grade
max_questions_for_answerNumericOptionalMaximum number of questions for answer
questions_orderStringOptionalSet the question order
short_answer_characters_limitNumericOptionalCharacter limit for the ‘short answer’ type questions
open_ended_answer_characters_limitNumericOptionalCharacter limit for the ‘open ended’ type questions

Here’s the JSON file of Quiz API:

{
    "topic_id": 5587,
    "quiz_title": "Mathematics quiz",
    "quiz_author": 1,
    "quiz_description": "Introduction to Mathematics quiz.",
        "quiz_options": {
        "time_limit": {
            "time_value": 1,
            "time_type": "minutes"
        },
        "feedback_mode": "default",
        "question_layout_view": "question_below_each_other",
        "attempts_allowed": 10,
        "passing_grade": 80,
        "max_questions_for_answer": 10,
        "questions_order": "rand",
        "short_answer_characters_limit": 200,
        "open_ended_answer_characters_limit": 500
  }
}

1. Quiz by Topic ID

URL: https://yourdomain.com/wp-json/tutor/v1/quiz/{quiz_id}
Type: GET

2. Quiz Questions Answer by Quiz ID

URL: https://yourdomain.com/wp-json/tutor/v1/quiz-question-answer/{quiz_id}
Type: GET

3. Quiz Quiz Attempts Details By Quiz ID

URL: https://yourdomain.com/tutor/wp-json/tutor/v1/quiz-question-answer/{quiz_id}
Type: GET

4. Quiz Create

URL: https://yourdomain.com/wp-json/tutor/v1/quizzes
Type: POST

5. Quiz Update

URL: https://yourdomain.com/wp-json/tutor/v1/quizzes/{quiz_id}
Type: POST, PUT, PATCH

6. Quiz Delete

URL: https://yourdomain.com/wp-json/tutor/v1/quizzes/{quiz_id}
Type: DELETE

7. Question Create

URL: https://yourdomain.com/wp-json/tutor/v1/quiz-questions
Type: POST

8. Question Update

URL: https://yourdomain.com/wp-json/tutor/v1/quiz-questions/{question_id}
Type: POST, PUT, PATCH

9. Question Delete

URL: https://yourdomain.com/wp-json/tutor/v1/quiz-questions/{question_id}
Type: Delete

Enrollment API

The enrollment API facilitates seamless onboarding of the users in a Tutor LMS course.

Here are the attributes of enrollment API:

AttributesTypeRequirementDescription
user_idNumericRequiredEnroll in a specific course by User ID
course_idNumericRequiredInput course ID for user enrollment
enrollment_idNumericRequired (only for enrollment status)Set enrollment ID

Here’s the JSON file of Assignment API:

{
    "user_id": 2,
    "course_id": 5607
}

1. Do Enrollment

URL: https://yourdomain.com/wp-json/tutor/v1/enrollments
Type: POST

2. Update Enrollment Status

URL: https://yourdomain.com/wp-json/tutor/v1/enrollments/completed
Type: PUT

Note: The available enrollment statuses are cancel, completed, expired, failed, on-hold, pending, processing, and refunded.

Was this helpful?