KosmoKrator

database

Baserow Lua API for KosmoKrator Agents

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

7 functions 4 read 3 write Bearer token auth

Lua Namespace

Agents call this integration through app.integrations.baserow.*. Use lua_read_doc("integrations.baserow") 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.

Baserow — Lua API Reference

list_tables

List rows in a Baserow database table with pagination and optional filtering.

Parameters

NameTypeRequiredDescription
table_idintegeryesThe Baserow table ID to list rows from
pageintegernoPage number (1-based). Defaults to 1.
sizeintegernoNumber of rows per page. Defaults to 100.
filtersobjectnoOptional Baserow filter parameters

Filter Parameters

Filters are passed as a key-value object. Common filter keys:

KeyDescription
searchFull-text search across all fields
filter__field_{id}__equalField equals value
filter__field_{id}__containsField contains value
filter__field_{id}__contains_notField does not contain value
filter__field_{id}__higher_thanField value is higher than
filter__field_{id}__lower_thanField value is lower than
filter__field_{id}__emptyField is empty (set to “true”)
filter__field_{id}__not_emptyField is not empty (set to “true”)
filter_type"AND" (default) or "OR" for combining filters

Examples

-- List first page of rows from table 42
local result = app.integrations.baserow.list_tables({
  table_id = 42
})

-- Paginated results
local result = app.integrations.baserow.list_tables({
  table_id = 42,
  page = 2,
  size = 50
})

-- Search rows
local result = app.integrations.baserow.list_tables({
  table_id = 42,
  filters = { search = "John" }
})

-- Filter by specific field value
local result = app.integrations.baserow.list_tables({
  table_id = 42,
  filters = {
    filter__field_123__equal = "Active"
  }
})

get_row

Get a single row from a Baserow database table by its row ID.

Parameters

NameTypeRequiredDescription
table_idintegeryesThe Baserow table ID
row_idintegeryesThe ID of the row to retrieve

Example

local row = app.integrations.baserow.get_row({
  table_id = 42,
  row_id = 1
})

print(row.id, row.Name, row.Email)

create_row

Create a new row in a Baserow database table.

Parameters

NameTypeRequiredDescription
table_idintegeryesThe Baserow table ID
dataobjectyesRow data with field names as keys

Example

local row = app.integrations.baserow.create_row({
  table_id = 42,
  data = {
    Name = "John Doe",
    Email = "[email protected]",
    Status = "Active",
    Notes = "New customer"
  }
})

print("Created row with ID: " .. row.id)

update_row

Update fields of an existing row in a Baserow database table.

Parameters

NameTypeRequiredDescription
table_idintegeryesThe Baserow table ID
row_idintegeryesThe ID of the row to update
dataobjectyesUpdated field data (only specified fields are changed)

Example

local row = app.integrations.baserow.update_row({
  table_id = 42,
  row_id = 1,
  data = {
    Status = "Inactive",
    Notes = "Customer churned"
  }
})

print("Updated row: " .. row.id)

delete_row

Delete a row from a Baserow database table. This action is permanent.

Parameters

NameTypeRequiredDescription
table_idintegeryesThe Baserow table ID
row_idintegeryesThe ID of the row to delete

Example

app.integrations.baserow.delete_row({
  table_id = 42,
  row_id = 1
})

list_databases

List all databases (applications) in the Baserow workspace.

Parameters

NameTypeRequiredDescription
pageintegernoPage number (1-based). Defaults to 1.
sizeintegernoNumber of results per page. Defaults to 100.

Example

local result = app.integrations.baserow.list_databases()

for _, db in ipairs(result) do
  print(db.id, db.name, db.type)
end

get_current_user

Get the currently authenticated Baserow user profile.

Parameters

None.

Example

local user = app.integrations.baserow.get_current_user()

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

Multi-Account Usage

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

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

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

-- Named accounts
app.integrations.baserow.production.function_name({...})
app.integrations.baserow.staging.function_name({...})

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

Raw agent markdown
# Baserow — Lua API Reference

## list_tables

List rows in a Baserow database table with pagination and optional filtering.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `table_id` | integer | yes | The Baserow table ID to list rows from |
| `page` | integer | no | Page number (1-based). Defaults to 1. |
| `size` | integer | no | Number of rows per page. Defaults to 100. |
| `filters` | object | no | Optional Baserow filter parameters |

### Filter Parameters

Filters are passed as a key-value object. Common filter keys:

| Key | Description |
|-----|-------------|
| `search` | Full-text search across all fields |
| `filter__field_{id}__equal` | Field equals value |
| `filter__field_{id}__contains` | Field contains value |
| `filter__field_{id}__contains_not` | Field does not contain value |
| `filter__field_{id}__higher_than` | Field value is higher than |
| `filter__field_{id}__lower_than` | Field value is lower than |
| `filter__field_{id}__empty` | Field is empty (set to "true") |
| `filter__field_{id}__not_empty` | Field is not empty (set to "true") |
| `filter_type` | `"AND"` (default) or `"OR"` for combining filters |

### Examples

