Note: This documentation refers to the API REST end points from the WooNinja B2B Dashboard for Thinkific. If you are looking for the Thinkific Admin API, click here.
Authorisation #
Admin users can generate an API token in the dashboard.
This token should be passed as Bearer token in all requests.
Base URL: www.example.com/api/
Notes:
- The Student API does not verify seat or course allocations, it will always permit the creation of a student and enrolment.
- Enrollments are asynchronous.
- API expects and responds with JSON
User API #
List Users
GET /api/users
View A Single User
GET /api/users/{id}
Create a User
POST /api/users
In this example, a user will be created and their account will have a maximum of 100 seats. Name, Email and Password are required. Max Seats is optional.
{
"name": "John Doe",
"email": "j.doe@www.wooninja.io",
"password": "********",
"max_seats": 100
}
Update A User
PUT / api/users/{id}
In this example, the given User ID will be updated. All parameters are optional.
{
"name": "Jay Doe",
"email": "doe.jay@www.wooninja.io",
"max_seats": 35
}
Upsert A User
POST /api/users/upsert
Creates a new user if they do not exist, or updates an existing one if they do. The primary key is the email and the email parameter is required. All other parameters are optional.
{
"name": "John Doe",
"email": "doe.john@www.wooninja.io",
"password": "********",
"max_seats": 35
}
Search For A User by Email
POST /api/users/search
Search for a given users by email.
{
"email": "john.doe@www.wooninja.io"
}
Delete A User
DELETE / api/users/{id}
Note, be careful and exercise caution when using this end point. It may delete students and associated records depending on your global system settings.
Assign / Reassign a User to Thinkific Group
POST /api/users/group/{id}
In this example, the given user ID will be assigned to a Thinkific Group called ‘My Thinkific Group’. If sync is set to true, the system will import all students assigned to that group in Thinkific, and associated them with the user in the dashboard.
- If a group does not exist in Thinkific with the same name, it will be created.
- Users will not be assigned to this Group in Thinkific e.g. As an analyst etc
- If a group is changed, students associated with the user will not be moved or otherwise placed in the new group.
{
"name": "My Thinkific Group",
"sync": false
}
Grant User Access to a Course or Bundle
POST /api/users/access/{id}
In this example, we will assign the user the Thinkific course/bundle ID of 1379051 with 55 seats with an enrollment of 365 days (1 year).
- To remove access, pass the same payload but with active equal to false.
- All parameters are required.
{
"thinkific_id": 1379051,
"active": true,
"max_seats": 55,
"enrollment_days": 365
}
Add Additional Seats to a User for a Course or Bundle
POST /api/users/seat/{id}
In this example, we will add 10 seats to the user for Thinkific course/bundle ID of 1379051 with an enrolment of 365 days (1 year).
- Enrollment days are for all enrolments by that user, it does not only apply to the seats being added in this call.
- All parameters are required and will overwrite existing values where present.
{
"thinkific_id": 1379051,
"active": true,
"add_seats": 10,
"enrollment_days": 365
}
Update Enrolment Expiry for a Users’ Students
POST /api/users/enrollments/{id}
In this example, we will update all the user’s assigned students to the same expiry date. This is end point is most useful for subscription services where you wish to keep all expiry dates the same and update them as a subscription renews, is cancelled etc.
Important – Read Carefully
- This end point will update all students associated with the user’s account. If that student is shared between user accounts, then the enrollment will be updated for all accounts.
- The endpoint is best used with bundles as it is easier to update one bundle as opposed to multiple courses.
- If an enrolment is already expired, it will be updated to the new expiry date and thus re-activated. Therefore we recommend you only use this endpoint for users that cannot control or otherwise remove enrolments of their assigned students.
In this example, we will update all expiry dates associated with this user for Thinkific course/bundle ID of 1379051 to 30 days from today.
{
"product": 1379051,
"type": "days",
"expiry_days": 30
}
If you wish to use dates, the following payload can be used:
{
"product": 1379051,
"type": "date",
"expiry_date": "Jun 30 2023"
}
To expire access immediately, use ‘expire_now’
{
"product": 1379051,
"type": "expire_now"
}
Or, to set lifetime access, e.g. Set the expiry to 10 years from today, you can use the following:
{
"product": 1379051,
"type": "no_expiry"
}
Student API #
List / View Students
Returns a paginated list of all students in the dashboard.
GET /api/students
View a Single Student
Returns a single student record from the dashboard
GET /api/students/{id}
id: The Student ID in the Dashboard
Upsert Student
Updates, or creates, a student record based on the given email.
POST /api/students
{
"first_name": "John",
"last_name": "Doe",
"email": "j.doe@www.wooninja.io",
"user_email": "info@www.wooninja.io",
"enrollments": [
1379051,
1354765
]
}
first_name: The students first name (Required)
last_name: The students last name (Required)
email: Student’s email. Used as their unique ID, record will be created if they do not exist. (Required)
user_email: User (instructors) email to which the student should be assigned. User must already exist. Student will be assigned to the user who issued the API token if omitted. (Optional)
enrollments: An array of Thinkific Product IDs to which the user should be enrolled. Supports courses and bundles. (Optional)
Associate / Disassociate a Student with a User
POST /api/students/associate
POST /api/students/dissociate
{
"email": "student@www.wooninja.io",
"user_email": "user@www.wooninja.io",
}
email: The student email (Required)
user_email: The user email (Required)
Note: The Student and User record must already exist.
Update Student
Updates a single student record
PUT /api/students/{id}
{
"first_name": "John",
"last_name": "Doe",
"email": "j.doe@www.wooninja.io",
}
id: The Student ID in the Dashboard (Note, this is NOT the Thinkific Student ID)
first_name: The students first name (Required)
last_name: The students last name (Required)
email: Student’s email. (Required)
Delete Student
Removes a student from the dashboard, and Thinkific (if enabled in the dashboard settings)
DELETE /api/students/{id}
id: The Student ID in the Dashboard
Note: Be very careful using this end point if your student is associated with multiple users as it will delete their student record entirely for all users.
Enroll Student
Adds a student to a course
POST /api/students/enroll
{
"email": "j.doe@www.wooninja.io",
"user_email": "info@www.wooninja.io",
"enrollments": [
1379051,
1354765
]
}
email: Student’s email. Must exist already. (Required)
user_email: User (instructors) email to which the student should be assigned. User must already exist. (Required)
enrollments: An array of Thinkific Product IDs to which the user should be enrolled. Supports courses and bundles. (Required)
Product API #
Note:
- In the dashboard context, a ‘Product’ is a Thinkific Course or Bundle.
- Use the ‘productable_id’ in automations to assign seats, enroll etc.
GET /api/products/{id}
Returns a given product by ID
GET api/products/search?term=search_term
Searches for a given product as provided in the search_term. Fields searched are name, Thinkific ID and Productable ID.