KosmoKrator

productivity

Coda Lua API for KosmoKrator Agents

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

12 functions 9 read 3 write API token auth

Lua Namespace

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

Coda — Lua API Reference

coda_list_docs

List Coda docs accessible to the authenticated user.

Parameters

NameTypeRequiredDescription
querystringnoSearch query to filter docs by name.
isOwnerbooleannoIf true, only return docs owned by the user.
limitintegernoMaximum number of docs to return (default: 20, max: 100).

Example

local result = app.integrations.coda.list_docs({
  query = "project",
  limit = 10
})

for _, doc in ipairs(result.items) do
  print(doc.name .. " — " .. doc.id)
end

coda_get_doc

Get details of a specific Coda doc.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.

Example

local doc = app.integrations.coda.get_doc({
  doc_id = "abc123"
})
print(doc.name .. " — " .. doc.owner .. " — " .. doc.ownerName)

coda_list_tables

List tables in a Coda doc.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
limitintegernoMaximum number of tables to return (default: 20, max: 100).

Example

local result = app.integrations.coda.list_tables({
  doc_id = "abc123",
  limit = 50
})

for _, table in ipairs(result.items) do
  print(table.name .. " — " .. table.id .. " (type: " .. table.displayColumn .. ")")
end

coda_get_table

Get details of a specific table in a Coda doc.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
table_idstringyesThe ID or name of the table.

Example

local table = app.integrations.coda.get_table({
  doc_id = "abc123",
  table_id = "grid-MyTable"
})
print(table.name .. " — columns: " .. table.columnCount)

coda_list_rows

List rows in a Coda table.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
table_idstringyesThe ID or name of the table.
limitintegernoMaximum number of rows to return (default: 20, max: 1000).
useColumnNamesbooleannoReturn values keyed by column names instead of column IDs (default: true).

Example

local result = app.integrations.coda.list_rows({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  limit = 50,
  useColumnNames = true
})

for _, row in ipairs(result.items) do
  print(row.name .. ": " .. row.values["Status"])
end

coda_get_row

Get a single row from a Coda table.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
table_idstringyesThe ID or name of the table.
row_idstringyesThe ID of the row.
useColumnNamesbooleannoReturn values keyed by column names (default: true).

Example

local row = app.integrations.coda.get_row({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  row_id = "i-row123"
})
print(row.name)
for col, val in pairs(row.values) do
  print("  " .. col .. " = " .. tostring(val))
end

coda_insert_rows

Insert one or more rows into a Coda table.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
table_idstringyesThe ID or name of the table.
rowsarrayyesArray of row objects. Each row: {cells = {column = "col-name", value = "the-value"}}.

Example

local result = app.integrations.coda.insert_rows({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  rows = {
    {
      cells = {
        {column = "Name", value = "Alice"},
        {column = "Email", value = "[email protected]"},
        {column = "Status", value = "Active"}
      }
    },
    {
      cells = {
        {column = "Name", value = "Bob"},
        {column = "Email", value = "[email protected]"},
        {column = "Status", value = "Pending"}
      }
    }
  }
})
print("Request ID: " .. result.requestId)

coda_update_row

Update cells in an existing row.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
table_idstringyesThe ID or name of the table.
row_idstringyesThe ID of the row to update.
cellsarrayyesArray of cell objects: {column = "col-name", value = "new-value"}.

Example

local result = app.integrations.coda.update_row({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  row_id = "i-row123",
  cells = {
    {column = "Status", value = "Completed"},
    {column = "Completed At", value = "2026-04-05"}
  }
})
print("Request ID: " .. result.requestId)

coda_delete_row

Delete a row from a Coda table.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
table_idstringyesThe ID or name of the table.
row_idstringyesThe ID of the row to delete.

Example

local result = app.integrations.coda.delete_row({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  row_id = "i-row123"
})
print(result)

coda_list_columns

List columns in a Coda table.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
table_idstringyesThe ID or name of the table.
limitintegernoMaximum number of columns to return (default: 20, max: 100).

Example

local result = app.integrations.coda.list_columns({
  doc_id = "abc123",
  table_id = "grid-MyTable"
})

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

coda_list_pages

List pages in a Coda doc.

Parameters

NameTypeRequiredDescription
doc_idstringyesThe ID of the doc.
limitintegernoMaximum number of pages to return (default: 20, max: 100).

Example

local result = app.integrations.coda.list_pages({
  doc_id = "abc123",
  limit = 50
})

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

coda_get_current_user

Verify authentication and get current user info.

Parameters

None.

Example

