KosmoKrator

marketing

Unbounce Lua API for KosmoKrator Agents

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

6 functions 6 read 0 write Bearer token auth

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.

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

list_pages

List landing pages in Unbounce.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of pages to return (default: 50, max: 1000).
offsetintegernoOffset for pagination (default: 0).
sortstringnoSort order. Prefix with - for descending (e.g., "created_at", "-created_at").

Example

local result = app.integrations.unbounce.list_pages({
  limit = 20,
  offset = 0,
  sort = "-created_at"
})

for _, page in ipairs(result.pages) do
  print(page.name .. " — " .. page.url)
end

get_page

Get details of a specific landing page.

Parameters

NameTypeRequiredDescription
page_idstringyesThe Unbounce page ID.

Example

local page = app.integrations.unbounce.get_page({
  page_id = "a2834fde-1234-5678-abcd-1234567890ab"
})

print("Page: " .. page.name)
print("URL: " .. page.url)
print("Visitors: " .. page.visitors)
print("Conversions: " .. page.conversions)

list_leads

List form submissions (leads) for a specific page.

Parameters

NameTypeRequiredDescription
page_idstringyesThe Unbounce page ID to list leads for.
limitintegernoMaximum number of leads to return (default: 50, max: 1000).
offsetintegernoOffset for pagination (default: 0).

Example

local result = app.integrations.unbounce.list_leads({
  page_id = "a2834fde-1234-5678-abcd-1234567890ab",
  limit = 25,
  offset = 0
})

for _, lead in ipairs(result.leads) do
  print(lead.form_data.email .. " submitted at " .. lead.created_at)
end

get_lead

Get details of a specific lead (form submission).

Parameters

NameTypeRequiredDescription
lead_idstringyesThe Unbounce lead ID.

Example

local lead = app.integrations.unbounce.get_lead({
  lead_id = "b3945gef-2345-6789-bcde-2345678901bc"
})

print("Email: " .. lead.form_data.email)
print("Name: " .. lead.form_data.first_name .. " " .. lead.form_data.last_name)
print("Submitted: " .. lead.created_at)

list_sub_accounts

List sub-accounts in Unbounce.

Parameters

NameTypeRequiredDescription
limitintegernoMaximum number of sub-accounts to return (default: 50, max: 1000).
offsetintegernoOffset for pagination (default: 0).

Example

local result = app.integrations.unbounce.list_sub_accounts({
  limit = 20
})

for _, account in ipairs(result.sub_accounts) do
  print(account.name .. " (ID: " .. account.id .. ")")
end

get_current_user

Get the currently authenticated Unbounce user profile.

Parameters

None.

Example

local user = app.integrations.unbounce.get_current_user({})

print("Logged in as: " .. user.first_name .. " " .. user.last_name)
print("Email: " .. user.email)

Multi-Account Usage

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

-- Default account (always works)
app.integrations.unbounce.list_pages({})

-- Explicit default (portable across setups)
app.integrations.unbounce.default.list_pages({})

-- Named accounts
app.integrations.unbounce.client_a.list_pages({})
app.integrations.unbounce.client_b.list_pages({})

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

Raw agent markdown
# Unbounce — Lua API Reference

## list_pages

List landing pages in Unbounce.

### Parameters

| Name | 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"`). |

### Example

```lua
local result = app.integrations.unbounce.list_pages({
  limit = 20,
  offset = 0,
  sort = "-created_at"
})

for _, page in ipairs(result.pages) do
  print(page.name .. " — " .. page.url)
end
```

---

## get_page

Get details of a specific landing page.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page_id` | string | yes | The Unbounce page ID. |

### Example

```lua
local page = app.integrations.unbounce.get_page({
  page_id = "a2834fde-1234-5678-abcd-1234567890ab"
})

