KosmoKrator

database

QuickBase Lua API for KosmoKrator Agents

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

6 functions 5 read 1 write Bearer token auth

Lua Namespace

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

QuickBase — Lua API Reference

list_tables

List all tables in a QuickBase application.

Parameters

NameTypeRequiredDescription
appIdstringyesThe application ID (dbid) to list tables for

Example

local result = app.integrations.quickbase.list_tables({
  appId = "bqxxx"
})

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

get_table

Get details for a specific QuickBase table.

Parameters

NameTypeRequiredDescription
tableIdstringyesThe table ID (dbid) to retrieve

Example

local result = app.integrations.quickbase.get_table({
  tableId = "bqxxx"
})

print("Table: " .. result.name)
print("Fields:")
for _, field in ipairs(result.fields or {}) do
  print("  " .. field.id .. " - " .. field.label .. " (" .. field.fieldType .. ")")
end

list_records

Query records from a QuickBase table with filters, field selection, sorting, and pagination.

Parameters

NameTypeRequiredDescription
tableIdstringyesThe table ID (dbid) to query
wherestringnoFilter expression in QuickBase query syntax
selectarraynoArray of field IDs to include in the response
sortByarraynoSort specification: [{fieldId: 3, order: "ASC"}]
groupByarraynoGrouping specification: [{fieldId: 3, grouping: "equal-values"}]
optionsobjectnoAdditional options: {skip: 0, top: 100, includeRids: true}

QuickBase Query Syntax

The where parameter uses QuickBase’s query string format:

{fieldId.operator.'value'}

Common operators:

OperatorMeaning
EXEquals
NENot equal
GTGreater than
GTEGreater than or equal
LTLess than
LTELess than or equal
CTContains
SWStarts with
XEXDoes not equal
XCTDoes not contain

Combine conditions with:

  • AND — both conditions must match
  • OR — either condition matches

Example: {6.CT.'urgent'}AND{7.GT.100}

Examples

Get all records (first 100)

local result = app.integrations.quickbase.list_records({
  tableId = "bqxxx",
  options = { skip = 0, top = 100 }
})

Filter records with a condition

local result = app.integrations.quickbase.list_records({
  tableId = "bqxxx",
  where = "{6.EX.'Complete'}",
  select = {3, 6, 7, 8}
})

for _, record in ipairs(result.data or {}) do
  for _, field in ipairs(record) do
    print("Field " .. field.id .. ": " .. tostring(field.value))
  end
end

Sorted and paginated

local result = app.integrations.quickbase.list_records({
  tableId = "bqxxx",
  sortBy = {{fieldId = 3, order = "DESC"}},
  options = { skip = 0, top = 50 }
})

get_record

Get a single QuickBase record by its record ID.

Parameters

NameTypeRequiredDescription
tableIdstringyesThe table ID (dbid)
recordIdintegeryesThe record ID to retrieve

Example

local result = app.integrations.quickbase.get_record({
  tableId = "bqxxx",
  recordId = 42
})

for _, field in ipairs(result.data or {}) do
  print("Field " .. field.id .. ": " .. tostring(field.value))
end

create_record

Create a new record in a QuickBase table.

Parameters

NameTypeRequiredDescription
tableIdstringyesThe table ID (dbid) to create the record in
fieldsarrayyesArray of field data: [{fieldId: 6, value: "New value"}, ...]

Example

local result = app.integrations.quickbase.create_record({
  tableId = "bqxxx",
  fields = {
    {fieldId = 6, value = "New Project"},
    {fieldId = 7, value = 42},
    {fieldId = 8, value = "2025-06-01"}
  }
})

print("Created record ID: " .. tostring(result.metadata.createdRecordIds[1]))

get_current_user

Get the currently authenticated QuickBase user.

Parameters

None.

Example

local result = app.integrations.quickbase.get_current_user({})

print("User: " .. (result.firstName or "") .. " " .. (result.lastName or ""))
print("Email: " .. (result.email or ""))
print("ID: " .. (result.id or ""))

Multi-Account Usage

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

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

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

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

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

Raw agent markdown
# QuickBase — Lua API Reference

## list_tables

List all tables in a QuickBase application.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `appId` | string | yes | The application ID (dbid) to list tables for |

### Example

```lua
local result = app.integrations.quickbase.list_tables({
  appId = "bqxxx"
})

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

---

## get_table

Get details for a specific QuickBase table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tableId` | string | yes | The table ID (dbid) to retrieve |

### Example

```lua
local result = app.integrations.quickbase.get_table({
  tableId = "bqxxx"
})

print("Table: " .. result.name)
print("Fields:")
for _, field in ipairs(result.fields or {}) do
  print("  " .. field.id .. " - " .. field.label .. " (" .. field.fieldType .. ")")
end
```

---

## list_records

