productivity
Unbounce Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Unbounce KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.unbounce.*.
Use lua_read_doc("integrations.unbounce") 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
Unbounce workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.unbounce.get_api_metadata({}))' --json kosmo integrations:lua --eval 'print(docs.read("unbounce"))' --json
kosmo integrations:lua --eval 'print(docs.read("unbounce.get_api_metadata"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local unbounce = app.integrations.unbounce
local result = unbounce.get_api_metadata({})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.unbounce, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.unbounce.default.* or app.integrations.unbounce.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Unbounce, 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.
Unbounce Lua API Reference
Namespace: app.integrations.unbounce
Configure an Unbounce OAuth bearer access_token. The default API base URL is
https://api.unbounce.com.
Accounts
local accounts = app.integrations.unbounce.list_accounts({})
local account = app.integrations.unbounce.get_account({ account_id = "1456243" })
local sub_accounts = app.integrations.unbounce.list_sub_accounts({
account_id = "1456243",
limit = 50
})
local sub_account = app.integrations.unbounce.get_sub_account({
sub_account_id = "1552433"
})
Pages
local pages = app.integrations.unbounce.list_pages({
limit = 20,
offset = 0,
sort = "-created_at"
})
local account_pages = app.integrations.unbounce.list_account_pages({
account_id = "1456243",
params = { limit = 20 }
})
local page = app.integrations.unbounce.get_page({
page_id = "a2834fde-1234-5678-abcd-1234567890ab"
})
local fields = app.integrations.unbounce.list_page_form_fields({
page_id = "a2834fde-1234-5678-abcd-1234567890ab"
})
Leads
local leads = app.integrations.unbounce.list_leads({
page_id = "a2834fde-1234-5678-abcd-1234567890ab",
limit = 25
})
local lead = app.integrations.unbounce.get_lead({
lead_id = "b3945gef-2345-6789-bcde-2345678901bc"
})
local created = app.integrations.unbounce.create_lead({
page_id = "a2834fde-1234-5678-abcd-1234567890ab",
payload = {
conversion = true,
visitor_id = "visitor-123",
form_submission = {
variant_id = "a",
submitter_ip = "127.0.0.1",
form_data = {
email = "lead@example.test",
first_name = "Ada"
}
}
}
})
Lead deletion requests are asynchronous:
local request = app.integrations.unbounce.create_lead_deletion_request({
page_id = "a2834fde-1234-5678-abcd-1234567890ab",
payload = { lead_ids = { "b3945gef-2345-6789-bcde-2345678901bc" } }
})
local status = app.integrations.unbounce.get_lead_deletion_request({
page_id = "a2834fde-1234-5678-abcd-1234567890ab",
lead_deletion_request_id = request.id
})
Domains And Page Groups
local domains = app.integrations.unbounce.list_domains({
sub_account_id = "1552433"
})
local domain_pages = app.integrations.unbounce.list_domain_pages({
domain_id = "domain-123"
})
local groups = app.integrations.unbounce.list_page_groups({
sub_account_id = "1552433"
})
local group_pages = app.integrations.unbounce.list_page_group_pages({
page_group_id = "group-123"
})
Raw API Helpers
Use raw helpers for documented Unbounce endpoints that do not yet have a named tool. Paths must be relative; full URLs and parent-directory segments are rejected.
local raw = app.integrations.unbounce.api_get({
path = "/accounts",
params = { sort_order = "desc" }
})
Multi-Account Usage
app.integrations.unbounce.list_pages({})
app.integrations.unbounce.client_a.list_pages({})Raw agent markdown
# Unbounce Lua API Reference
Namespace: `app.integrations.unbounce`
Configure an Unbounce OAuth bearer `access_token`. The default API base URL is
`https://api.unbounce.com`.
## Accounts
```lua
local accounts = app.integrations.unbounce.list_accounts({})
local account = app.integrations.unbounce.get_account({ account_id = "1456243" })
local sub_accounts = app.integrations.unbounce.list_sub_accounts({
account_id = "1456243",
limit = 50
})
local sub_account = app.integrations.unbounce.get_sub_account({
sub_account_id = "1552433"
})
```
## Pages
```lua
local pages = app.integrations.unbounce.list_pages({
limit = 20,
offset = 0,
sort = "-created_at"
})
local account_pages = app.integrations.unbounce.list_account_pages({
account_id = "1456243",
params = { limit = 20 }
})
local page = app.integrations.unbounce.get_page({
page_id = "a2834fde-1234-5678-abcd-1234567890ab"
})
local fields = app.integrations.unbounce.list_page_form_fields({
page_id = "a2834fde-1234-5678-abcd-1234567890ab"
})
```
## Leads
```lua
local leads = app.integrations.unbounce.list_leads({
page_id = "a2834fde-1234-5678-abcd-1234567890ab",
limit = 25
})
local lead = app.integrations.unbounce.get_lead({
lead_id = "b3945gef-2345-6789-bcde-2345678901bc"
})
local created = app.integrations.unbounce.create_lead({
page_id = "a2834fde-1234-5678-abcd-1234567890ab",
payload = {
conversion = true,
visitor_id = "visitor-123",
form_submission = {
variant_id = "a",
submitter_ip = "127.0.0.1",
form_data = {
email = "lead@example.test",
first_name = "Ada"
}
}
}
})
```
Lead deletion requests are asynchronous:
```lua
local request = app.integrations.unbounce.create_lead_deletion_request({
page_id = "a2834fde-1234-5678-abcd-1234567890ab",
payload = { lead_ids = { "b3945gef-2345-6789-bcde-2345678901bc" } }
})
local status = app.integrations.unbounce.get_lead_deletion_request({
page_id = "a2834fde-1234-5678-abcd-1234567890ab",
lead_deletion_request_id = request.id
})
```
## Domains And Page Groups
```lua
local domains = app.integrations.unbounce.list_domains({
sub_account_id = "1552433"
})
local domain_pages = app.integrations.unbounce.list_domain_pages({
domain_id = "domain-123"
})
local groups = app.integrations.unbounce.list_page_groups({
sub_account_id = "1552433"
})
local group_pages = app.integrations.unbounce.list_page_group_pages({
page_group_id = "group-123"
})
```
## Raw API Helpers
Use raw helpers for documented Unbounce endpoints that do not yet have a named
tool. Paths must be relative; full URLs and parent-directory segments are
rejected.
```lua
local raw = app.integrations.unbounce.api_get({
path = "/accounts",
params = { sort_order = "desc" }
})
```
## Multi-Account Usage
```lua
app.integrations.unbounce.list_pages({})
app.integrations.unbounce.client_a.list_pages({})
``` local result = app.integrations.unbounce.get_api_metadata({})
print(result) Functions
get_api_metadata Read
Retrieve Unbounce API root metadata and related resource links.
- Lua path
app.integrations.unbounce.get_api_metadata- Full name
unbounce.unbounce_get_api_metadata
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_accounts Read
List Unbounce accounts available to the authenticated token.
- Lua path
app.integrations.unbounce.list_accounts- Full name
unbounce.unbounce_list_accounts
| Parameter | Type | Required | Description |
|---|---|---|---|
params | object | no | Query parameters such as sort_order. |
get_account Read
Get one Unbounce account by ID.
- Lua path
app.integrations.unbounce.get_account- Full name
unbounce.unbounce_get_account
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | string | yes | Unbounce account ID. |
list_sub_accounts Read
List sub-accounts in Unbounce. Sub-accounts group pages and are useful for organizing landing pages by client, brand, or campaign.
- Lua path
app.integrations.unbounce.list_sub_accounts- Full name
unbounce.unbounce_list_sub_accounts
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | string | no | Optional account ID for the official /accounts/{account_id}/sub_accounts endpoint. |
limit | integer | no | Maximum number of sub-accounts to return (default: 50, max: 1000). |
offset | integer | no | Offset for pagination (default: 0). |
get_sub_account Read
Get one Unbounce sub-account by ID.
- Lua path
app.integrations.unbounce.get_sub_account- Full name
unbounce.unbounce_get_sub_account
| Parameter | Type | Required | Description |
|---|---|---|---|
sub_account_id | string | yes | Sub-account ID. |
list_pages Read
List landing pages in Unbounce. Returns page IDs, names, URLs, and metadata. Use this to discover available pages before querying leads or page details.
- Lua path
app.integrations.unbounce.list_pages- Full name
unbounce.unbounce_list_pages
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of pages to return (default: 50, max: 1000). |
offset | integer | no | Offset for pagination (default: 0). |
sort | string | no | Sort order. Prefix with "-" for descending (e.g., "created_at", "-created_at"). |
list_account_pages Read
List landing pages for a specific Unbounce account.
- Lua path
app.integrations.unbounce.list_account_pages- Full name
unbounce.unbounce_list_account_pages
| Parameter | Type | Required | Description |
|---|---|---|---|
account_id | string | yes | Account ID. |
params | object | no | Query parameters. |
list_sub_account_pages Read
List landing pages for a specific Unbounce sub-account.
- Lua path
app.integrations.unbounce.list_sub_account_pages- Full name
unbounce.unbounce_list_sub_account_pages
| Parameter | Type | Required | Description |
|---|---|---|---|
sub_account_id | string | yes | Sub-account ID. |
params | object | no | Query parameters. |
get_page Read
Get details of a specific Unbounce landing page by its ID. Returns the page name, URL, variants, conversion rates, and other metadata.
- Lua path
app.integrations.unbounce.get_page- Full name
unbounce.unbounce_get_page
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id | string | yes | The Unbounce page ID (e.g., "a2834fde-1234-5678-abcd-1234567890ab"). |
list_page_form_fields Read
List form fields for an Unbounce page.
- Lua path
app.integrations.unbounce.list_page_form_fields- Full name
unbounce.unbounce_list_page_form_fields
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id | string | yes | Page ID. |
list_leads Read
List form submissions (leads) for a specific Unbounce landing page. Returns lead data including form field values, submission timestamps, and conversion details.
- Lua path
app.integrations.unbounce.list_leads- Full name
unbounce.unbounce_list_leads
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id | string | yes | The Unbounce page ID to list leads for. |
limit | integer | no | Maximum number of leads to return (default: 50, max: 1000). |
offset | integer | no | Offset for pagination (default: 0). |
get_lead Read
Get details of a specific Unbounce lead (form submission) by its ID. Returns all submitted form field values, metadata, and conversion information.
- Lua path
app.integrations.unbounce.get_lead- Full name
unbounce.unbounce_get_lead
| Parameter | Type | Required | Description |
|---|---|---|---|
lead_id | string | yes | The Unbounce lead ID. |
create_lead Write
Create a lead for an Unbounce page using the official lead payload.
- Lua path
app.integrations.unbounce.create_lead- Full name
unbounce.unbounce_create_lead
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id | string | yes | Page ID. |
payload | object | yes | Lead creation payload including form_submission. |
create_lead_deletion_request Write
Create a lead deletion request for an Unbounce page.
- Lua path
app.integrations.unbounce.create_lead_deletion_request- Full name
unbounce.unbounce_create_lead_deletion_request
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id | string | yes | Page ID. |
payload | object | yes | Lead deletion request payload. |
get_lead_deletion_request Read
Get a lead deletion request by page and request ID.
- Lua path
app.integrations.unbounce.get_lead_deletion_request- Full name
unbounce.unbounce_get_lead_deletion_request
| Parameter | Type | Required | Description |
|---|---|---|---|
page_id | string | yes | Page ID. |
lead_deletion_request_id | string | yes | Lead deletion request ID. |
list_domains Read
List domains for an Unbounce sub-account.
- Lua path
app.integrations.unbounce.list_domains- Full name
unbounce.unbounce_list_domains
| Parameter | Type | Required | Description |
|---|---|---|---|
sub_account_id | string | yes | Sub-account ID. |
params | object | no | Query parameters. |
get_domain Read
Get one Unbounce domain by ID.
- Lua path
app.integrations.unbounce.get_domain- Full name
unbounce.unbounce_get_domain
| Parameter | Type | Required | Description |
|---|---|---|---|
domain_id | string | yes | Domain ID. |
list_domain_pages Read
List pages published on an Unbounce domain.
- Lua path
app.integrations.unbounce.list_domain_pages- Full name
unbounce.unbounce_list_domain_pages
| Parameter | Type | Required | Description |
|---|---|---|---|
domain_id | string | yes | Domain ID. |
params | object | no | Query parameters. |
list_page_groups Read
List page groups for an Unbounce sub-account.
- Lua path
app.integrations.unbounce.list_page_groups- Full name
unbounce.unbounce_list_page_groups
| Parameter | Type | Required | Description |
|---|---|---|---|
sub_account_id | string | yes | Sub-account ID. |
params | object | no | Query parameters. |
get_page_group Read
Get one Unbounce page group by ID.
- Lua path
app.integrations.unbounce.get_page_group- Full name
unbounce.unbounce_get_page_group
| Parameter | Type | Required | Description |
|---|---|---|---|
page_group_id | string | yes | Page group ID. |
list_page_group_pages Read
List pages in an Unbounce page group.
- Lua path
app.integrations.unbounce.list_page_group_pages- Full name
unbounce.unbounce_list_page_group_pages
| Parameter | Type | Required | Description |
|---|---|---|---|
page_group_id | string | yes | Page group ID. |
params | object | no | Query parameters. |
get_current_user Read
Get the currently authenticated Unbounce user profile. Returns account name, email, and other account details.
- Lua path
app.integrations.unbounce.get_current_user- Full name
unbounce.unbounce_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_get Read
Call a safe relative Unbounce API path with GET.
- Lua path
app.integrations.unbounce.api_get- Full name
unbounce.unbounce_api_get
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path. |
params | object | no | Query parameters. |
api_post Write
Call a safe relative Unbounce API path with POST.
- Lua path
app.integrations.unbounce.api_post- Full name
unbounce.unbounce_api_post
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path. |
payload | object | no | JSON request body. |
params | object | no | Query parameters. |
api_delete Write
Call a safe relative Unbounce API path with DELETE.
- Lua path
app.integrations.unbounce.api_delete- Full name
unbounce.unbounce_api_delete
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Relative API path. |
params | object | no | Query parameters. |