local user = app.integrations.coda.get_current_user({})
print("Connected as: " .. user.name .. " (" .. user.loginId .. ")")

Multi-Account Usage

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

-- Default account (always works)
app.integrations.coda.list_docs({})

-- Explicit default (portable across setups)
app.integrations.coda.default.list_docs({})

-- Named accounts
app.integrations.coda.work.list_docs({})
app.integrations.coda.personal.list_docs({})

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

Raw agent markdown
# Coda — Lua API Reference

## coda_list_docs

List Coda docs accessible to the authenticated user.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `query` | string | no | Search query to filter docs by name. |
| `isOwner` | boolean | no | If true, only return docs owned by the user. |
| `limit` | integer | no | Maximum number of docs to return (default: 20, max: 100). |

### Example

```lua
local result = app.integrations.coda.list_docs({
  query = "project",
  limit = 10
})

for _, doc in ipairs(result.items) do
  print(doc.name .. " — " .. doc.id)
end
```

---

## coda_get_doc

Get details of a specific Coda doc.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |

### Example

```lua
local doc = app.integrations.coda.get_doc({
  doc_id = "abc123"
})
print(doc.name .. " — " .. doc.owner .. " — " .. doc.ownerName)
```

---

## coda_list_tables

List tables in a Coda doc.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `limit` | integer | no | Maximum number of tables to return (default: 20, max: 100). |

### Example

```lua
local result = app.integrations.coda.list_tables({
  doc_id = "abc123",
  limit = 50
})

for _, table in ipairs(result.items) do
  print(table.name .. " — " .. table.id .. " (type: " .. table.displayColumn .. ")")
end
```

---

## coda_get_table

Get details of a specific table in a Coda doc.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `table_id` | string | yes | The ID or name of the table. |

### Example

```lua
local table = app.integrations.coda.get_table({
  doc_id = "abc123",
  table_id = "grid-MyTable"
})
print(table.name .. " — columns: " .. table.columnCount)
```

---

## coda_list_rows

List rows in a Coda table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `table_id` | string | yes | The ID or name of the table. |
| `limit` | integer | no | Maximum number of rows to return (default: 20, max: 1000). |
| `useColumnNames` | boolean | no | Return values keyed by column names instead of column IDs (default: true). |

### Example

```lua
local result = app.integrations.coda.list_rows({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  limit = 50,
  useColumnNames = true
})

for _, row in ipairs(result.items) do
  print(row.name .. ": " .. row.values["Status"])
end
```

---

## coda_get_row

Get a single row from a Coda table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `table_id` | string | yes | The ID or name of the table. |
| `row_id` | string | yes | The ID of the row. |
| `useColumnNames` | boolean | no | Return values keyed by column names (default: true). |

### Example

```lua
local row = app.integrations.coda.get_row({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  row_id = "i-row123"
})
print(row.name)
for col, val in pairs(row.values) do
  print("  " .. col .. " = " .. tostring(val))
end
```

---

## coda_insert_rows

Insert one or more rows into a Coda table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `table_id` | string | yes | The ID or name of the table. |
| `rows` | array | yes | Array of row objects. Each row: `{cells = {column = "col-name", value = "the-value"}}`. |

### Example

```lua
local result = app.integrations.coda.insert_rows({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  rows = {
    {
      cells = {
        {column = "Name", value = "Alice"},
        {column = "Email", value = "[email protected]"},
        {column = "Status", value = "Active"}
      }
    },
    {
      cells = {
        {column = "Name", value = "Bob"},
        {column = "Email", value = "[email protected]"},
        {column = "Status", value = "Pending"}
      }
    }
  }
})
print("Request ID: " .. result.requestId)
```

---

## coda_update_row

Update cells in an existing row.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `table_id` | string | yes | The ID or name of the table. |
| `row_id` | string | yes | The ID of the row to update. |
| `cells` | array | yes | Array of cell objects: `{column = "col-name", value = "new-value"}`. |

### Example

```lua
local result = app.integrations.coda.update_row({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  row_id = "i-row123",
  cells = {
    {column = "Status", value = "Completed"},
    {column = "Completed At", value = "2026-04-05"}
  }
})
print("Request ID: " .. result.requestId)
```

---

## coda_delete_row

Delete a row from a Coda table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `table_id` | string | yes | The ID or name of the table. |
| `row_id` | string | yes | The ID of the row to delete. |

### Example

```lua
local result = app.integrations.coda.delete_row({
  doc_id = "abc123",
  table_id = "grid-MyTable",
  row_id = "i-row123"
})
print(result)
```

---

## coda_list_columns