Query records from a QuickBase table with filters, field selection, sorting, and pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tableId` | string | yes | The table ID (dbid) to query |
| `where` | string | no | Filter expression in QuickBase query syntax |
| `select` | array | no | Array of field IDs to include in the response |
| `sortBy` | array | no | Sort specification: `[{fieldId: 3, order: "ASC"}]` |
| `groupBy` | array | no | Grouping specification: `[{fieldId: 3, grouping: "equal-values"}]` |
| `options` | object | no | Additional options: `{skip: 0, top: 100, includeRids: true}` |

### QuickBase Query Syntax

The `where` parameter uses QuickBase's query string format:

```
{fieldId.operator.'value'}
```

**Common operators:**

| Operator | Meaning |
|----------|---------|
| `EX` | Equals |
| `NE` | Not equal |
| `GT` | Greater than |
| `GTE` | Greater than or equal |
| `LT` | Less than |
| `LTE` | Less than or equal |
| `CT` | Contains |
| `SW` | Starts with |
| `XEX` | Does not equal |
| `XCT` | Does not contain |

**Combine conditions with:**
- `AND` — both conditions must match
- `OR` — either condition matches

**Example:** `{6.CT.'urgent'}AND{7.GT.100}`

### Examples

#### Get all records (first 100)

```lua
local result = app.integrations.quickbase.list_records({
  tableId = "bqxxx",
  options = { skip = 0, top = 100 }
})
```

#### Filter records with a condition

```lua
local result = app.integrations.quickbase.list_records({
  tableId = "bqxxx",
  where = "{6.EX.'Complete'}",
  select = {3, 6, 7, 8}
})

for _, record in ipairs(result.data or {}) do
  for _, field in ipairs(record) do
    print("Field " .. field.id .. ": " .. tostring(field.value))
  end
end
```

#### Sorted and paginated

```lua
local result = app.integrations.quickbase.list_records({
  tableId = "bqxxx",
  sortBy = {{fieldId = 3, order = "DESC"}},
  options = { skip = 0, top = 50 }
})
```

---

## get_record

Get a single QuickBase record by its record ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tableId` | string | yes | The table ID (dbid) |
| `recordId` | integer | yes | The record ID to retrieve |

### Example

```lua
local result = app.integrations.quickbase.get_record({
  tableId = "bqxxx",
  recordId = 42
})

for _, field in ipairs(result.data or {}) do
  print("Field " .. field.id .. ": " .. tostring(field.value))
end
```

---

## create_record

Create a new record in a QuickBase table.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `tableId` | string | yes | The table ID (dbid) to create the record in |
| `fields` | array | yes | Array of field data: `[{fieldId: 6, value: "New value"}, ...]` |

### Example

```lua
local result = app.integrations.quickbase.create_record({
  tableId = "bqxxx",
  fields = {
    {fieldId = 6, value = "New Project"},
    {fieldId = 7, value = 42},
    {fieldId = 8, value = "2025-06-01"}
  }
})

print("Created record ID: " .. tostring(result.metadata.createdRecordIds[1]))
```

---

## get_current_user

Get the currently authenticated QuickBase user.

### Parameters

None.

### Example

```lua
local result = app.integrations.quickbase.get_current_user({})

print("User: " .. (result.firstName or "") .. " " .. (result.lastName or ""))
print("Email: " .. (result.email or ""))
print("ID: " .. (result.id or ""))
```

---

## Multi-Account Usage

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

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

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

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

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

Metadata-Derived Lua Example

local result = app.integrations.quickbase.quickbase_list_tables({
  appId = "example_appId"
})
print(result)

Functions

quickbase_list_tables

List all tables in a QuickBase application. Returns table IDs, names, and metadata for each table in the specified app.

Operation
Read read
Full name
quickbase.quickbase_list_tables
ParameterTypeRequiredDescription
appId string yes The application ID (dbid) to list tables for.

quickbase_get_table

Get details for a specific QuickBase table, including its name, ID, and field definitions.

Operation
Read read
Full name
quickbase.quickbase_get_table
ParameterTypeRequiredDescription
tableId string yes The table ID (dbid) to retrieve details for.

quickbase_list_records

Query records from a QuickBase table. Supports filtering by conditions, selecting specific fields, sorting, grouping, and pagination. Use the where clause to filter records (QuickBase query syntax).

Operation
Read read
Full name
quickbase.quickbase_list_records
ParameterTypeRequiredDescription
tableId string yes The table ID (dbid) to query records from.
where string no Filter expression in QuickBase query syntax, e.g. '{3.EX.'Complete'}'. Omit to return all records.
select array no Array of field IDs to include in the response. Omit to return all fields.
sortBy array no Sort specification: [{fieldId: 3, order: "ASC"}, ...].
groupBy array no Grouping specification: [{fieldId: 3, grouping: "equal-values"}, ...].
options object no Additional query options: {skip: 0, top: 100, compareWith: "yesterday", includeRids: true}.

quickbase_get_record

Get a single QuickBase record by its record ID. Returns all field values for the specified record.

Operation
Read read
Full name
quickbase.quickbase_get_record
ParameterTypeRequiredDescription
tableId string yes The table ID (dbid) the record belongs to.
recordId integer yes The record ID to retrieve.

quickbase_create_record

Create a new record in a QuickBase table. Provide field data as an array of {fieldId, value} pairs.

Operation
Write write
Full name
quickbase.quickbase_create_record
ParameterTypeRequiredDescription
tableId string yes The table ID (dbid) to create the record in.
fields array yes Array of field data objects: [{fieldId: 6, value: "New value"}, {fieldId: 7, value: 42}, ...]. Each object must have a fieldId (integer) and value (mixed).

quickbase_get_current_user

Get the currently authenticated QuickBase user. Returns user profile information including name, email, and user ID.

Operation
Read read
Full name
quickbase.quickbase_get_current_user
ParameterTypeRequiredDescription
No parameters.