KosmoKrator

productivity

Podia Lua API for KosmoKrator Agents

Agent-facing Lua documentation and function reference for the Podia KosmoKrator integration.

Lua Namespace

Agents call this integration through app.integrations.podia.*. Use lua_read_doc("integrations.podia") 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 Podia workflow without starting an interactive agent session.

Inline Lua call
kosmo integrations:lua --eval 'dump(app.integrations.podia.list_products({}))' --json
Read Lua docs headlessly
kosmo integrations:lua --eval 'print(docs.read("podia"))' --json
kosmo integrations:lua --eval 'print(docs.read("podia.list_products"))' --json

Workflow file

Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.

workflow.lua
local podia = app.integrations.podia
local result = podia.list_products({})

dump(result)
Run the workflow
kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json
Namespace note. integrations:lua exposes app.integrations.podia, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.podia.default.* or app.integrations.podia.work.* when you configured named credential accounts.

MCP-only Lua

If the script only needs configured MCP servers and does not need Podia, use the narrower mcp:lua command.

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.

Podia — Lua API Reference

list_products

List all online courses and digital downloads in your Podia account.

Parameters

None.

Examples

local result = app.integrations.podia.list_products()

for _, product in ipairs(result.products) do
  print(product.name .. " — " .. product.type .. " (" .. product.id .. ")")
end

get_product

Get detailed information about a single Podia product.

Parameters

NameTypeRequiredDescription
product_idstringyesThe ID of the product to retrieve

Example

local result = app.integrations.podia.get_product({
  product_id = "12345"
})

print(result.product.name)
print(result.product.description)
print(result.product.price)

list_customers

List all customers in your Podia account.

Parameters

NameTypeRequiredDescription
pageintegernoPage number for pagination (default: 1)

Examples

All customers

local result = app.integrations.podia.list_customers()

for _, customer in ipairs(result.customers) do
  print(customer.email .. " — " .. customer.name)
end

Paginated

local result = app.integrations.podia.list_customers({
  page = 2
})

get_customer

Get details for a single customer.

Parameters

NameTypeRequiredDescription
customer_idstringyesThe ID of the customer

Example

local result = app.integrations.podia.get_customer({
  customer_id = "67890"
})

print(result.customer.email)
print(result.customer.name)
print(result.customer.total_spent)

list_sales

List sales from your Podia account with optional filters.

Parameters

NameTypeRequiredDescription
product_idstringnoFilter by product ID
beforestringnoOnly sales before this ISO 8601 timestamp
afterstringnoOnly sales after this ISO 8601 timestamp
pageintegernoPage number for pagination (default: 1)

Examples

All recent sales

local result = app.integrations.podia.list_sales()

for _, sale in ipairs(result.sales) do
  print(sale.email .. " — $" .. sale.amount .. " — " .. sale.product_name)
end

Sales for a specific product

local result = app.integrations.podia.list_sales({
  product_id = "12345"
})

print("Total sales: " .. result.totalCount)

Sales in a date range

local result = app.integrations.podia.list_sales({
  after = "2026-01-01T00:00:00Z",
  before = "2026-01-31T23:59:59Z"
})

get_sale

Get details for a single sale.

Parameters

NameTypeRequiredDescription
sale_idstringyesThe ID of the sale

Example

local result = app.integrations.podia.get_sale({
  sale_id = "SALE123"
})

print(result.sale.email)
print(result.sale.amount)
print(result.sale.status)
print(result.sale.product_name)

get_current_user

Get the profile of the currently authenticated Podia user.

Parameters

None.

Example

local result = app.integrations.podia.get_current_user()

print("Connected as: " .. result.user.name)
print("Email: " .. result.user.email)

Multi-Account Usage

If you have multiple Podia accounts configured, use account-specific namespaces:

-- Default account (always works)
app.integrations.podia.function_name({...})

-- Explicit default (portable across setups)
app.integrations.podia.default.function_name({...})

-- Named accounts
app.integrations.podia.main_site.function_name({...})
app.integrations.podia.course_platform.function_name({...})

All functions are identical across accounts — only the credentials differ.

Raw agent markdown
# Podia — Lua API Reference

## list_products

List all online courses and digital downloads in your Podia account.

### Parameters

None.

### Examples

```lua
local result = app.integrations.podia.list_products()

for _, product in ipairs(result.products) do
  print(product.name .. " — " .. product.type .. " (" .. product.id .. ")")
end
```

---

## get_product

Get detailed information about a single Podia product.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `product_id` | string | yes | The ID of the product to retrieve |

### Example

```lua
local result = app.integrations.podia.get_product({
  product_id = "12345"
})

print(result.product.name)
print(result.product.description)
print(result.product.price)
```

---

## list_customers

