How to Sync Tutor LMS with an External System Using Webhooks
Tutor LMS has no built-in outgoing webhooks. Build your own from its action hooks: a signed, queued webhook sender for enrollments, completions and paid orders, ready for Zapier, Make or a CRM.
Checked against the plugin source: Tutor LMS 4.1.3, Tutor LMS Pro 4.1.3

Tutor LMS receives webhooks from payment gateways, but it does not send outgoing webhooks for events like "student enrolled" or "course completed". You can add them in a small plugin, using the action hooks Tutor LMS fires. This guide is verified against Tutor LMS 4.1.3.
Which events to send
| Event | Hook | Arguments |
|---|---|---|
| Enrollment created | tutor_after_enroll | course ID, enrollment ID |
| Paid enrollment activated | tutor_after_enrolled | course ID, student ID, enrollment ID |
| Lesson completed | tutor_lesson_completed_after | lesson ID, user ID |
| Quiz finished | tutor_quiz_finished | attempt ID, quiz ID, user ID |
| Course completed | tutor_course_complete_after | course ID, user ID |
| Enrollment cancelled | tutor_after_enrollment_cancelled | course ID, user ID |
| Order payment changed | tutor_order_payment_status_changed | order ID, previous status, new status |
A queued, signed sender
Sending inside the hook slows checkout and loses events when the receiver is down. Instead, schedule a background job and sign each request so the receiver can trust it.
define( 'TLE_WEBHOOK_URL', 'https://hooks.example.com/tutor' ); // Zapier, Make, n8n or your CRM.
add_action( 'tutor_course_complete_after', function ( $course_id, $user_id ) {
tle_queue_webhook( 'course.completed', array( 'course_id' => (int) $course_id, 'user_id' => (int) $user_id ) );
}, 20, 2 );
add_action( 'tutor_after_enrolled', function ( $course_id, $student_id, $enrollment_id ) {
tle_queue_webhook( 'enrollment.active', array( 'course_id' => (int) $course_id, 'user_id' => (int) $student_id, 'enrollment_id' => (int) $enrollment_id ) );
}, 20, 3 );
function tle_queue_webhook( $event, array $data ) {
$user = get_userdata( $data['user_id'] );
$data['email'] = $user ? $user->user_email : '';
$data['course_title'] = isset( $data['course_id'] ) ? get_the_title( $data['course_id'] ) : '';
wp_schedule_single_event( time(), 'tle_send_webhook', array( $event, $data, 1 ) );
}
add_action( 'tle_send_webhook', 'tle_send_webhook', 10, 3 );
function tle_send_webhook( $event, $data, $attempt ) {
$body = wp_json_encode( array( 'event' => $event, 'sent_at' => gmdate( 'c' ), 'data' => $data ) );
$response = wp_remote_post(
TLE_WEBHOOK_URL,
array(
'timeout' => 10,
'headers' => array(
'Content-Type' => 'application/json',
'X-Signature' => hash_hmac( 'sha256', $body, TLE_WEBHOOK_SECRET ),
),
'body' => $body,
)
);
$code = is_wp_error( $response ) ? 0 : (int) wp_remote_retrieve_response_code( $response );
if ( ( $code < 200 || $code >= 300 ) && $attempt < 5 ) {
wp_schedule_single_event( time() + 300 * $attempt, 'tle_send_webhook', array( $event, $data, $attempt + 1 ) );
}
}
Define TLE_WEBHOOK_SECRET in wp-config.php. The receiver recomputes the HMAC of the raw body and rejects mismatches.
Making WP-Cron reliable
WP-Cron runs on page visits. On a quiet site, set up a real server cron that calls wp-cron.php every minute, or use Action Scheduler if it is already installed.
Connecting to Zapier or Make
- Create a "catch hook" trigger in Zapier (Webhooks by Zapier) or Make, and copy its URL.
- Paste it into
TLE_WEBHOOK_URL. - Trigger the event on a test course and map the fields.
Good practice
- Send IDs and the minimum personal data the receiver needs.
- Include an event name and timestamp so receivers can deduplicate.
- Log failures where an admin can see them.
More hooks in the hooks reference. Need it connected to your stack? Our integrations team can build it.
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.
