The Thinkific API allows you to create a powerful and customized online educational solution that is built on the Thinkific experience. Build a customized e-commerce experience, manage your content, support users, and more!
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:
What is an API?
In computer programming, an Application Programming Interface (API) is a set of routines, protocols, and tools for building software applications. You can use an API to access databases or help to integrate and enhance the functionalities an application.
We only recommend working with the API if you have development experience. If you are looking for developer support, make sure to check out our Thinkific Experts Marketplace. Many course creators also use upwork.com or fiverr.com for hiring developers.
API Documentation
You can explore Thinkific's API V1.0.0 documentation HERE.
Authenticating
Before you can begin interacting with Thinkific API, your app needs to attain the necessary credentials. This can be done in two ways, depending on your intended use.
Authenticating Using OAuth
OAuth is the preferred method of authentication and involves the creation of an App that can be installed on multiple Thinkific sites with ease.
Learn more here: Building Apps in Thinkific
Authenticating with API Key & Subdomain
If you want a simple way to gain access to the API for an individual Thinkific site with the purpose of building a private or one-off app, you can authenticate using the Thinkific site's Subdomain and API Key.
Authentication is achieved by providing both the subdomain and corresponding API key as a Header in each request. Structure of headers:
Key |
Value |
X-Auth-API-Key |
{{Thinkific API key}} |
X-Auth-Subdomain |
{{Subdomain of the Thinkific site}} |
Content-Type |
application/json |
Base URL Path
All Endpoints will begin with https://api.thinkific.com/api/public/v1/
Making Your First Request
In order to get started with the API, a Thinkific account is required. You'll then need to copy your API Key:
- Login to your Thinkific account
- Go to Settings
- Select the Code & analytics tab
- Select API on the left menu
- You can copy your key under API Key
Test your connection by retrieving a list of your courses using the following command in your console. Make sure you replace “my-api-key” and “my-subdomain” with your own credentials.
curl https://api.thinkific.com/api/public/v1/courses \ -H 'X-Auth-API-Key: my-api-key' \ -H 'X-Auth-Subdomain: my-subdomain' \ -H 'Content-Type: application/json'
Authentication Errors
Errors due to invalid or incorrect credentials will respond with an HTTP status code of 401 and the payload body will include a JSON formatted error:
{'error':'Authentication Error'}
Access to Thinkific's Public API is available on the Pro plan plus Growth package or higher. If you receive an authentication error when attempting to connect to the API, you will need to upgrade your plan.
Rate Limits
Requests to the Thinkific API for any one account are limited to no more than 120 request per minute. In the case that this maximum is exceeded, you will receive a 403 HTTP status code with the following response:
"Rate Limit Exceeded"
Cross Origin Requests
Cross origin requests are supported, although it should be noted that making calls to the the API using client-side javascript is insecure and not recommended, as it exposes your API key to the public to be easily discovered and used to make changes to the Thinkific account.
We recommend that all communication to the Thinkific API be routed through your server as a proxy to ensure that you do not expose your API key publicly.
Data & Date Formatting
All data is returned in JSON format. All dates and timestamps are returned and expected in ISO 8601 format:
YYYY-MM-DDTHH:MM:SSZ
Pagination
All collections returned from Thinkific have a default limit of 25 items in each requests. Access to larger data sets can be accomplished using the following methods
Paging through items
You can access items on subsequent pages by specifying the "page" parameter for a collection of items. This is useful in combination with the limit parameter to loop until all items have been retrieved.
As an example the following request will return the second page of results (26 - 50) for your data-set:
curl https://api.thinkific.com/api/public/v1/courses?page=2 -H 'X-Auth-API-Key: my-api-key' -H 'X-Auth-Subdomain: my-school'
Increasing the limit
The default limit may be overridden by providing a "limit" parameter in your request. You can increase the limit returned per page up to a maximum of 250 items per request.
As an example, the following request will increase the items return per page to 50 and will return the second page of items:
curl https://api.thinkific.com/api/public/v1/courses?limit=50&page=2 -H 'X-Auth-API-Key: my-api-key' -H 'X-Auth-Subdomain: my-school'
Pagination Body Structure
All endpoints that return a collection of items will include two objects, an items array with the requested data-set, and a meta object that includes pagination information.
You can use the information in the pagination hash to determine your current state/location and whether there are more items that are available to fetch.
An example of what this might look like:
{
"items":[
{
"id":123456,
"created_at":"2019-05-22T16:07:37.825Z",
"first_name":"Bob",
"last_name":"Smith",
"full_name":"Bob Smith",
"company":"A Company",
"email":"something@example.com",
"roles":[
"course_admin"
],
"avatar_url":null,
"bio":null,
"headline":null,
"affiliate_code":null,
"external_source":null,
"affiliate_commission":null,
"affiliate_commission_type":"%",
"affiliate_payout_email":null,
"administered_course_ids":[
1,
2
],
"custom_profile_fields":[
{
"id":1,
"value":"Canada",
"label":"Country",
"custom_profile_field_definition_id":1
},
{
"id":2,
"value":"778-877-1000",
"label":"Phone Number",
"custom_profile_field_definition_id":2
}
]
}
],
"meta":{
"pagination":{
"current_page":1,
"next_page":null,
"prev_page":null,
"total_pages":1,
"total_items":7,
"entries_info":"1 of 7"
}
}
}
Validation Errors
All create and update operations have the potential to return validation errors if they are passed invalid data.
When this occurs the response will return with an HTTP status code of 422 and will include an error message that identifies the problem. The structure of this message includes an errors object with the error message details enclosed:
An example of an error when creating a new user might include:
{ 'errors': { 'email': ['has already been taken'], 'password':['is too short (minimum is 6 characters)''] } }