KosmoKrator

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, 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 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.

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

Generic CLI call
kosmo integrations:call freshmarketer.freshmarketer_list_campaigns '{"page":1,"limit":1,"status":"example_status"}' --json
Provider shortcut
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.

Discovery commands
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 read
Parameters
page, limit, status
Generic call
kosmo integrations:call freshmarketer.freshmarketer_list_campaigns '{"page":1,"limit":1,"status":"example_status"}' --json
Shortcut
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 read
Parameters
id
Generic call
kosmo integrations:call freshmarketer.freshmarketer_get_campaign '{"id":1}' --json
Shortcut
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 write
Parameters
name, channel_list, schedule
Generic call
kosmo integrations:call freshmarketer.freshmarketer_create_campaign '{"name":"example_name","channel_list":"example_channel_list","schedule":"example_schedule"}' --json
Shortcut
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 read
Parameters
page, limit
Generic call
kosmo integrations:call freshmarketer.freshmarketer_list_segments '{"page":1,"limit":1}' --json
Shortcut
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 read
Parameters
id
Generic call
kosmo integrations:call freshmarketer.freshmarketer_get_segment '{"id":1}' --json
Shortcut
kosmo integrations:freshmarketer freshmarketer_get_segment '{"id":1}' --json

freshmarketer.freshmarketer_list_users

List all users in the Freshmarketer account.

Read read
Parameters
none
Generic call
kosmo integrations:call freshmarketer.freshmarketer_list_users '{}' --json
Shortcut
kosmo integrations:freshmarketer freshmarketer_list_users '{}' --json

freshmarketer.freshmarketer_get_current_user

Get the profile of the currently authenticated Freshmarketer user.

Read read
Parameters
none
Generic call
kosmo integrations:call freshmarketer.freshmarketer_get_current_user '{}' --json
Shortcut
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
Schema command
kosmo integrations:schema freshmarketer.freshmarketer_list_campaigns --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema freshmarketer.freshmarketer_get_campaign --json
ParameterTypeRequiredDescription
id integer yes The campaign ID to retrieve.
freshmarketer.freshmarketer_create_campaign 3 parameters
Schema command
kosmo integrations:schema freshmarketer.freshmarketer_create_campaign --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema freshmarketer.freshmarketer_list_segments --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema freshmarketer.freshmarketer_get_segment --json
ParameterTypeRequiredDescription
id integer yes The segment ID to retrieve.
freshmarketer.freshmarketer_list_users 0 parameters
Schema command
kosmo integrations:schema freshmarketer.freshmarketer_list_users --json
ParameterTypeRequiredDescription
No parameters.
freshmarketer.freshmarketer_get_current_user 0 parameters
Schema command
kosmo integrations:schema freshmarketer.freshmarketer_get_current_user --json
ParameterTypeRequiredDescription
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.