productivity
Thinkific Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Thinkific KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.thinkific.*.
Use lua_read_doc("integrations.thinkific") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Thinkific workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.thinkific.list_courses({limit = 1, page = 1, query = "example_query"}))' --json kosmo integrations:lua --eval 'print(docs.read("thinkific"))' --json
kosmo integrations:lua --eval 'print(docs.read("thinkific.list_courses"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local thinkific = app.integrations.thinkific
local result = thinkific.list_courses({limit = 1, page = 1, query = "example_query"})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.thinkific, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.thinkific.default.* or app.integrations.thinkific.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Thinkific, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Thinkific — Lua API Reference
list_courses
List courses in your Thinkific site.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of courses per page (default: 25, max: 250) |
page | integer | no | Page number for pagination (default: 1) |
query | string | no | Search term to filter courses by name |
Examples
-- List first 50 courses
local result = app.integrations.thinkific.list_courses({
limit = 50,
page = 1
})
-- Search for a course
local result = app.integrations.thinkific.list_courses({
query = "onboarding"
})
for _, course in ipairs(result.items) do
print(course.id .. ": " .. course.name)
end
get_course
Get detailed information about a specific Thinkific course.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The Thinkific course ID |
Example
local course = app.integrations.thinkific.get_course({ id = 12345 })
print("Course: " .. course.name)
print("Description: " .. (course.description or "N/A"))
print("Status: " .. course.status)
create_course
Create a new course in Thinkific.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | The course name |
description | string | no | The course description |
course_card_subtitle | string | no | Subtitle shown on the course card |
Example
local course = app.integrations.thinkific.create_course({
name = "Introduction to Lua",
description = "Learn the basics of Lua programming"
})
print("Created course: " .. course.id)
list_enrollments
List enrollments in your Thinkific site.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of enrollments per page (default: 25, max: 250) |
page | integer | no | Page number for pagination (default: 1) |
course_id | integer | no | Filter enrollments by course ID |
user_id | integer | no | Filter enrollments by user ID |
Examples
-- List all enrollments
local result = app.integrations.thinkific.list_enrollments({
limit = 50,
page = 1
})
-- Filter by course
local result = app.integrations.thinkific.list_enrollments({
course_id = 12345
})
-- Filter by user
local result = app.integrations.thinkific.list_enrollments({
user_id = 67890
})
for _, enrollment in ipairs(result.items) do
print(enrollment.id .. ": Course " .. enrollment.course_id .. " - User " .. enrollment.user_id .. " - " .. tostring(enrollment.percentage_completed) .. "% complete")
end
get_enrollment
Get detailed information about a specific Thinkific enrollment.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The Thinkific enrollment ID |
Example
local enrollment = app.integrations.thinkific.get_enrollment({ id = 56789 })
print("Course ID: " .. enrollment.course_id)
print("User ID: " .. enrollment.user_id)
print("Progress: " .. tostring(enrollment.percentage_completed) .. "%")
print("Completed: " .. tostring(enrollment.completed))
list_users
List users in your Thinkific site.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of users per page (default: 25, max: 250) |
page | integer | no | Page number for pagination (default: 1) |
query | string | no | Search term to filter users by name or email |
Examples
-- List first 50 users
local result = app.integrations.thinkific.list_users({
limit = 50,
page = 1
})
-- Search for a user
local result = app.integrations.thinkific.list_users({
query = "john"
})
for _, user in ipairs(result.items) do
print(user.id .. ": " .. user.first_name .. " " .. user.last_name .. " (" .. user.email .. ")")
end
get_current_user
Get the profile of the currently authenticated Thinkific user.
Parameters
None.
Example
local me = app.integrations.thinkific.get_current_user({})
print("Logged in as: " .. me.first_name .. " " .. me.last_name)
print("Email: " .. me.email)
Multi-Account Usage
If you have multiple Thinkific accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.thinkific.list_courses({...})
-- Explicit default (portable across setups)
app.integrations.thinkific.default.list_courses({...})
-- Named accounts
app.integrations.thinkific.production.list_courses({...})
app.integrations.thinkific.staging.list_courses({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Thinkific — Lua API Reference
## list_courses
List courses in your Thinkific site.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of courses per page (default: 25, max: 250) |
| `page` | integer | no | Page number for pagination (default: 1) |
| `query` | string | no | Search term to filter courses by name |
### Examples
```lua
-- List first 50 courses
local result = app.integrations.thinkific.list_courses({
limit = 50,
page = 1
})
-- Search for a course
local result = app.integrations.thinkific.list_courses({
query = "onboarding"
})
for _, course in ipairs(result.items) do
print(course.id .. ": " .. course.name)
end
```
---
## get_course
Get detailed information about a specific Thinkific course.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The Thinkific course ID |
### Example
```lua
local course = app.integrations.thinkific.get_course({ id = 12345 })
print("Course: " .. course.name)
print("Description: " .. (course.description or "N/A"))
print("Status: " .. course.status)
```
---
## create_course
Create a new course in Thinkific.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `name` | string | yes | The course name |
| `description` | string | no | The course description |
| `course_card_subtitle` | string | no | Subtitle shown on the course card |
### Example
```lua
local course = app.integrations.thinkific.create_course({
name = "Introduction to Lua",
description = "Learn the basics of Lua programming"
})
print("Created course: " .. course.id)
```
---
## list_enrollments
List enrollments in your Thinkific site.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of enrollments per page (default: 25, max: 250) |
| `page` | integer | no | Page number for pagination (default: 1) |
| `course_id` | integer | no | Filter enrollments by course ID |
| `user_id` | integer | no | Filter enrollments by user ID |
### Examples
```lua
-- List all enrollments
local result = app.integrations.thinkific.list_enrollments({
limit = 50,
page = 1
})
-- Filter by course
local result = app.integrations.thinkific.list_enrollments({
course_id = 12345
})
-- Filter by user
local result = app.integrations.thinkific.list_enrollments({
user_id = 67890
})
for _, enrollment in ipairs(result.items) do
print(enrollment.id .. ": Course " .. enrollment.course_id .. " - User " .. enrollment.user_id .. " - " .. tostring(enrollment.percentage_completed) .. "% complete")
end
```
---
## get_enrollment
Get detailed information about a specific Thinkific enrollment.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | integer | yes | The Thinkific enrollment ID |
### Example
```lua
local enrollment = app.integrations.thinkific.get_enrollment({ id = 56789 })
print("Course ID: " .. enrollment.course_id)
print("User ID: " .. enrollment.user_id)
print("Progress: " .. tostring(enrollment.percentage_completed) .. "%")
print("Completed: " .. tostring(enrollment.completed))
```
---
## list_users
List users in your Thinkific site.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Number of users per page (default: 25, max: 250) |
| `page` | integer | no | Page number for pagination (default: 1) |
| `query` | string | no | Search term to filter users by name or email |
### Examples
```lua
-- List first 50 users
local result = app.integrations.thinkific.list_users({
limit = 50,
page = 1
})
-- Search for a user
local result = app.integrations.thinkific.list_users({
query = "john"
})
for _, user in ipairs(result.items) do
print(user.id .. ": " .. user.first_name .. " " .. user.last_name .. " (" .. user.email .. ")")
end
```
---
## get_current_user
Get the profile of the currently authenticated Thinkific user.
### Parameters
None.
### Example
```lua
local me = app.integrations.thinkific.get_current_user({})
print("Logged in as: " .. me.first_name .. " " .. me.last_name)
print("Email: " .. me.email)
```
---
## Multi-Account Usage
If you have multiple Thinkific accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.thinkific.list_courses({...})
-- Explicit default (portable across setups)
app.integrations.thinkific.default.list_courses({...})
-- Named accounts
app.integrations.thinkific.production.list_courses({...})
app.integrations.thinkific.staging.list_courses({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.thinkific.list_courses({limit = 1, page = 1, query = "example_query"})
print(result) Functions
list_courses Read
List courses in your Thinkific site. Returns course IDs, names, descriptions, and status. Supports pagination and search.
- Lua path
app.integrations.thinkific.list_courses- Full name
thinkific.thinkific_list_courses
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of courses to return per page (default: 25, max: 250). |
page | integer | no | Page number for pagination (default: 1). |
query | string | no | Search term to filter courses by name. |
get_course Read
Get detailed information about a specific Thinkific course by its ID, including chapters, description, and pricing.
- Lua path
app.integrations.thinkific.get_course- Full name
thinkific.thinkific_get_course
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The Thinkific course ID. |
create_course Write
Create a new course in Thinkific. Requires a course name. Optionally include a description and additional course settings.
- Lua path
app.integrations.thinkific.create_course- Full name
thinkific.thinkific_create_course
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | The course name. |
description | string | no | The course description. |
course_card_subtitle | string | no | Subtitle shown on the course card. |
list_enrollments Read
List enrollments in your Thinkific site. Returns enrollment IDs, user info, course details, progress, and completion status. Supports pagination and filtering by course or user.
- Lua path
app.integrations.thinkific.list_enrollments- Full name
thinkific.thinkific_list_enrollments
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of enrollments to return per page (default: 25, max: 250). |
page | integer | no | Page number for pagination (default: 1). |
course_id | integer | no | Filter enrollments by course ID. |
user_id | integer | no | Filter enrollments by user ID. |
get_enrollment Read
Get detailed information about a specific Thinkific enrollment by its ID, including progress percentage, completion status, and associated course and user details.
- Lua path
app.integrations.thinkific.get_enrollment- Full name
thinkific.thinkific_get_enrollment
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The Thinkific enrollment ID. |
list_users Read
List users in your Thinkific site. Returns user IDs, names, emails, and status. Supports pagination and search.
- Lua path
app.integrations.thinkific.list_users- Full name
thinkific.thinkific_list_users
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of users to return per page (default: 25, max: 250). |
page | integer | no | Page number for pagination (default: 1). |
query | string | no | Search term to filter users by name or email. |
get_current_user Read
Get the profile of the currently authenticated Thinkific user. Useful for verifying API credentials and identifying the connected account.
- Lua path
app.integrations.thinkific.get_current_user- Full name
thinkific.thinkific_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||