KosmoKrator

sales

Freshsales Lua API for KosmoKrator Agents

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

7 functions 6 read 1 write API key auth

Lua Namespace

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

Freshsales Integration

Tools for interacting with the Freshsales CRM API.

Tools

freshsales_list_contacts

List contacts from Freshsales CRM.

Parameters:

  • page (integer, optional) — Page number for pagination (default: 1)
  • per_page (integer, optional) — Number of contacts per page (default: 20, max: 100)
  • sort (string, optional) — Sort direction: “asc” or “desc”
  • sort_by (string, optional) — Field to sort by (e.g., “created_at”, “updated_at”, “first_name”)

freshsales_get_contact

Get full details for a specific contact.

Parameters:

  • id (integer, required) — The contact ID

freshsales_create_contact

Create a new contact in Freshsales.

Parameters:

  • first_name (string, required) — First name
  • last_name (string, required) — Last name
  • email (string, optional) — Email address
  • mobile_number (string, optional) — Mobile phone number

freshsales_list_deals

List deals from Freshsales CRM.

Parameters:

  • page (integer, optional) — Page number for pagination (default: 1)
  • per_page (integer, optional) — Number of deals per page (default: 20, max: 100)

freshsales_get_deal

Get full details for a specific deal.

Parameters:

  • id (integer, required) — The deal ID

freshsales_list_accounts

List sales accounts from Freshsales CRM.

Parameters:

  • page (integer, optional) — Page number for pagination (default: 1)
  • per_page (integer, optional) — Number of accounts per page (default: 20, max: 100)

freshsales_get_current_user

Get the currently authenticated user profile. Useful for verifying the API connection.

Parameters: None

Raw agent markdown
# Freshsales Integration

Tools for interacting with the Freshsales CRM API.

## Tools

### freshsales_list_contacts
List contacts from Freshsales CRM.

**Parameters:**
- `page` (integer, optional) — Page number for pagination (default: 1)
- `per_page` (integer, optional) — Number of contacts per page (default: 20, max: 100)
- `sort` (string, optional) — Sort direction: "asc" or "desc"
- `sort_by` (string, optional) — Field to sort by (e.g., "created_at", "updated_at", "first_name")

### freshsales_get_contact
Get full details for a specific contact.

**Parameters:**
- `id` (integer, required) — The contact ID

### freshsales_create_contact
Create a new contact in Freshsales.

**Parameters:**
- `first_name` (string, required) — First name
- `last_name` (string, required) — Last name
- `email` (string, optional) — Email address
- `mobile_number` (string, optional) — Mobile phone number

### freshsales_list_deals
List deals from Freshsales CRM.

**Parameters:**
- `page` (integer, optional) — Page number for pagination (default: 1)
- `per_page` (integer, optional) — Number of deals per page (default: 20, max: 100)

### freshsales_get_deal
Get full details for a specific deal.

**Parameters:**
- `id` (integer, required) — The deal ID

### freshsales_list_accounts
List sales accounts from Freshsales CRM.

**Parameters:**
- `page` (integer, optional) — Page number for pagination (default: 1)
- `per_page` (integer, optional) — Number of accounts per page (default: 20, max: 100)

### freshsales_get_current_user
Get the currently authenticated user profile. Useful for verifying the API connection.

**Parameters:** None

Metadata-Derived Lua Example

local result = app.integrations.freshsales.freshsales_create_contact({
  first_name = "example_first_name",
  last_name = "example_last_name",
  email = "example_email",
  mobile_number = "example_mobile_number"
})
print(result)

Functions

freshsales_create_contact

Create a new contact in Freshsales CRM with name, email, and phone details.

Operation
Write write
Full name
freshsales.freshsales_create_contact
ParameterTypeRequiredDescription
first_name string yes First name of the contact.
last_name string yes Last name of the contact.
email string no Email address of the contact.
mobile_number string no Mobile phone number of the contact.

freshsales_get_contact

Get full details for a specific Freshsales contact by ID.

Operation
Read read
Full name
freshsales.freshsales_get_contact
ParameterTypeRequiredDescription
id integer yes The contact ID.

freshsales_get_current_user

Get the profile of the currently authenticated Freshsales user. Useful for verifying the API connection.

Operation
Read read
Full name
freshsales.freshsales_get_current_user
ParameterTypeRequiredDescription
No parameters.

freshsales_get_deal

Get full details for a specific Freshsales deal by ID.

Operation
Read read
Full name
freshsales.freshsales_get_deal
ParameterTypeRequiredDescription
id integer yes The deal ID.

freshsales_list_accounts

List sales accounts (companies) from Freshsales CRM. Returns paginated results.

Operation
Read read
Full name
freshsales.freshsales_list_accounts
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of accounts per page (default: 20, max: 100).

freshsales_list_contacts

List contacts from Freshsales CRM. Returns paginated results with optional sorting by field and direction.

Operation
Read read
Full name
freshsales.freshsales_list_contacts
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of contacts per page (default: 20, max: 100).
sort string no Sort direction: "asc" or "desc" (default: "desc").
sort_by string no Field to sort by, e.g., "created_at", "updated_at", "first_name".

freshsales_list_deals

List deals from Freshsales CRM. Returns paginated results showing deal pipeline information.

Operation
Read read
Full name
freshsales.freshsales_list_deals
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of deals per page (default: 20, max: 100).