productivity
Attio Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Attio KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.attio.*.
Use lua_read_doc("integrations.attio") 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
Attio workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.attio.api_get({}))' --json kosmo integrations:lua --eval 'print(docs.read("attio"))' --json
kosmo integrations:lua --eval 'print(docs.read("attio.api_get"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local attio = app.integrations.attio
local result = attio.api_get({})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.attio, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.attio.default.* or app.integrations.attio.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Attio, 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.
Attio CRM Lua API Reference
Namespace: app.integrations.attio
This integration manages Attio CRM records, objects, attributes, lists, entries, notes, tasks, and webhooks through the Attio REST API. Tools return Attio’s parsed JSON response directly, usually with the primary payload under data.
Raw API Helpers
Use raw helpers for newer or less common Attio endpoints:
| Tool | Method |
|---|---|
api_get | GET |
api_post | POST |
api_patch | PATCH |
api_put | PUT |
api_delete | DELETE |
local result = app.integrations.attio.api_get({
path = "/v2/lists"
})
Records And Objects
| Tool | Purpose |
|---|---|
list_objects | List object definitions |
get_object | Get one object definition |
list_records | Query records for an object |
get_record | Get one record |
create_record | Create a record |
update_record | Update record values |
delete_record | Delete a record |
list_record_entries | List list entries attached to a record |
local companies = app.integrations.attio.list_records({
object_id = "companies",
limit = 25,
filters = { name = "Acme" }
})
local created = app.integrations.attio.create_record({
object_id = "companies",
data = {
name = "Example Corp",
website = "https://example.test"
}
})
local updated = app.integrations.attio.update_record({
object_id = "companies",
record_id = "891dcbfc-9141-415d-9b2a-2238a6cc012d",
values = {
website = "https://example.test"
}
})
Attributes
| Tool | Purpose |
|---|---|
list_attributes | List attributes for an object or list |
get_attribute | Get one attribute |
create_attribute | Create an object or list attribute |
local attrs = app.integrations.attio.list_attributes({
target = "objects",
identifier = "companies"
})
For target, use objects for object attributes or lists for list attributes.
Lists And Entries
| Tool | Purpose |
|---|---|
list_lists | List Attio lists |
get_list | Get one list |
create_list | Create a list |
update_list | Update a list |
list_entries | Query entries in a list |
create_entry | Add a record to a list |
get_entry | Get one list entry |
update_entry | Update entry values |
delete_entry | Delete an entry |
local entries = app.integrations.attio.list_entries({
list_id = "sales-prospects",
limit = 50,
filter = { name = "Ada Lovelace" }
})
local entry = app.integrations.attio.create_entry({
list_id = "sales-prospects",
parent_object = "people",
parent_record_id = "891dcbfc-9141-415d-9b2a-2238a6cc012d",
entry_values = {
status = "In Progress"
}
})
update_entry uses Attio’s PUT endpoint, which overwrites multiselect values.
Notes, Tasks, And Webhooks
| Tool | Purpose |
|---|---|
list_notes | List notes globally or for a record |
create_note | Create a note |
list_tasks | List tasks |
create_task | Create a task |
update_task | Update a task |
delete_task | Delete a task |
list_webhooks | List webhooks |
local notes = app.integrations.attio.list_notes({
parent_object = "people",
parent_record_id = "891dcbfc-9141-415d-9b2a-2238a6cc012d"
})
local task = app.integrations.attio.create_task({
content_plaintext = "Follow up",
deadline_at = "2026-05-15",
linked_records = {
{
target_object_id = "people",
target_record_id = "891dcbfc-9141-415d-9b2a-2238a6cc012d"
}
}
})
Account Context
list_workspaces and get_current_user help confirm which Attio account and workspace the token can access.
If multiple Attio accounts are configured, use account-specific namespaces:
local result = app.integrations.attio.accounts.sales.list_records({
object_id = "companies"
})
Safety Notes
- Use fake examples such as
example.testin generated docs and tests. - Record, entry, and task deletes are destructive.
- Attio create/update payloads usually wrap fields under
data; first-class tools do that wrapping when you pass first-class parameters.
Raw agent markdown
# Attio CRM Lua API Reference
Namespace: `app.integrations.attio`
This integration manages Attio CRM records, objects, attributes, lists, entries, notes, tasks, and webhooks through the Attio REST API. Tools return Attio's parsed JSON response directly, usually with the primary payload under `data`.
## Raw API Helpers
Use raw helpers for newer or less common Attio endpoints:
| Tool | Method |
|------|--------|
| `api_get` | GET |
| `api_post` | POST |
| `api_patch` | PATCH |
| `api_put` | PUT |
| `api_delete` | DELETE |
```lua
local result = app.integrations.attio.api_get({
path = "/v2/lists"
})
```
## Records And Objects
| Tool | Purpose |
|------|---------|
| `list_objects` | List object definitions |
| `get_object` | Get one object definition |
| `list_records` | Query records for an object |
| `get_record` | Get one record |
| `create_record` | Create a record |
| `update_record` | Update record values |
| `delete_record` | Delete a record |
| `list_record_entries` | List list entries attached to a record |
```lua
local companies = app.integrations.attio.list_records({
object_id = "companies",
limit = 25,
filters = { name = "Acme" }
})
local created = app.integrations.attio.create_record({
object_id = "companies",
data = {
name = "Example Corp",
website = "https://example.test"
}
})
local updated = app.integrations.attio.update_record({
object_id = "companies",
record_id = "891dcbfc-9141-415d-9b2a-2238a6cc012d",
values = {
website = "https://example.test"
}
})
```
## Attributes
| Tool | Purpose |
|------|---------|
| `list_attributes` | List attributes for an object or list |
| `get_attribute` | Get one attribute |
| `create_attribute` | Create an object or list attribute |
```lua
local attrs = app.integrations.attio.list_attributes({
target = "objects",
identifier = "companies"
})
```
For `target`, use `objects` for object attributes or `lists` for list attributes.
## Lists And Entries
| Tool | Purpose |
|------|---------|
| `list_lists` | List Attio lists |
| `get_list` | Get one list |
| `create_list` | Create a list |
| `update_list` | Update a list |
| `list_entries` | Query entries in a list |
| `create_entry` | Add a record to a list |
| `get_entry` | Get one list entry |
| `update_entry` | Update entry values |
| `delete_entry` | Delete an entry |
```lua
local entries = app.integrations.attio.list_entries({
list_id = "sales-prospects",
limit = 50,
filter = { name = "Ada Lovelace" }
})
local entry = app.integrations.attio.create_entry({
list_id = "sales-prospects",
parent_object = "people",
parent_record_id = "891dcbfc-9141-415d-9b2a-2238a6cc012d",
entry_values = {
status = "In Progress"
}
})
```
`update_entry` uses Attio's PUT endpoint, which overwrites multiselect values.
## Notes, Tasks, And Webhooks
| Tool | Purpose |
|------|---------|
| `list_notes` | List notes globally or for a record |
| `create_note` | Create a note |
| `list_tasks` | List tasks |
| `create_task` | Create a task |
| `update_task` | Update a task |
| `delete_task` | Delete a task |
| `list_webhooks` | List webhooks |
```lua
local notes = app.integrations.attio.list_notes({
parent_object = "people",
parent_record_id = "891dcbfc-9141-415d-9b2a-2238a6cc012d"
})
local task = app.integrations.attio.create_task({
content_plaintext = "Follow up",
deadline_at = "2026-05-15",
linked_records = {
{
target_object_id = "people",
target_record_id = "891dcbfc-9141-415d-9b2a-2238a6cc012d"
}
}
})
```
## Account Context
`list_workspaces` and `get_current_user` help confirm which Attio account and workspace the token can access.
If multiple Attio accounts are configured, use account-specific namespaces:
```lua
local result = app.integrations.attio.accounts.sales.list_records({
object_id = "companies"
})
```
## Safety Notes
- Use fake examples such as `example.test` in generated docs and tests.
- Record, entry, and task deletes are destructive.
- Attio create/update payloads usually wrap fields under `data`; first-class tools do that wrapping when you pass first-class parameters. local result = app.integrations.attio.api_get({})
print(result) Functions
api_get Read
Call any Attio GET endpoint.
- Lua path
app.integrations.attio.api_get- Full name
attio.attio_api_get
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_post Write
Call any Attio POST endpoint.
- Lua path
app.integrations.attio.api_post- Full name
attio.attio_api_post
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_patch Write
Call any Attio PATCH endpoint.
- Lua path
app.integrations.attio.api_patch- Full name
attio.attio_api_patch
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_put Write
Call any Attio PUT endpoint.
- Lua path
app.integrations.attio.api_put- Full name
attio.attio_api_put
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
api_delete Write
Call any Attio DELETE endpoint.
- Lua path
app.integrations.attio.api_delete- Full name
attio.attio_api_delete
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_workspaces Read
List all Attio workspaces accessible to the authenticated user. Returns workspace IDs and names useful for understanding the context of the current integration.
- Lua path
app.integrations.attio.list_workspaces- Full name
attio.attio_list_workspaces
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_current_user Read
Get the currently authenticated Attio user profile. Useful for verifying API connectivity and identifying which workspace the integration is connected to.
- Lua path
app.integrations.attio.get_current_user- Full name
attio.attio_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_objects Read
List all object types defined in the Attio workspace (e.g. people, companies, deals, custom objects). Useful for discovering available objects before querying records.
- Lua path
app.integrations.attio.list_objects- Full name
attio.attio_list_objects
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_object Read
Get details for a specific object type in Attio, including its attributes and their types. Useful for understanding what fields are available before creating or updating records.
- Lua path
app.integrations.attio.get_object- Full name
attio.attio_get_object
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The object slug or UUID (e.g. "people", "companies", "deals"). |
list_attributes Read
List object or list attributes.
- Lua path
app.integrations.attio.list_attributes- Full name
attio.attio_list_attributes
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_attribute Read
Get an object or list attribute.
- Lua path
app.integrations.attio.get_attribute- Full name
attio.attio_get_attribute
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
create_attribute Write
Create an object or list attribute.
- Lua path
app.integrations.attio.create_attribute- Full name
attio.attio_create_attribute
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_records Read
List records for an object type in Attio (e.g. people, companies, deals). Supports filtering, sorting, and pagination via a POST query endpoint. Use filters to narrow results by attribute values and sorts to control ordering.
- Lua path
app.integrations.attio.list_records- Full name
attio.attio_list_records
| Parameter | Type | Required | Description |
|---|---|---|---|
object_id | string | yes | The object slug or ID (e.g. "people", "companies", "deals"). |
limit | integer | no | Maximum number of records to return (default: 20, max: 500). |
offset | integer | no | Number of records to skip for pagination (default: 0). |
sorts | array | no | Sort definitions. Each entry is an object with "attribute" (object with "slug") and "direction" ("asc" or "desc"). Example: [{"attribute": {"slug": "name"}, "direction": "asc"}]. |
filters | object | no | Filter definitions following Attio's filter grammar. Can be a single filter or a compound filter with "$and"/"$or". Example: {"$and": [{"attribute": {"slug": "name"}, "condition": "contains", "value": "Acme"}]}. |
get_record Read
Get a single record from Attio by its object type and record ID. Returns full record details including all attribute values.
- Lua path
app.integrations.attio.get_record- Full name
attio.attio_get_record
| Parameter | Type | Required | Description |
|---|---|---|---|
object_id | string | yes | The object slug or ID (e.g. "people", "companies", "deals"). |
id | string | yes | The record UUID. |
create_record Write
Create a new record in Attio for a given object type. Pass attribute values keyed by their attribute slug in the data parameter.
- Lua path
app.integrations.attio.create_record- Full name
attio.attio_create_record
| Parameter | Type | Required | Description |
|---|---|---|---|
object_id | string | yes | The object slug or ID (e.g. "people", "companies", "deals"). |
data | object | yes | Record data keyed by attribute slug. Example: {"name": "Acme Corp", "website": "https://acme.com"}. Values depend on the attribute type. |
update_record Write
Update a record for an object type.
- Lua path
app.integrations.attio.update_record- Full name
attio.attio_update_record
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
delete_record Write
Delete a record for an object type.
- Lua path
app.integrations.attio.delete_record- Full name
attio.attio_delete_record
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_record_entries Read
List list entries for a record.
- Lua path
app.integrations.attio.list_record_entries- Full name
attio.attio_list_record_entries
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_lists Read
List Attio lists.
- Lua path
app.integrations.attio.list_lists- Full name
attio.attio_list_lists
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_list Read
Get an Attio list.
- Lua path
app.integrations.attio.get_list- Full name
attio.attio_get_list
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
create_list Write
Create an Attio list.
- Lua path
app.integrations.attio.create_list- Full name
attio.attio_create_list
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
update_list Write
Update an Attio list.
- Lua path
app.integrations.attio.update_list- Full name
attio.attio_update_list
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_entries Read
Query entries in an Attio list.
- Lua path
app.integrations.attio.list_entries- Full name
attio.attio_list_entries
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
create_entry Write
Add a record to an Attio list.
- Lua path
app.integrations.attio.create_entry- Full name
attio.attio_create_entry
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_entry Read
Get an Attio list entry.
- Lua path
app.integrations.attio.get_entry- Full name
attio.attio_get_entry
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
update_entry Write
Update an Attio list entry.
- Lua path
app.integrations.attio.update_entry- Full name
attio.attio_update_entry
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
delete_entry Write
Delete an Attio list entry.
- Lua path
app.integrations.attio.delete_entry- Full name
attio.attio_delete_entry
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_notes Read
List Attio notes.
- Lua path
app.integrations.attio.list_notes- Full name
attio.attio_list_notes
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
create_note Write
Create an Attio note.
- Lua path
app.integrations.attio.create_note- Full name
attio.attio_create_note
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_tasks Read
List Attio tasks.
- Lua path
app.integrations.attio.list_tasks- Full name
attio.attio_list_tasks
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
create_task Write
Create an Attio task.
- Lua path
app.integrations.attio.create_task- Full name
attio.attio_create_task
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
update_task Write
Update an Attio task.
- Lua path
app.integrations.attio.update_task- Full name
attio.attio_update_task
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
delete_task Write
Delete an Attio task.
- Lua path
app.integrations.attio.delete_task- Full name
attio.attio_delete_task
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_webhooks Read
List Attio webhooks.
- Lua path
app.integrations.attio.list_webhooks- Full name
attio.attio_list_webhooks
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||