KosmoKrator

marketing

Customer.io CLI for AI Agents

Use the Customer.io CLI from KosmoKrator to call Customer.io tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 5 read 2 write API key auth

Customer.io CLI Setup

Customer.io can be configured headlessly with `kosmokrator integrations:configure customerio`.

# 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 customerio --set api_key="$CUSTOMERIO_API_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor customerio --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 CUSTOMERIO_API_KEY Secret secret yes API Key
url CUSTOMERIO_URL URL url no API Base URL

Call Customer.io Headlessly

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

kosmo integrations:call customerio.customerio_identify_customer '{
  "id": "example_id",
  "email": "example_email",
  "name": "example_name",
  "attributes": "example_attributes"
}' --json

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

kosmo integrations:customerio customerio_identify_customer '{
  "id": "example_id",
  "email": "example_email",
  "name": "example_name",
  "attributes": "example_attributes"
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs customerio --json
kosmo integrations:docs customerio.customerio_identify_customer --json
kosmo integrations:schema customerio.customerio_identify_customer --json
kosmo integrations:search "Customer.io" --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 Customer.io.

customerio.customerio_identify_customer

Write write

Create or update a customer profile in Customer.io. Use this to add new customers or update existing customer attributes like email, name, and custom properties.

Parameters
id, email, name, attributes

Generic CLI call

kosmo integrations:call customerio.customerio_identify_customer '{"id":"example_id","email":"example_email","name":"example_name","attributes":"example_attributes"}' --json

Provider shortcut

kosmo integrations:customerio customerio_identify_customer '{"id":"example_id","email":"example_email","name":"example_name","attributes":"example_attributes"}' --json

customerio.customerio_track_event

Write write

Track a custom event for a customer in Customer.io. Events trigger campaign workflows and can be used to segment customers.

Parameters
id, name, data

Generic CLI call

kosmo integrations:call customerio.customerio_track_event '{"id":"example_id","name":"example_name","data":"example_data"}' --json

Provider shortcut

kosmo integrations:customerio customerio_track_event '{"id":"example_id","name":"example_name","data":"example_data"}' --json

customerio.customerio_list_segments

Read read

List all segments in the Customer.io workspace. Segments are dynamic groups of customers defined by conditions.

Parameters
none

Generic CLI call

kosmo integrations:call customerio.customerio_list_segments '{}' --json

Provider shortcut

kosmo integrations:customerio customerio_list_segments '{}' --json

customerio.customerio_list_campaigns

Read read

List all campaigns in the Customer.io workspace. Campaigns are automated message sequences triggered by events or segments.

Parameters
none

Generic CLI call

kosmo integrations:call customerio.customerio_list_campaigns '{}' --json

Provider shortcut

kosmo integrations:customerio customerio_list_campaigns '{}' --json

customerio.customerio_get_campaign

Read read

Get detailed information about a specific campaign in Customer.io, including its triggers, actions, and performance metrics.

Parameters
id

Generic CLI call

kosmo integrations:call customerio.customerio_get_campaign '{"id":1}' --json

Provider shortcut

kosmo integrations:customerio customerio_get_campaign '{"id":1}' --json

customerio.customerio_list_newsletters

Read read

List all newsletters in the Customer.io workspace. Newsletters are one-time broadcast messages sent to segments.

Parameters
none

Generic CLI call

kosmo integrations:call customerio.customerio_list_newsletters '{}' --json

Provider shortcut

kosmo integrations:customerio customerio_list_newsletters '{}' --json

customerio.customerio_get_current_user

Read read

Get the currently authenticated user and account information from Customer.io. Useful for verifying API credentials and checking workspace details.

Parameters
none

Generic CLI call

kosmo integrations:call customerio.customerio_get_current_user '{}' --json

Provider shortcut

kosmo integrations:customerio customerio_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

customerio.customerio_identify_customer

Create or update a customer profile in Customer.io. Use this to add new customers or update existing customer attributes like email, name, and custom properties.

Operation
Write write
Schema command
kosmo integrations:schema customerio.customerio_identify_customer --json
ParameterTypeRequiredDescription
id string yes Unique identifier for the customer (e.g., user ID, email, or external ID).
email string no Customer email address.
name string no Customer full name.
attributes object no Additional custom attributes to set on the customer profile (e.g., {"plan": "premium", "company": "Acme"}).

customerio.customerio_track_event

Track a custom event for a customer in Customer.io. Events trigger campaign workflows and can be used to segment customers.

Operation
Write write
Schema command
kosmo integrations:schema customerio.customerio_track_event --json
ParameterTypeRequiredDescription
id string yes Customer identifier (must match the ID used when identifying the customer).
name string yes Event name (e.g., "purchase", "signup", "plan_changed").
data object no Event data payload — key-value pairs with event details (e.g., {"product": "Pro Plan", "amount": 99}).

customerio.customerio_list_segments

List all segments in the Customer.io workspace. Segments are dynamic groups of customers defined by conditions.

Operation
Read read
Schema command
kosmo integrations:schema customerio.customerio_list_segments --json
ParameterTypeRequiredDescription
No parameters.

customerio.customerio_list_campaigns

List all campaigns in the Customer.io workspace. Campaigns are automated message sequences triggered by events or segments.

Operation
Read read
Schema command
kosmo integrations:schema customerio.customerio_list_campaigns --json
ParameterTypeRequiredDescription
No parameters.

customerio.customerio_get_campaign

Get detailed information about a specific campaign in Customer.io, including its triggers, actions, and performance metrics.

Operation
Read read
Schema command
kosmo integrations:schema customerio.customerio_get_campaign --json
ParameterTypeRequiredDescription
id integer yes The campaign ID to retrieve.

customerio.customerio_list_newsletters

List all newsletters in the Customer.io workspace. Newsletters are one-time broadcast messages sent to segments.

Operation
Read read
Schema command
kosmo integrations:schema customerio.customerio_list_newsletters --json
ParameterTypeRequiredDescription
No parameters.

customerio.customerio_get_current_user

Get the currently authenticated user and account information from Customer.io. Useful for verifying API credentials and checking workspace details.

Operation
Read read
Schema command
kosmo integrations:schema customerio.customerio_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.