List all customers in your Podia account.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number for pagination (default: 1) |

### Examples

#### All customers

```lua
local result = app.integrations.podia.list_customers()

for _, customer in ipairs(result.customers) do
  print(customer.email .. " — " .. customer.name)
end
```

#### Paginated

```lua
local result = app.integrations.podia.list_customers({
  page = 2
})
```

---

## get_customer

Get details for a single customer.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `customer_id` | string | yes | The ID of the customer |

### Example

```lua
local result = app.integrations.podia.get_customer({
  customer_id = "67890"
})

print(result.customer.email)
print(result.customer.name)
print(result.customer.total_spent)
```

---

## list_sales

List sales from your Podia account with optional filters.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `product_id` | string | no | Filter by product ID |
| `before` | string | no | Only sales before this ISO 8601 timestamp |
| `after` | string | no | Only sales after this ISO 8601 timestamp |
| `page` | integer | no | Page number for pagination (default: 1) |

### Examples

#### All recent sales

```lua
local result = app.integrations.podia.list_sales()

for _, sale in ipairs(result.sales) do
  print(sale.email .. " — $" .. sale.amount .. " — " .. sale.product_name)
end
```

#### Sales for a specific product

```lua
local result = app.integrations.podia.list_sales({
  product_id = "12345"
})

print("Total sales: " .. result.totalCount)
```

#### Sales in a date range

```lua
local result = app.integrations.podia.list_sales({
  after = "2026-01-01T00:00:00Z",
  before = "2026-01-31T23:59:59Z"
})
```

---

## get_sale

Get details for a single sale.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `sale_id` | string | yes | The ID of the sale |

### Example

```lua
local result = app.integrations.podia.get_sale({
  sale_id = "SALE123"
})

print(result.sale.email)
print(result.sale.amount)
print(result.sale.status)
print(result.sale.product_name)
```

---

## get_current_user

Get the profile of the currently authenticated Podia user.

### Parameters

None.

### Example

```lua
local result = app.integrations.podia.get_current_user()

print("Connected as: " .. result.user.name)
print("Email: " .. result.user.email)
```

---

## Multi-Account Usage

If you have multiple Podia accounts configured, use account-specific namespaces:

```lua
-- Default account (always works)
app.integrations.podia.function_name({...})

-- Explicit default (portable across setups)
app.integrations.podia.default.function_name({...})

-- Named accounts
app.integrations.podia.main_site.function_name({...})
app.integrations.podia.course_platform.function_name({...})
```

All functions are identical across accounts — only the credentials differ.
Metadata-derived Lua example
local result = app.integrations.podia.list_products({})
print(result)

Functions

list_products Read

List all online courses and digital downloads in your Podia account. Returns product names, IDs, types, and metadata.

Lua path
app.integrations.podia.list_products
Full name
podia.podia_list_products
ParameterTypeRequiredDescription
No parameters.
get_product Read

Get detailed information about a single Podia product by its ID. Returns full product data including description, price, type (course or download), and purchase URL.

Lua path
app.integrations.podia.get_product
Full name
podia.podia_get_product
ParameterTypeRequiredDescription
product_id string yes The ID of the product to retrieve.
list_customers Read

List all customers in your Podia account. Returns customer names, emails, and purchase history summaries.

Lua path
app.integrations.podia.list_customers
Full name
podia.podia_list_customers
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
get_customer Read

Get detailed information about a single Podia customer by their ID. Returns customer status, email, and purchase details.

Lua path
app.integrations.podia.get_customer
Full name
podia.podia_get_customer
ParameterTypeRequiredDescription
customer_id string yes The ID of the customer to retrieve.
list_sales Read

List sales from your Podia account. Optionally filter by product ID, date range, or page. Returns sale details including buyer info, amount, and product.

Lua path
app.integrations.podia.list_sales
Full name
podia.podia_list_sales
ParameterTypeRequiredDescription
product_id string no Filter sales by a specific product ID.
before string no Only return sales before this ISO 8601 timestamp (e.g., "2026-01-01T00:00:00Z").
after string no Only return sales after this ISO 8601 timestamp (e.g., "2026-01-01T00:00:00Z").
page integer no Page number for pagination (default: 1).
get_sale Read

Get detailed information about a single Podia sale by its ID. Returns full sale data including buyer details, amount, product, and payment status.

Lua path
app.integrations.podia.get_sale
Full name
podia.podia_get_sale
ParameterTypeRequiredDescription
sale_id string yes The ID of the sale to retrieve.
get_current_user Read

Get the profile of the currently authenticated Podia user. Useful to verify the connection and see account details.

Lua path
app.integrations.podia.get_current_user
Full name
podia.podia_get_current_user
ParameterTypeRequiredDescription
No parameters.