KosmoKrator

sales

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.

7 functions 6 read 1 write API key auth

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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
api_key FRESHSALES_API_KEY Secret secret yes API Key
domain FRESHSALES_DOMAIN Text string yes Domain

Call Freshsales Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

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

Use the provider shortcut form for shorter human-facing commands.

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

Agent Discovery Commands

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Freshsales.

freshsales.freshsales_create_contact

Write write

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

Parameters
first_name, last_name, email, mobile_number

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

freshsales.freshsales_get_contact

Read read

Get full details for a specific Freshsales contact by ID.

Parameters
id

Generic CLI call

kosmo integrations:call freshsales.freshsales_get_contact '{"id":1}' --json

Provider shortcut

kosmo integrations:freshsales freshsales_get_contact '{"id":1}' --json

freshsales.freshsales_get_current_user

Read read

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

Parameters
none

Generic CLI call

kosmo integrations:call freshsales.freshsales_get_current_user '{}' --json

Provider shortcut

kosmo integrations:freshsales freshsales_get_current_user '{}' --json

freshsales.freshsales_get_deal

Read read

Get full details for a specific Freshsales deal by ID.

Parameters
id

Generic CLI call

kosmo integrations:call freshsales.freshsales_get_deal '{"id":1}' --json

Provider shortcut

kosmo integrations:freshsales freshsales_get_deal '{"id":1}' --json

freshsales.freshsales_list_accounts

Read read

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

Parameters
page, per_page

Generic CLI call

kosmo integrations:call freshsales.freshsales_list_accounts '{"page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:freshsales freshsales_list_accounts '{"page":1,"per_page":1}' --json

freshsales.freshsales_list_contacts

Read read

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

Parameters
page, per_page, sort, sort_by

Generic CLI call

kosmo integrations:call freshsales.freshsales_list_contacts '{"page":1,"per_page":1,"sort":"example_sort","sort_by":"example_sort_by"}' --json

Provider 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

Read read

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

Parameters
page, per_page

Generic CLI call

kosmo integrations:call freshsales.freshsales_list_deals '{"page":1,"per_page":1}' --json

Provider 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

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

Operation
Write write
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

Get full details for a specific Freshsales contact by ID.

Operation
Read read
Schema command
kosmo integrations:schema freshsales.freshsales_get_contact --json
ParameterTypeRequiredDescription
id integer yes The contact ID.

freshsales.freshsales_get_current_user

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

Operation
Read read
Schema command
kosmo integrations:schema freshsales.freshsales_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

freshsales.freshsales_get_deal

Get full details for a specific Freshsales deal by ID.

Operation
Read read
Schema command
kosmo integrations:schema freshsales.freshsales_get_deal --json
ParameterTypeRequiredDescription
id integer yes The deal ID.

freshsales.freshsales_list_accounts

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

Operation
Read read
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

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

Operation
Read read
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

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

Operation
Read read
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.