Webhooks are a powerful feature in Masteriyo that enables real-time communication between your WordPress LMS and external applications. This documentation covers both types of webhook functionality available in Masteriyo:

Trigger Webhooks (Outgoing): Send data from Masteriyo to external applications when specific events occur in your LMS.

Action Webhooks (Incoming): Allow external applications to trigger actions within Masteriyo.

What are Webhooks?

Webhooks allow different applications to communicate automatically with each other in real-time. When an event occurs in one application, it can notify another through webhooks, triggering specific actions or transferring data without manual intervention.

Trigger Webhooks (Outgoing Data)

Trigger webhooks send data from your Masteriyo LMS to external applications whenever specific events occur on your site.

Setting Up Trigger Webhooks

  1. Navigate to Masteriyo > Webhoooks in your WordPress admin dashboard.
  2. Click Add New Webhook.

Add New Webhook

  1. Configure the webhook with the following settings:
  • Webhook Name - Provide a name for the Webhook.
  • Description - Describe the purpose of the Webhook.
  • Status(Active) - Enable this to make the Webhook active.
  • Delivery URL - Enter the URL where you want to send the data.
  • Events - Lets you select the desired event for sending the data. There are various events available.

Setup Webhook

Note: The Event will vary for the admin and the instructors.

Secret(Optional) - This helps you identify if a malicious third-party system has altered the data before it reaches its destination.

After filling in all the required information, click on Create to save the webhook.

Available Trigger Events

Masteriyo offers various events that can trigger webhooks:

  • Course Completed

  • Course Published

  • Course Question Created

  • Course Question Reply Created

  • Course Review Created

  • Instructor Registration

  • Lesson Completed

  • Lesson Published

  • Quiz Completed

  • Quiz Published

  • Student Enrolled

  • Student Registration

    Note: When logged in as an instructor, webhooks will only be triggered for events related to that specific instructor's courses and activities.

Trigger Webhook Payload Format

Masteriyo sends data to your specified URL using HTTP POST in JSON format when a trigger event occurs.

Action Webhooks (Incoming Data)
Pro

Action webhooks allow external applications to perform actions within your Masteriyo LMS. This feature is available in the PRO version and enables you to integrate Masteriyo with CRM systems, automation tools, or other applications.

Supported Action Webhooks

Masteriyo supports the following action webhooks:

Action WebhookDescriptionRequired Parameters
masteriyo_user_enrolled_to_courseEnrolls a user in a specific courseuser_id (number), course_id (number)
masteriyo_create_studentCreates a new student accountemail, user_name, firstname, lastname
masteriyo_create_instructorCreates a new instructor accountemail, user_name, firstname, lastname
masteriyo_complete_lessonMarks a lesson as complete for a userlesson_id, user_id, course_id
masteriyo_course_progress_resetResets course progress for a usercourse_id, user_id
masteriyo_unenrolled_user_from_courseyUnenrolls a user from a coursecourse_id, user_id
masteriyo_course_user_completedEMarks a course as completed for a useruser_id, course_id

Setting Up Action Webhooks

To send action webhooks to Masteriyo from an external application (such as Zapier), use the following configuration:
Endpoint URL

https://your-site.com/wp-json/masteriyo/v1/webhooks/action

Method

Use the POST method for all action webhooks.

Headers

Include the following header for authentication:

X-WP-Webhook-Token: [your-webhook-token]

The webhook token can be generated and found in the Masteriyo Webhooks settings.

Payload Format

Use JSON format. For example,

{
  "event": "masteriyo_course_user_completed",
  "user_id": 123,
  "course_id": 456
}

The event parameter specifies which action to trigger, and additional parameters will vary based on the selected action.

Using Masteriyo Trigger Webhooks with Zapier

  1. First, enable Zapier addonexternal.
  2. Log in to Zapier to create a new Zap and click on the trigger.

Create Zap in Zapier

Click Trigger on Zapier

  1. Search for Masteriyo and select the app.

Search Masteriyo as Trigger

  1. For Trigger event, click on the drop-down menu and select an event.

Choose Trigger Event 5. Under Account, click on Sign In.

Sign in to Connect Masteriyo

  1. Now, you'll get a new interface asking for your site URL and the API key.

  2. Go back to your WordPress website, and navigate to Masteriyo > Zapier.

Copy API Key from Zapier

Here, you'll see the API key.

  1. Copy and paste the key and hit Yes, Continue to Masteriyo.

Paste API Key on Zapier

  1. Click on the Continue button to proceed further. It'll now provide you with the option to test the trigger to confirm your trigger. Test to confirm the trigger. If you see any records, it confirms that the trigger has been set.

Continue with selected record

Once you see the record, you can click on Continue with selected record.

Using Zapier to Send Action Webhooks to Masteriyo

  1. Click on Action and search for "Webhooks by Zapier" as your action app.

Select Action

  1. From the dropdown of Action event, select "POST" as the event and click on Continue.

Choose Action Event

  1. Configure the webhook:
    Example: URL: https://your-site.com/wp-json/masteriyo/v1/webhooks/actionexternal
    Payload Type: JSON
    Data:
    • event: masteriyo_course_user_completed
    • user_id: [user ID number]
    • course_id: [course ID number]

Configure Action URL

Headers:
X-WP-Webhook-Token: [your-webhook-token]

Configure Remaining Action

You can find the Webhook token from your WordPress dashboard. So, navigate to Webhook and click on the settings icon. Now, you'll see the webhook token in the side interface.

Navigate to Webhook and its Settings

Copy this token and paste under Headers of the Zap you're currently creating.

  1. Click on Continue to test the Zap.

  2. Under the Data out, you can see the relevant data.

This means you've successfully triggered webhooks with Zapier and sent the action to Masteriyo. Now, click on Publish to publish the zap.

Publish Zap

Now, whenever a student is enrolled in the course, the webhook will mark the course as completed.

In this documentation, we used Student Enrolled as the trigger that leads to the action of Course Completion. Similarly, you can use other Triggers and set other Action.



Was this article helpful to you?
Give us Rating

Last edited on June 30, 2025.
Edit this page