print("Page: " .. page.name)
print("URL: " .. page.url)
print("Visitors: " .. page.visitors)
print("Conversions: " .. page.conversions)
```

---

## list_leads

List form submissions (leads) for a specific page.

### Parameters

| Name | 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). |

### Example

```lua
local result = app.integrations.unbounce.list_leads({
  page_id = "a2834fde-1234-5678-abcd-1234567890ab",
  limit = 25,
  offset = 0
})

for _, lead in ipairs(result.leads) do
  print(lead.form_data.email .. " submitted at " .. lead.created_at)
end
```

---

## get_lead

Get details of a specific lead (form submission).

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `lead_id` | string | yes | The Unbounce lead ID. |

### Example

```lua
local lead = app.integrations.unbounce.get_lead({
  lead_id = "b3945gef-2345-6789-bcde-2345678901bc"
})

print("Email: " .. lead.form_data.email)
print("Name: " .. lead.form_data.first_name .. " " .. lead.form_data.last_name)
print("Submitted: " .. lead.created_at)
```

---

## list_sub_accounts

List sub-accounts in Unbounce.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `limit` | integer | no | Maximum number of sub-accounts to return (default: 50, max: 1000). |
| `offset` | integer | no | Offset for pagination (default: 0). |

### Example

```lua
local result = app.integrations.unbounce.list_sub_accounts({
  limit = 20
})

for _, account in ipairs(result.sub_accounts) do
  print(account.name .. " (ID: " .. account.id .. ")")
end
```

---

## get_current_user

Get the currently authenticated Unbounce user profile.

### Parameters

None.

### Example

```lua
local user = app.integrations.unbounce.get_current_user({})

print("Logged in as: " .. user.first_name .. " " .. user.last_name)
print("Email: " .. user.email)
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.unbounce.list_pages({})

-- Explicit default (portable across setups)
app.integrations.unbounce.default.list_pages({})

-- Named accounts
app.integrations.unbounce.client_a.list_pages({})
app.integrations.unbounce.client_b.list_pages({})
```

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

Metadata-Derived Lua Example

local result = app.integrations.unbounce.unbounce_list_pages({
  limit = 1,
  offset = 1,
  sort = "example_sort"
})
print(result)

Functions

unbounce_list_pages

List landing pages in Unbounce. Returns page IDs, names, URLs, and metadata. Use this to discover available pages before querying leads or page details.

Operation
Read read
Full name
unbounce.unbounce_list_pages
ParameterTypeRequiredDescription
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").

unbounce_get_page

Get details of a specific Unbounce landing page by its ID. Returns the page name, URL, variants, conversion rates, and other metadata.

Operation
Read read
Full name
unbounce.unbounce_get_page
ParameterTypeRequiredDescription
page_id string yes The Unbounce page ID (e.g., "a2834fde-1234-5678-abcd-1234567890ab").

unbounce_list_leads

List form submissions (leads) for a specific Unbounce landing page. Returns lead data including form field values, submission timestamps, and conversion details.

Operation
Read read
Full name
unbounce.unbounce_list_leads
ParameterTypeRequiredDescription
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).

unbounce_get_lead

Get details of a specific Unbounce lead (form submission) by its ID. Returns all submitted form field values, metadata, and conversion information.

Operation
Read read
Full name
unbounce.unbounce_get_lead
ParameterTypeRequiredDescription
lead_id string yes The Unbounce lead ID.

unbounce_list_sub_accounts

List sub-accounts in Unbounce. Sub-accounts group pages and are useful for organizing landing pages by client, brand, or campaign.

Operation
Read read
Full name
unbounce.unbounce_list_sub_accounts
ParameterTypeRequiredDescription
limit integer no Maximum number of sub-accounts to return (default: 50, max: 1000).
offset integer no Offset for pagination (default: 0).

unbounce_get_current_user

Get the currently authenticated Unbounce user profile. Returns account name, email, and other account details.

Operation
Read read
Full name
unbounce.unbounce_get_current_user
ParameterTypeRequiredDescription
No parameters.