KosmoKrator

sales

Lasso CRM Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write API token auth

Lua Namespace

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

Lasso CRM — Lua API Reference

list_contacts

List contacts (registrants) in Lasso CRM. Supports filtering by project and pagination.

Parameters

NameTypeRequiredDescription
project_idstringnoFilter contacts by project ID
limitintegernoMax results (default: 25)
pageintegernoPage number for pagination

Example

local result = app.integrations.lasso.list_contacts({
  project_id = "proj_abc123",
  limit = 10
})

for _, contact in ipairs(result.contacts) do
  print(contact.id .. ": " .. (contact.first_name or "") .. " " .. (contact.last_name or ""))
end

get_contact

Get full details for a single contact by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe contact ID

Example

local contact = app.integrations.lasso.get_contact({
  id = "contact_abc123"
})

print(contact.first_name .. " " .. contact.last_name)
print("Email: " .. (contact.email or "N/A"))
print("Phone: " .. (contact.phone or "N/A"))

create_contact

Create a new contact (registrant) in Lasso CRM.

Parameters

NameTypeRequiredDescription
first_namestringnoContact first name
last_namestringnoContact last name
emailstringnoPrimary email address
phonestringnoPrimary phone number
project_idstringnoProject ID to associate with
sourcestringnoLead source (e.g., “Website”, “Referral”)
notesstringnoNotes about the contact

At least a first_name or last_name is required.

Example

local contact = app.integrations.lasso.create_contact({
  first_name = "Jane",
  last_name = "Smith",
  email = "[email protected]",
  phone = "+1234567890",
  project_id = "proj_abc123",
  source = "Website"
})

print("Created contact: " .. contact.id)

list_deals

List deals (sales) in Lasso CRM with optional filters.

Parameters

NameTypeRequiredDescription
project_idstringnoFilter deals by project ID
statusstringnoFilter by deal status
limitintegernoMax results (default: 25)
pageintegernoPage number for pagination

Example

local result = app.integrations.lasso.list_deals({
  project_id = "proj_abc123",
  status = "Active",
  limit = 10
})

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

get_deal

Get full details for a single deal by ID.

Parameters

NameTypeRequiredDescription
idstringyesThe deal ID

Example

local deal = app.integrations.lasso.get_deal({
  id = "deal_abc123"
})

print("Deal: " .. (deal.name or deal.id))
print("Price: " .. (deal.price or "N/A"))
print("Status: " .. (deal.status or "N/A"))

list_inventory

List available inventory (units/lots) in Lasso CRM.

Parameters

NameTypeRequiredDescription
project_idstringnoFilter inventory by project ID
statusstringnoFilter by status (e.g., “Available”, “Sold”, “Reserved”)
limitintegernoMax results (default: 25)
pageintegernoPage number for pagination

Example

local result = app.integrations.lasso.list_inventory({
  project_id = "proj_abc123",
  status = "Available",
  limit = 10
})

for _, item in ipairs(result.inventory) do
  print(item.id .. ": " .. (item.name or item.unit_number or item.id))
end

get_current_user

Get the authenticated user’s profile.

Parameters

None.

Example

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

print("Logged in as: " .. (user.first_name or "") .. " " .. (user.last_name or ""))
print("Email: " .. (user.email or "N/A"))

if user.organization then
  print("Organization: " .. (user.organization.name or "N/A"))
end

Multi-Account Usage

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

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

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

-- Named accounts
app.integrations.lasso.downtown_project.function_name({...})
app.integrations.lasso.suburb_project.function_name({...})

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

Raw agent markdown
# Lasso CRM — Lua API Reference

## list_contacts

List contacts (registrants) in Lasso CRM. Supports filtering by project and pagination.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | no | Filter contacts by project ID |
| `limit` | integer | no | Max results (default: 25) |
| `page` | integer | no | Page number for pagination |

### Example

```lua
local result = app.integrations.lasso.list_contacts({
  project_id = "proj_abc123",
  limit = 10
})

for _, contact in ipairs(result.contacts) do
  print(contact.id .. ": " .. (contact.first_name or "") .. " " .. (contact.last_name or ""))
end
```

---

## get_contact

Get full details for a single contact by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The contact ID |

### Example

```lua
local contact = app.integrations.lasso.get_contact({
  id = "contact_abc123"
})

print(contact.first_name .. " " .. contact.last_name)
print("Email: " .. (contact.email or "N/A"))
print("Phone: " .. (contact.phone or "N/A"))
```

---

## create_contact

Create a new contact (registrant) in Lasso CRM.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `first_name` | string | no | Contact first name |
| `last_name` | string | no | Contact last name |
| `email` | string | no | Primary email address |
| `phone` | string | no | Primary phone number |
| `project_id` | string | no | Project ID to associate with |
| `source` | string | no | Lead source (e.g., "Website", "Referral") |
| `notes` | string | no | Notes about the contact |

