productivity
Freshsales CLI for AI Agents
Use the Freshsales CLI from KosmoKrator to call Freshsales tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Freshsales CLI Setup
Freshsales can be configured headlessly with `kosmokrator integrations:configure freshsales`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure freshsales --set api_key="$FRESHSALES_API_KEY" --set domain="$FRESHSALES_DOMAIN" --enable --read allow --write ask --json
kosmokrator integrations:doctor freshsales --json
kosmokrator integrations:status --json Credentials
Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | FRESHSALES_API_KEY | Secret secret | yes | API Key |
domain | FRESHSALES_DOMAIN | Text string | yes | Domain |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call freshsales.freshsales_create_contact '{"first_name":"example_first_name","last_name":"example_last_name","email":"example_email","mobile_number":"example_mobile_number"}' --json kosmo integrations:freshsales freshsales_create_contact '{"first_name":"example_first_name","last_name":"example_last_name","email":"example_email","mobile_number":"example_mobile_number"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs freshsales --json
kosmo integrations:docs freshsales.freshsales_create_contact --json
kosmo integrations:schema freshsales.freshsales_create_contact --json
kosmo integrations:search "Freshsales" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
freshsales.freshsales_create_contact
Create a new contact in Freshsales CRM with name, email, and phone details.
write - Parameters
- first_name, last_name, email, mobile_number
kosmo integrations:call freshsales.freshsales_create_contact '{"first_name":"example_first_name","last_name":"example_last_name","email":"example_email","mobile_number":"example_mobile_number"}' --json kosmo integrations:freshsales freshsales_create_contact '{"first_name":"example_first_name","last_name":"example_last_name","email":"example_email","mobile_number":"example_mobile_number"}' --json freshsales.freshsales_get_contact
Get full details for a specific Freshsales contact by ID.
read - Parameters
- id
kosmo integrations:call freshsales.freshsales_get_contact '{"id":1}' --json kosmo integrations:freshsales freshsales_get_contact '{"id":1}' --json freshsales.freshsales_get_current_user
Get the profile of the currently authenticated Freshsales user. Useful for verifying the API connection.
read - Parameters
- none
kosmo integrations:call freshsales.freshsales_get_current_user '{}' --json kosmo integrations:freshsales freshsales_get_current_user '{}' --json freshsales.freshsales_get_deal
Get full details for a specific Freshsales deal by ID.
read - Parameters
- id
kosmo integrations:call freshsales.freshsales_get_deal '{"id":1}' --json kosmo integrations:freshsales freshsales_get_deal '{"id":1}' --json freshsales.freshsales_list_accounts
List sales accounts (companies) from Freshsales CRM. Returns paginated results.
read - Parameters
- page, per_page
kosmo integrations:call freshsales.freshsales_list_accounts '{"page":1,"per_page":1}' --json kosmo integrations:freshsales freshsales_list_accounts '{"page":1,"per_page":1}' --json freshsales.freshsales_list_contacts
List contacts from Freshsales CRM. Returns paginated results with optional sorting by field and direction.
read - Parameters
- page, per_page, sort, sort_by
kosmo integrations:call freshsales.freshsales_list_contacts '{"page":1,"per_page":1,"sort":"example_sort","sort_by":"example_sort_by"}' --json kosmo integrations:freshsales freshsales_list_contacts '{"page":1,"per_page":1,"sort":"example_sort","sort_by":"example_sort_by"}' --json freshsales.freshsales_list_deals
List deals from Freshsales CRM. Returns paginated results showing deal pipeline information.
read - Parameters
- page, per_page
kosmo integrations:call freshsales.freshsales_list_deals '{"page":1,"per_page":1}' --json kosmo integrations:freshsales freshsales_list_deals '{"page":1,"per_page":1}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
freshsales.freshsales_create_contact 4 parameters
kosmo integrations:schema freshsales.freshsales_create_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
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.freshsales_get_contact 1 parameters
kosmo integrations:schema freshsales.freshsales_get_contact --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The contact ID. |
freshsales.freshsales_get_current_user 0 parameters
kosmo integrations:schema freshsales.freshsales_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
freshsales.freshsales_get_deal 1 parameters
kosmo integrations:schema freshsales.freshsales_get_deal --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The deal ID. |
freshsales.freshsales_list_accounts 2 parameters
kosmo integrations:schema freshsales.freshsales_list_accounts --json | Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
per_page | integer | no | Number of accounts per page (default: 20, max: 100). |
freshsales.freshsales_list_contacts 4 parameters
kosmo integrations:schema freshsales.freshsales_list_contacts --json | Parameter | Type | Required | Description |
|---|---|---|---|
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.freshsales_list_deals 2 parameters
kosmo integrations:schema freshsales.freshsales_list_deals --json | Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
per_page | integer | no | Number of deals per page (default: 20, max: 100). |
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.