analytics
Klipfolio Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Klipfolio KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.klipfolio.*.
Use lua_read_doc("integrations.klipfolio") 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
Klipfolio workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.klipfolio.list_dashboards({limit = 1, page = 1}))' --json kosmo integrations:lua --eval 'print(docs.read("klipfolio"))' --json
kosmo integrations:lua --eval 'print(docs.read("klipfolio.list_dashboards"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local klipfolio = app.integrations.klipfolio
local result = klipfolio.list_dashboards({limit = 1, page = 1})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.klipfolio, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.klipfolio.default.* or app.integrations.klipfolio.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Klipfolio, 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.
Klipfolio — Lua API Reference
list_dashboards
List all dashboards accessible to the authenticated user.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of dashboards to return per page (default: 25) |
page | integer | no | Page number for pagination, 1-based (default: 1) |
Example
local result = app.integrations.klipfolio.list_dashboards({
limit = 10,
page = 1
})
for _, dashboard in ipairs(result.data.dashboards) do
print(dashboard.name .. " (ID: " .. dashboard.id .. ")")
end
get_dashboard
Get details for a specific Klipfolio dashboard by ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique dashboard identifier |
Example
local result = app.integrations.klipfolio.get_dashboard({
id = "abc123def456"
})
print("Dashboard: " .. result.data.name)
print("Description: " .. (result.data.description or "N/A"))
list_metrics
List all metrics accessible to the authenticated user.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of metrics to return per page (default: 25) |
page | integer | no | Page number for pagination, 1-based (default: 1) |
Example
local result = app.integrations.klipfolio.list_metrics({
limit = 50,
page = 1
})
for _, metric in ipairs(result.data.metrics) do
print(metric.name .. " (ID: " .. metric.id .. ")")
end
get_metric
Get details for a specific Klipfolio metric by ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique metric identifier |
Example
local result = app.integrations.klipfolio.get_metric({
id = "metric123"
})
print("Metric: " .. result.data.name)
print("Formula: " .. (result.data.formula or "N/A"))
list_datasources
List all data sources accessible to the authenticated user.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of data sources to return per page (default: 25) |
page | integer | no | Page number for pagination, 1-based (default: 1) |
Example
local result = app.integrations.klipfolio.list_datasources({
limit = 25,
page = 1
})
for _, ds in ipairs(result.data.datasources) do
print(ds.name .. " — " .. ds.connector_type .. " (ID: " .. ds.id .. ")")
end
get_datasource
Get details for a specific Klipfolio data source by ID.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique data source identifier |
Example
local result = app.integrations.klipfolio.get_datasource({
id = "ds789xyz"
})
print("Data Source: " .. result.data.name)
print("Connector: " .. result.data.connector_type)
get_current_user
Get the authenticated user’s profile information.
Parameters
None.
Example
local result = app.integrations.klipfolio.get_current_user({})
print("User: " .. result.data.name)
print("Email: " .. result.data.email)
print("Role: " .. result.data.role)
Multi-Account Usage
If you have multiple Klipfolio accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations.klipfolio.function_name({...})
-- Explicit default (portable across setups)
app.integrations.klipfolio.default.function_name({...})
-- Named accounts
app.integrations.klipfolio.production.function_name({...})
app.integrations.klipfolio.staging.function_name({...})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Klipfolio — Lua API Reference
## list_dashboards
List all dashboards accessible to the authenticated user.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of dashboards to return per page (default: 25) |
| `page` | integer | no | Page number for pagination, 1-based (default: 1) |
### Example
```lua
local result = app.integrations.klipfolio.list_dashboards({
limit = 10,
page = 1
})
for _, dashboard in ipairs(result.data.dashboards) do
print(dashboard.name .. " (ID: " .. dashboard.id .. ")")
end
```
---
## get_dashboard
Get details for a specific Klipfolio dashboard by ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The unique dashboard identifier |
### Example
```lua
local result = app.integrations.klipfolio.get_dashboard({
id = "abc123def456"
})
print("Dashboard: " .. result.data.name)
print("Description: " .. (result.data.description or "N/A"))
```
---
## list_metrics
List all metrics accessible to the authenticated user.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of metrics to return per page (default: 25) |
| `page` | integer | no | Page number for pagination, 1-based (default: 1) |
### Example
```lua
local result = app.integrations.klipfolio.list_metrics({
limit = 50,
page = 1
})
for _, metric in ipairs(result.data.metrics) do
print(metric.name .. " (ID: " .. metric.id .. ")")
end
```
---
## get_metric
Get details for a specific Klipfolio metric by ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The unique metric identifier |
### Example
```lua
local result = app.integrations.klipfolio.get_metric({
id = "metric123"
})
print("Metric: " .. result.data.name)
print("Formula: " .. (result.data.formula or "N/A"))
```
---
## list_datasources
List all data sources accessible to the authenticated user.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of data sources to return per page (default: 25) |
| `page` | integer | no | Page number for pagination, 1-based (default: 1) |
### Example
```lua
local result = app.integrations.klipfolio.list_datasources({
limit = 25,
page = 1
})
for _, ds in ipairs(result.data.datasources) do
print(ds.name .. " — " .. ds.connector_type .. " (ID: " .. ds.id .. ")")
end
```
---
## get_datasource
Get details for a specific Klipfolio data source by ID.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The unique data source identifier |
### Example
```lua
local result = app.integrations.klipfolio.get_datasource({
id = "ds789xyz"
})
print("Data Source: " .. result.data.name)
print("Connector: " .. result.data.connector_type)
```
---
## get_current_user
Get the authenticated user's profile information.
### Parameters
None.
### Example
```lua
local result = app.integrations.klipfolio.get_current_user({})
print("User: " .. result.data.name)
print("Email: " .. result.data.email)
print("Role: " .. result.data.role)
```
---
## Multi-Account Usage
If you have multiple Klipfolio accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations.klipfolio.function_name({...})
-- Explicit default (portable across setups)
app.integrations.klipfolio.default.function_name({...})
-- Named accounts
app.integrations.klipfolio.production.function_name({...})
app.integrations.klipfolio.staging.function_name({...})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.klipfolio.list_dashboards({limit = 1, page = 1})
print(result) Functions
list_dashboards Read
List all dashboards accessible to the authenticated user in Klipfolio. Returns dashboard IDs, names, and metadata.
- Lua path
app.integrations.klipfolio.list_dashboards- Full name
klipfolio.klipfolio_list_dashboards
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of dashboards to return per page (default: 25). |
page | integer | no | Page number for pagination, 1-based (default: 1). |
get_dashboard Read
Get details for a specific Klipfolio dashboard by ID, including its layout, Klips, and sharing settings.
- Lua path
app.integrations.klipfolio.get_dashboard- Full name
klipfolio.klipfolio_get_dashboard
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique dashboard identifier. |
list_metrics Read
List all metrics accessible to the authenticated user in Klipfolio. Returns metric IDs, names, and associated data sources.
- Lua path
app.integrations.klipfolio.list_metrics- Full name
klipfolio.klipfolio_list_metrics
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of metrics to return per page (default: 25). |
page | integer | no | Page number for pagination, 1-based (default: 1). |
get_metric Read
Get details for a specific Klipfolio metric by ID, including its formula, data bindings, and formatting.
- Lua path
app.integrations.klipfolio.get_metric- Full name
klipfolio.klipfolio_get_metric
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique metric identifier. |
list_data_sources Read
List all data sources accessible to the authenticated user in Klipfolio. Returns data source IDs, names, and connector types.
- Lua path
app.integrations.klipfolio.list_data_sources- Full name
klipfolio.klipfolio_list_datasources
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of data sources to return per page (default: 25). |
page | integer | no | Page number for pagination, 1-based (default: 1). |
get_data_source Read
Get details for a specific Klipfolio data source by ID, including its connector type, refresh settings, and configuration.
- Lua path
app.integrations.klipfolio.get_data_source- Full name
klipfolio.klipfolio_get_datasource
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unique data source identifier. |
get_current_user Read
Get the authenticated Klipfolio user's profile information, including name, email, and role.
- Lua path
app.integrations.klipfolio.get_current_user- Full name
klipfolio.klipfolio_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||