KosmoKrator

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, configure, and verify
# 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.

KeyEnv varTypeRequiredLabel
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.

Generic CLI call
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
Provider shortcut
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.

Discovery commands
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 write
Parameters
first_name, last_name, email, mobile_number
Generic call
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
Shortcut
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 read
Parameters
id
Generic call
kosmo integrations:call freshsales.freshsales_get_contact '{"id":1}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call freshsales.freshsales_get_current_user '{}' --json
Shortcut
kosmo integrations:freshsales freshsales_get_current_user '{}' --json

freshsales.freshsales_get_deal

Get full details for a specific Freshsales deal by ID.

Read read
Parameters
id
Generic call
kosmo integrations:call freshsales.freshsales_get_deal '{"id":1}' --json
Shortcut
kosmo integrations:freshsales freshsales_get_deal '{"id":1}' --json

freshsales.freshsales_list_accounts

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

Read read
Parameters
page, per_page
Generic call
kosmo integrations:call freshsales.freshsales_list_accounts '{"page":1,"per_page":1}' --json
Shortcut
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 read
Parameters
page, per_page, sort, sort_by
Generic call
kosmo integrations:call freshsales.freshsales_list_contacts '{"page":1,"per_page":1,"sort":"example_sort","sort_by":"example_sort_by"}' --json
Shortcut
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 read
Parameters
page, per_page
Generic call
kosmo integrations:call freshsales.freshsales_list_deals '{"page":1,"per_page":1}' --json
Shortcut
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
Schema command
kosmo integrations:schema freshsales.freshsales_create_contact --json
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.freshsales_get_contact 1 parameters
Schema command
kosmo integrations:schema freshsales.freshsales_get_contact --json
ParameterTypeRequiredDescription
id integer yes The contact ID.
freshsales.freshsales_get_current_user 0 parameters
Schema command
kosmo integrations:schema freshsales.freshsales_get_current_user --json
ParameterTypeRequiredDescription
No parameters.
freshsales.freshsales_get_deal 1 parameters
Schema command
kosmo integrations:schema freshsales.freshsales_get_deal --json
ParameterTypeRequiredDescription
id integer yes The deal ID.
freshsales.freshsales_list_accounts 2 parameters
Schema command
kosmo integrations:schema freshsales.freshsales_list_accounts --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema freshsales.freshsales_list_contacts --json
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.freshsales_list_deals 2 parameters
Schema command
kosmo integrations:schema freshsales.freshsales_list_deals --json
ParameterTypeRequiredDescription
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.