At least a `first_name` or `last_name` is required.

### Example

```lua
local contact = app.integrations.lasso.create_contact({
  first_name = "Jane",
  last_name = "Smith",
  email = "[email protected]",
  phone = "+1234567890",
  project_id = "proj_abc123",
  source = "Website"
})

print("Created contact: " .. contact.id)
```

---

## list_deals

List deals (sales) in Lasso CRM with optional filters.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | no | Filter deals by project ID |
| `status` | string | no | Filter by deal status |
| `limit` | integer | no | Max results (default: 25) |
| `page` | integer | no | Page number for pagination |

### Example

```lua
local result = app.integrations.lasso.list_deals({
  project_id = "proj_abc123",
  status = "Active",
  limit = 10
})

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

---

## get_deal

Get full details for a single deal by ID.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The deal ID |

### Example

```lua
local deal = app.integrations.lasso.get_deal({
  id = "deal_abc123"
})

print("Deal: " .. (deal.name or deal.id))
print("Price: " .. (deal.price or "N/A"))
print("Status: " .. (deal.status or "N/A"))
```

---

## list_inventory

List available inventory (units/lots) in Lasso CRM.

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `project_id` | string | no | Filter inventory by project ID |
| `status` | string | no | Filter by status (e.g., "Available", "Sold", "Reserved") |
| `limit` | integer | no | Max results (default: 25) |
| `page` | integer | no | Page number for pagination |

### Example

```lua
local result = app.integrations.lasso.list_inventory({
  project_id = "proj_abc123",
  status = "Available",
  limit = 10
})

for _, item in ipairs(result.inventory) do
  print(item.id .. ": " .. (item.name or item.unit_number or item.id))
end
```

---

## get_current_user

Get the authenticated user's profile.

### Parameters

None.

### Example

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

print("Logged in as: " .. (user.first_name or "") .. " " .. (user.last_name or ""))
print("Email: " .. (user.email or "N/A"))

if user.organization then
  print("Organization: " .. (user.organization.name or "N/A"))
end
```

---

## Multi-Account Usage

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

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

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

-- Named accounts
app.integrations.lasso.downtown_project.function_name({...})
app.integrations.lasso.suburb_project.function_name({...})
```

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

Metadata-Derived Lua Example

local result = app.integrations.lasso.lasso_list_contacts({
  project_id = "example_project_id",
  limit = 1,
  page = 1
})
print(result)

Functions

lasso_list_contacts

List contacts (registrants) in Lasso CRM. Optionally filter by project ID or other criteria. Supports pagination.

Operation
Read read
Full name
lasso.lasso_list_contacts
ParameterTypeRequiredDescription
project_id string no Filter contacts by project ID.
limit integer no Maximum number of contacts to return (default: 25).
page integer no Page number for pagination.

lasso_get_contact

Get full details for a single contact (registrant) in Lasso CRM, including emails, phone numbers, and associated information.

Operation
Read read
Full name
lasso.lasso_get_contact
ParameterTypeRequiredDescription
id string yes The contact ID.

lasso_create_contact

Create a new contact (registrant) in Lasso CRM. Provide at least a first name or last name, and optionally email, phone, and other details.

Operation
Write write
Full name
lasso.lasso_create_contact
ParameterTypeRequiredDescription
first_name string no Contact first name.
last_name string no Contact last name.
email string no Primary email address.
phone string no Primary phone number.
project_id string no Project ID to associate the contact with.
source string no Lead source (e.g., "Website", "Referral").
notes string no Notes about the contact.

lasso_list_deals

List deals (sales) in Lasso CRM. Optionally filter by project ID or status. Supports pagination.

Operation
Read read
Full name
lasso.lasso_list_deals
ParameterTypeRequiredDescription
project_id string no Filter deals by project ID.
status string no Filter by deal status.
limit integer no Maximum number of deals to return (default: 25).
page integer no Page number for pagination.

lasso_get_deal

Get full details for a single deal (sale) in Lasso CRM, including pricing, unit details, and associated contacts.

Operation
Read read
Full name
lasso.lasso_get_deal
ParameterTypeRequiredDescription
id string yes The deal ID.

lasso_list_inventory

List available inventory (units/lots) in Lasso CRM. Optionally filter by project ID or status. Supports pagination.

Operation
Read read
Full name
lasso.lasso_list_inventory
ParameterTypeRequiredDescription
project_id string no Filter inventory by project ID.
status string no Filter by inventory status (e.g., "Available", "Sold", "Reserved").
limit integer no Maximum number of inventory items to return (default: 25).
page integer no Page number for pagination.

lasso_get_current_user

Get the profile of the currently authenticated Lasso CRM user — name, email, organization, and other account details.

Operation
Read read
Full name
lasso.lasso_get_current_user
ParameterTypeRequiredDescription
No parameters.