productivity
Freshmarketer CLI for AI Agents
Use the Freshmarketer CLI from KosmoKrator to call Freshmarketer tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Freshmarketer CLI Setup
Freshmarketer can be configured headlessly with `kosmokrator integrations:configure freshmarketer`.
# 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 freshmarketer --set access_token="$FRESHMARKETER_ACCESS_TOKEN" --set domain="$FRESHMARKETER_DOMAIN" --enable --read allow --write ask --json
kosmokrator integrations:doctor freshmarketer --json
kosmokrator integrations:status --json Credentials
Authentication type: Bearer token bearer_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | FRESHMARKETER_ACCESS_TOKEN | Secret secret | yes | Access Token |
domain | FRESHMARKETER_DOMAIN | Text string | yes | Domain |
base_url | FRESHMARKETER_BASE_URL | URL url | no | Custom Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call freshmarketer.freshmarketer_list_campaigns '{"page":1,"limit":1,"status":"example_status"}' --json kosmo integrations:freshmarketer freshmarketer_list_campaigns '{"page":1,"limit":1,"status":"example_status"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs freshmarketer --json
kosmo integrations:docs freshmarketer.freshmarketer_list_campaigns --json
kosmo integrations:schema freshmarketer.freshmarketer_list_campaigns --json
kosmo integrations:search "Freshmarketer" --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.
freshmarketer.freshmarketer_list_campaigns
List marketing campaigns from Freshmarketer. Supports pagination and filtering by status (e.g., "active", "completed", "draft").
read - Parameters
- page, limit, status
kosmo integrations:call freshmarketer.freshmarketer_list_campaigns '{"page":1,"limit":1,"status":"example_status"}' --json kosmo integrations:freshmarketer freshmarketer_list_campaigns '{"page":1,"limit":1,"status":"example_status"}' --json freshmarketer.freshmarketer_get_campaign
Get detailed information about a specific marketing campaign by its ID.
read - Parameters
- id
kosmo integrations:call freshmarketer.freshmarketer_get_campaign '{"id":1}' --json kosmo integrations:freshmarketer freshmarketer_get_campaign '{"id":1}' --json freshmarketer.freshmarketer_create_campaign
Create a new marketing campaign in Freshmarketer. Specify the campaign name, channels (e.g., "email"), and an optional schedule.
write - Parameters
- name, channel_list, schedule
kosmo integrations:call freshmarketer.freshmarketer_create_campaign '{"name":"example_name","channel_list":"example_channel_list","schedule":"example_schedule"}' --json kosmo integrations:freshmarketer freshmarketer_create_campaign '{"name":"example_name","channel_list":"example_channel_list","schedule":"example_schedule"}' --json freshmarketer.freshmarketer_list_segments
List contact segments in Freshmarketer. Supports pagination to browse through all segments.
read - Parameters
- page, limit
kosmo integrations:call freshmarketer.freshmarketer_list_segments '{"page":1,"limit":1}' --json kosmo integrations:freshmarketer freshmarketer_list_segments '{"page":1,"limit":1}' --json freshmarketer.freshmarketer_get_segment
Get detailed information about a specific contact segment by its ID.
read - Parameters
- id
kosmo integrations:call freshmarketer.freshmarketer_get_segment '{"id":1}' --json kosmo integrations:freshmarketer freshmarketer_get_segment '{"id":1}' --json freshmarketer.freshmarketer_list_users
List all users in the Freshmarketer account.
read - Parameters
- none
kosmo integrations:call freshmarketer.freshmarketer_list_users '{}' --json kosmo integrations:freshmarketer freshmarketer_list_users '{}' --json freshmarketer.freshmarketer_get_current_user
Get the profile of the currently authenticated Freshmarketer user.
read - Parameters
- none
kosmo integrations:call freshmarketer.freshmarketer_get_current_user '{}' --json kosmo integrations:freshmarketer freshmarketer_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
freshmarketer.freshmarketer_list_campaigns 3 parameters
kosmo integrations:schema freshmarketer.freshmarketer_list_campaigns --json | Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
limit | integer | no | Number of campaigns per page (default: 20). |
status | string | no | Filter campaigns by status (e.g., "active", "completed", "draft"). |
freshmarketer.freshmarketer_get_campaign 1 parameters
kosmo integrations:schema freshmarketer.freshmarketer_get_campaign --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The campaign ID to retrieve. |
freshmarketer.freshmarketer_create_campaign 3 parameters
kosmo integrations:schema freshmarketer.freshmarketer_create_campaign --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Name of the campaign. |
channel_list | array | no | List of channels for the campaign (e.g., ["email"]). |
schedule | object | no | Schedule configuration for the campaign (e.g., {"type": "immediate"} or {"type": "scheduled", "scheduled_at": "2025-06-01T09:00:00Z"}). |
freshmarketer.freshmarketer_list_segments 2 parameters
kosmo integrations:schema freshmarketer.freshmarketer_list_segments --json | Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | no | Page number for pagination (default: 1). |
limit | integer | no | Number of segments per page (default: 20). |
freshmarketer.freshmarketer_get_segment 1 parameters
kosmo integrations:schema freshmarketer.freshmarketer_get_segment --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The segment ID to retrieve. |
freshmarketer.freshmarketer_list_users 0 parameters
kosmo integrations:schema freshmarketer.freshmarketer_list_users --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
freshmarketer.freshmarketer_get_current_user 0 parameters
kosmo integrations:schema freshmarketer.freshmarketer_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
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.