Thinkific's Webhooks API can be used to integrate an external application with your Thinkific site. Pretty cool, right?
ATTENTION: This article is no longer up to date, and should be automatically redirecting you to a more current article in our Developer-specific documentation. If for some reason you are not redirected, please use this link to see the most recent version of this article.
In this article:
Enrollment Progress and Completed Webhooks
About This Feature
Webhooks provide a way to receive information about certain events as soon as they happen in your Thinkific site. They allow developers to build apps that receive information, in near real-time, about events that happen in Thinkific courses and enable them to extend, customize, and integrate Thinkific with their own custom extensions or even with other applications around the web.
Please note that due to the custom nature of webhooks, our support team is unable to provide assistance with your webhook integrations. If you experience troubles while setting up your webhooks, we recommend you contact a developer to assist you.
Supported Webhook Topics
Event data should be stored as JSON. Right now webhooks can be registered for the following topics:
Model | Topics | Trigger |
Order | order.created |
When an order is successfully completed. See payload sample. Note that if you have opted into our single page checkout, orders are also created for Free courses. Orders are not created for Free courses using the two page checkout. |
User | user.signup |
Triggered when a new user signs up for your site. See payload sample. |
user.signin |
Triggered when a user signs in to your site from any of the standard login methods. This includes email/password sign-in, linkedin sign-in, express sign-in, checkout sign-in, and SSO. See payload sample. |
|
Enrollment | enrollment.trial |
Triggered when a user enrolls for a preview in any course. See payload sample. |
enrollment.created |
Triggered when a full enrollment is created in any of your courses. See payload sample. |
|
enrollment.progress |
Triggered when a student progresses forward through a course (ie. it is triggered when they complete lessons). See payload sample. Note: This event is similar to the lesson.completed event, but delivers a payload that includes the % progress in a course. This event can also be triggered when an admin updates a user's progress by Recalculating Progress) |
|
enrollment.completed |
Triggered when a student reaches 100% completion in a course. See payload sample. |
|
Lesson | lesson.completed |
Triggered when a student completes a lesson in a course. See payload sample. Note: This event is similar to the enrollment.progress event but returns a payload that includes information about which lesson has been completed. |
Course | course.created |
Triggered when a site administrator creates a new course. Note: Currently webhooks for this event can only be created through the API. |
course.deleted |
Triggered when a site administrator deletes a course on the site. Note: Currently webhooks for this event can only be created through the API. |
|
course.updated |
Triggered when a site administrator makes changes to the course's settings. This includes the course's name, URL and anything within the "Settings" tab Note: Currently webhooks for this event can only be created through the API. |
|
Product | product.updated |
Triggered when the site administrator makes changes to a product in Thinkific. Products include both courses and bundles. This event is fired when a product (course/bundle) is published/unpublished or when the price of a product changes. Note: Currently webhooks for this event can only be created through the API. |
Webhooks API Documentation
For in-depth detail on our Webhooks API, you can view our public documentation here.
How to Create a Webhook
Webhooks can be created programatically using the API or manually using the Admin tools provided with a Thinkific Site.
To manually create a new webhook from within a site:
- Go to Settings
- Select the Code & analytics tab on the top right
- Select Webhooks on the left side menu
- In the Webhooks block, select Webhooks to view the Webhooks settings page
- Click New Webhook on the top right
- Input Model, Topic and Target URL
- Click Save
Once your webhook is created, you will see it in your webhooks list. From this page, you can click the Edit button on the right to make any changes. You can also click the ellipsis (3 dot icon) to send a test event, or delete the webhook.
Webhook Details
If you need to see the events that have been sent, you can click on the webhook topic itself to get payload information and to check for success messages. Webhook event record history is stored in Thinkific for 30 days before being removed.
Response Status
The expected response status are HTTP status codes. The most common ones are:
- 200 OK
- 404 NOT FOUND
- 403 FORBIDDEN
- 502 BAD GATEWAY
- 503 SERVICE UNAVAILABLE
To learn more about HTTP status code, please check out this wiki page.
Payload
When your webhook is sent successfully, it will deliver a payload to the Target URL. You'll see the following payloads:
- order.created payload
- user.signin payload
- user.signup payload
- enrollment.created payload
- enrollment.trial payload
- enrollment.completed payload
- enrollment.progress payload
- lesson.completed payload
You can click on the event ID to see the payload:
Check out webhook examples for each payload here: Webhook Payload Samples
Enrollment Progress and Completed Webhooks
Typically, when new lessons are added or removed, while a student is in progress, the progress does not get recalculated automatically. We don't mark completion away from students who have already completed new content, when new content is added, with out the course creator's consent, so we let you trigger this recalculation manually via the "Recalculate Completions" button in your Progress Report. More information on that is here: Recalculate Progress
With respect to the webhooks, the enrollement.progress is triggered when the student progresses through the course, or when that recalculate completions button is clicked. The data returned via our API is also unchanged unless the "Recalculate Completions" button is clicked.
Webhooks Retries
A Webhook Retry is designed to automatically resend a webhook if the target URL does not return a 200 success response.
When a webhook is set up, the successful delivery of the webhook event relies on a variety of factors including connectivity from Thinkific and the Target URL. When these webhooks fail to deliver (ex: Network Time out), these failed events will be tracked and the webhook event is scheduled to be retried. This means that there will be multiple attempts to deliver webhook data.
What triggers a Webhook Retry?
Webhooks will reschedule a retry at any time the Target URL does not return a 200 success response. Failed webhook events could be a result of network connectivity, incorrect/unresponsive Target URL etc.
How often will a webhook retry?
Single webhooks are scheduled to retry a maximum of 14 times over a span of 16 hours before it stops trying to get a successful response. Each retry will be scheduled with an increased delay each time it needs to be retried.
Exponential Delay Example
Retry Attempt |
Delay until webhook is fired (in seconds) |
First try |
0 seconds |
2nd try |
10 seconds |
3rd try |
30 seconds |
4th try |
1 minute |
5th try |
2 minutes |
... |
|
11th try |
1 hour |
... |
|
14th try |
8 hours |
The functionality of Webhook retries was updated Feb 2020. As long as your webhook was set up correctly, you do not need to make any changes. If your webhooks are not resolving, make sure that a 200 response code is set up.