List columns in a Coda table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `table_id` | string | yes | The ID or name of the table. |
| `limit` | integer | no | Maximum number of columns to return (default: 20, max: 100). |

### Example

```lua
local result = app.integrations.coda.list_columns({
  doc_id = "abc123",
  table_id = "grid-MyTable"
})

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

---

## coda_list_pages

List pages in a Coda doc.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc_id` | string | yes | The ID of the doc. |
| `limit` | integer | no | Maximum number of pages to return (default: 20, max: 100). |

### Example

```lua
local result = app.integrations.coda.list_pages({
  doc_id = "abc123",
  limit = 50
})

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

---

## coda_get_current_user

Verify authentication and get current user info.

### Parameters

None.

### Example

```lua
local user = app.integrations.coda.get_current_user({})
print("Connected as: " .. user.name .. " (" .. user.loginId .. ")")
```

---

## Multi-Account Usage

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

```lua
-- Default account (always works)
app.integrations.coda.list_docs({})

-- Explicit default (portable across setups)
app.integrations.coda.default.list_docs({})

-- Named accounts
app.integrations.coda.work.list_docs({})
app.integrations.coda.personal.list_docs({})
```

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

Metadata-Derived Lua Example

local result = app.integrations.coda.coda_list_docs({
  query = "example_query",
  isOwner = true,
  limit = 1
})
print(result)

Functions

coda_list_docs

List Coda docs accessible to the authenticated user. Optionally filter by name or ownership.

Operation
Read read
Full name
coda.coda_list_docs
ParameterTypeRequiredDescription
query string no Search query to filter docs by name.
isOwner boolean no If true, only return docs owned by the user.
limit integer no Maximum number of docs to return (default: 20, max: 100).

coda_get_doc

Get details of a specific Coda doc by its ID.

Operation
Read read
Full name
coda.coda_get_doc
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc to retrieve.

coda_list_tables

List tables in a Coda doc. Returns table IDs, names, and display types.

Operation
Read read
Full name
coda.coda_list_tables
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
limit integer no Maximum number of tables to return (default: 20, max: 100).

coda_get_table

Get details of a specific table in a Coda doc, including its columns and display column.

Operation
Read read
Full name
coda.coda_get_table
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
table_id string yes The ID or name of the table.

coda_list_rows

List rows in a Coda table. Use useColumnNames=true to get values keyed by human-readable column names instead of column IDs.

Operation
Read read
Full name
coda.coda_list_rows
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
table_id string yes The ID or name of the table.
limit integer no Maximum number of rows to return (default: 20, max: 1000).
useColumnNames boolean no If true, return values keyed by column names instead of column IDs (default: true).

coda_get_row

Get a single row from a Coda table by its row ID.

Operation
Read read
Full name
coda.coda_get_row
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
table_id string yes The ID or name of the table.
row_id string yes The ID of the row to retrieve.
useColumnNames boolean no If true, return values keyed by column names instead of column IDs (default: true).

coda_insert_rows

Insert one or more new rows into a Coda table. Each row should have a "cells" array with column/value pairs.

Operation
Write write
Full name
coda.coda_insert_rows
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
table_id string yes The ID or name of the table.
rows array yes Array of row objects. Each row should be {"cells": [{"column": "col-name-or-id", "value": "the-value"}]}.

coda_update_row

Update cells in an existing row in a Coda table. Provide a cells array with column/value pairs to update.

Operation
Write write
Full name
coda.coda_update_row
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
table_id string yes The ID or name of the table.
row_id string yes The ID of the row to update.
cells array yes Array of cell objects to update, e.g. [{"column": "col-name-or-id", "value": "new-value"}].

coda_delete_row

Delete a row from a Coda table. This action is permanent.

Operation
Write write
Full name
coda.coda_delete_row
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
table_id string yes The ID or name of the table.
row_id string yes The ID of the row to delete.

coda_list_columns

List columns in a Coda table. Useful to discover column names and types before querying or inserting rows.

Operation
Read read
Full name
coda.coda_list_columns
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
table_id string yes The ID or name of the table.
limit integer no Maximum number of columns to return (default: 20, max: 100).

coda_list_pages

List pages in a Coda doc. Pages can contain text, tables, and other content.

Operation
Read read
Full name
coda.coda_list_pages
ParameterTypeRequiredDescription
doc_id string yes The ID of the doc.
limit integer no Maximum number of pages to return (default: 20, max: 100).

coda_get_current_user

Verify Coda authentication and get the current user's profile information.

Operation
Read read
Full name
coda.coda_get_current_user
ParameterTypeRequiredDescription
No parameters.