```lua
-- List first page of rows from table 42
local result = app.integrations.baserow.list_tables({
  table_id = 42
})

-- Paginated results
local result = app.integrations.baserow.list_tables({
  table_id = 42,
  page = 2,
  size = 50
})

-- Search rows
local result = app.integrations.baserow.list_tables({
  table_id = 42,
  filters = { search = "John" }
})

-- Filter by specific field value
local result = app.integrations.baserow.list_tables({
  table_id = 42,
  filters = {
    filter__field_123__equal = "Active"
  }
})
```

---

## get_row

Get a single row from a Baserow database table by its row ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `table_id` | integer | yes | The Baserow table ID |
| `row_id` | integer | yes | The ID of the row to retrieve |

### Example

```lua
local row = app.integrations.baserow.get_row({
  table_id = 42,
  row_id = 1
})

print(row.id, row.Name, row.Email)
```

---

## create_row

Create a new row in a Baserow database table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `table_id` | integer | yes | The Baserow table ID |
| `data` | object | yes | Row data with field names as keys |

### Example

```lua
local row = app.integrations.baserow.create_row({
  table_id = 42,
  data = {
    Name = "John Doe",
    Email = "[email protected]",
    Status = "Active",
    Notes = "New customer"
  }
})

print("Created row with ID: " .. row.id)
```

---

## update_row

Update fields of an existing row in a Baserow database table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `table_id` | integer | yes | The Baserow table ID |
| `row_id` | integer | yes | The ID of the row to update |
| `data` | object | yes | Updated field data (only specified fields are changed) |

### Example

```lua
local row = app.integrations.baserow.update_row({
  table_id = 42,
  row_id = 1,
  data = {
    Status = "Inactive",
    Notes = "Customer churned"
  }
})

print("Updated row: " .. row.id)
```

---

## delete_row

Delete a row from a Baserow database table. This action is permanent.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `table_id` | integer | yes | The Baserow table ID |
| `row_id` | integer | yes | The ID of the row to delete |

### Example

```lua
app.integrations.baserow.delete_row({
  table_id = 42,
  row_id = 1
})
```

---

## list_databases

List all databases (applications) in the Baserow workspace.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `page` | integer | no | Page number (1-based). Defaults to 1. |
| `size` | integer | no | Number of results per page. Defaults to 100. |

### Example

```lua
local result = app.integrations.baserow.list_databases()

for _, db in ipairs(result) do
  print(db.id, db.name, db.type)
end
```

---

## get_current_user

Get the currently authenticated Baserow user profile.

### Parameters

None.

### Example

```lua
local user = app.integrations.baserow.get_current_user()

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

---

## Multi-Account Usage

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

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

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

-- Named accounts
app.integrations.baserow.production.function_name({...})
app.integrations.baserow.staging.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.baserow.baserow_create_row({
  table_id = 1,
  data = "example_data"
})
print(result)

Functions

baserow_create_row

Create a new row in a Baserow database table. Provide field data as a JSON object mapping field names to values.

Operation
Write write
Full name
baserow.baserow_create_row
ParameterTypeRequiredDescription
table_id integer yes The Baserow table ID to create the row in.
data object yes Row data as a JSON object with field names (or field IDs) as keys and their values. Example: {"Name": "John", "Email": "[email protected]"}.

baserow_delete_row

Delete a row from a Baserow database table. This action is permanent and cannot be undone.

Operation
Write write
Full name
baserow.baserow_delete_row
ParameterTypeRequiredDescription
table_id integer yes The Baserow table ID.
row_id integer yes The ID of the row to delete.

baserow_get_current_user

Get the currently authenticated Baserow user profile. Returns user details including name, email, and workspace memberships.

Operation
Read read
Full name
baserow.baserow_get_current_user
ParameterTypeRequiredDescription
No parameters.

baserow_get_row

Get a single row from a Baserow database table by its row ID. Returns all field values for the row.

Operation
Read read
Full name
baserow.baserow_get_row
ParameterTypeRequiredDescription
table_id integer yes The Baserow table ID.
row_id integer yes The ID of the row to retrieve.

baserow_list_databases

List all databases (applications) in the Baserow workspace. Returns database names, IDs, and types for navigation.

Operation
Read read
Full name
baserow.baserow_list_databases
ParameterTypeRequiredDescription
page integer no Page number (1-based). Defaults to 1.
size integer no Number of databases per page. Defaults to 100.

baserow_list_tables

List rows in a Baserow database table. Supports pagination and optional filters to narrow results by field values.

Operation
Read read
Full name
baserow.baserow_list_tables
ParameterTypeRequiredDescription
table_id integer yes The Baserow table ID to list rows from.
page integer no Page number (1-based). Defaults to 1.
size integer no Number of rows per page. Defaults to 100.
filters object no Optional Baserow filter parameters as key-value pairs (e.g., {"search": "term"}, {"filter__field_1__equal": "value"}).

baserow_update_row

Update an existing row in a Baserow database table. Provide field data as a JSON object with field names and new values. Only specified fields are updated.

Operation
Write write
Full name
baserow.baserow_update_row
ParameterTypeRequiredDescription
table_id integer yes The Baserow table ID.
row_id integer yes The ID of the row to update.
data object yes Updated field data as a JSON object with field names (or field IDs) as keys and their new values. Example: {"Name": "Jane", "Status": "Active"}.