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

Assignment API (student section)

The assignment API of Tutor LMS will let you create, update, delete, and get assignment information by ID. It also allows students to get assignment information, attachment files, etc.

Here are the attributes:

AttributesTypeRequirementDescription
assignment_idNumericRequiredGet assignment ID
assignment_answerStringRequiredGet the student’s answers to the assignment
student_idNumericRequiredGet students ID
attached_assignment_files[]ArrayRequiredRetrieves the attached assignment files

Here’s the JSON file:

{
   "assignment_id": "7651",
   "assignment_answer": "Student’s assignment answer",
   "student_id": 3,
   "attached_assignment_files[]": files
}

1. Get Student Assignment Submit

URL: https://yourdomain.com/wp-json/tutor/v1/assignments?student_id={student_id}&assignment_id={assignment_id}   

Type: GET

2. Student Assignment Submit

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

3. Student Assignment Update

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

4. Assignment Attachment

URL: https://yourdomain.com/wp-json/tutor/v1/assignment-attachment/{assignment_id}?file_name={file_name}
Type: POST

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

10. Quiz Details

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

Quiz Attempt API

You can use the Quiz Attempt API to collect students quiz attempt data.

Here are the attributes of quiz attempt API:

AttributesTypeRequirementDescription
course_idNumericRequiredUnique id for the attempted quiz’s course
student_idNumericRequiredID of the student who attempted the quiz
quiz_idNumericRequiredID of the quiz attempted by the student
quiz_question_answersArrayRequiredAnswers provided for each question in the quiz
question_idNumericRequiredSpecific ID of each question
question_typeStringRequiredType of quiz question selected
answerString | Array | IntRequiredCorrect answer for the quiz

Here’s the JSON file of Assignment API:

{
    "course_id": 5708,
    "student_id": 2,
    "quiz_id": 5766,
    "quiz_question_answers": [
        {
            "question_id": 204,
            "question_type": "true_false",
            "answer": 461
        },
        {
            "question_id": 205,
            "question_type": "fill_in_the_blanks",
            "answer": ["large", "dust", "traffic"]
        },
        {
            "question_id": 206,
            "question_type": "multiple_choice",
            "answer": [460, 465]
        }
    ]
}

1. Attempt Create

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

2. Single Attempt

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

3. Quiz Attempts

URL: https://yourdomain.com/wp-json/tutor/v1/quiz-attempts?quiz_id={quiz_id}&student_id={student_id}
Type: GET

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.

3. Get Enrolled Users

URL: https://yourdomain.com/wp-json/tutor/v1//enrollments?course_id={course_id}
Type: GET

Wishlist API

The Wishlist API enables users to add courses to their wishlist. It requires the user’s ID and the ID of the course they want to add.

Here are the attributes of Tutor LMS Wishlist API:

AttributesTypeRequirementDescription
user_idNumericRequiredInput the unique user ID
course_idNumericRequiredInput the unique identifier for courses

Here’s the JSON file of Wishlist API:

{
   "user_id": 3,
   "course_id": 7398
}

1. Student Wishlist List

URL: https://yourdomain.com/wp-json/tutor/v1/wishlists?user_id={user_id}
Type: GET

2. Student Wishlist Add

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

3. Student Wishlist Delete

URL: https://yourdomain.com/wp-json/tutor/v1/wishlists?user_id={user_id}&course_id={course_id}
Type: DELETE

Review API

The Review API can be used to get the list of course reviews or add, delete, and update the student’s review for a specific course. 

Here are the attributes of Tutor LMS Review API:

AttributesTypeRequirementDescription
user_idNumericRequiredInput the unique user ID
course_idNumericRequiredInput course ID to get the reviews
ratingNumericRequiredGet course rating
reviewStringRequiredGet course review

Here’s the JSON file of Review API:

{
   "user_id": 3,
   "course_id": 7461,
   "rating": 5,
   "review": "Great lessons"
}

1. User Review List

URL: https://yourdomain.com/wp-json/tutor/v1/reviews?user_id={user_id}
Type: GET

2. User Review Add

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

3. User Review Update

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

4. Delete Review

URL: https://yourdomain.com/wp-json/tutor/v1/reviews/{course_id}?user_id={user_id}
Type: POST

Student Dashboard API

URL: https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/dashboard
Type: GET

Calendar API

URL: https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/calendar
Type: GET

Get Student Course List API

URL: https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/courses
Type: GET

Instructor API

URL: https://yourdomain.com/wp-json/tutor/v1/become-instructor/{user_id}
Type: PUT

Order History API

URL: https://yourdomain.com/wp-json/tutor/v1/students/{student_id}/order-histories
Type: GET

Profile Management API

1. Quiz Attempts Get

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

2. Update Profile

URL: https://yourdomain.com/wp-json/tutor/v1/update-profile
Type: PUT

3. Upload Photo

URL: https://yourdomain.com/wp-json/tutor/v1/upload-photo/profile-photo
Type: POST

4. Delete Photo

URL: https://yourdomain.com/wp-json/tutor/v1/delete-photo/profile-photo/{user_id}
Type: DEL

5. Update Password

URL: https://yourdomain.com/wp-json/tutor/v1/update-password
Type: PUT

Q&A API

The Q&A API is used to get the student’s Q&A list and update, delete, or add new Q&A.

Here are the attributes of Tutor LMS Q&A API:

AttributesTypeRequirementDescription
user_idNumericRequiredInput the unique user ID
course_idNumericRequiredInput course ID to get the Q&A
question_idNumericRequiredInput the unique question ID
qna_textStringRequiredGet the Q&A text

Here’s the JSON file of Review API:

{
   "user_id": 3,
   "course_id": 7378,
   "question_id": 0,
   "qna_text": "Write your reply here."
}

1. User QA List

URL: https://yourdomain.com/wp-json/tutor/v1/qna?user_id={user_id}&offset={offset}&limit={limit}
Type: GET

2. User QA Add Update

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

3. User QA Mark Read Undread

URL: https://yourdomain.com/wp-json/tutor/v1/qna-mark-read-unread/{comment_id}
Type: POST, PUT, PATCH

4. Delete QA

URL: https://yourdomain.com/wp-json/tutor/v1/qna/{comment_id}?user_id={user_id}
Type: DEL

Was this helpful?