KosmoKrator

productivity

Klaviyo CLI for AI Agents

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

15 functions 10 read 5 write API key auth

Klaviyo CLI Setup

Klaviyo can be configured headlessly with `kosmokrator integrations:configure klaviyo`.

# 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 klaviyo --enable --read allow --write ask --json
kosmokrator integrations:doctor klaviyo --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.

No credentials are required.

Call Klaviyo Headlessly

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

kosmo integrations:call klaviyo.klaviyo_create_profile '{
  "email": "example_email",
  "phone_number": "example_phone_number",
  "first_name": "example_first_name",
  "last_name": "example_last_name",
  "properties": "example_properties"
}' --json

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

kosmo integrations:klaviyo klaviyo_create_profile '{
  "email": "example_email",
  "phone_number": "example_phone_number",
  "first_name": "example_first_name",
  "last_name": "example_last_name",
  "properties": "example_properties"
}' --json

Agent Discovery Commands

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

kosmo integrations:docs klaviyo --json
kosmo integrations:docs klaviyo.klaviyo_create_profile --json
kosmo integrations:schema klaviyo.klaviyo_create_profile --json
kosmo integrations:search "Klaviyo" --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 Klaviyo.

klaviyo.klaviyo_create_profile

Write write

Create a new profile in Klaviyo. Provide at least an email address or phone number. Optionally set first name, last name, and custom properties. Returns the newly created profile with its Klaviyo ID.

Parameters
email, phone_number, first_name, last_name, properties

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_create_profile '{"email":"example_email","phone_number":"example_phone_number","first_name":"example_first_name","last_name":"example_last_name","properties":"example_properties"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_create_profile '{"email":"example_email","phone_number":"example_phone_number","first_name":"example_first_name","last_name":"example_last_name","properties":"example_properties"}' --json

klaviyo.klaviyo_get_profile

Read read

Retrieve a single Klaviyo profile by its ID. Returns the full profile including email, phone number, name, and custom properties.

Parameters
profile_id

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_get_profile '{"profile_id":"example_profile_id"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_get_profile '{"profile_id":"example_profile_id"}' --json

klaviyo.klaviyo_update_profile

Write write

Update an existing Klaviyo profile by ID. Provide only the fields you want to change — omitted fields are left untouched. Supports updating email, phone number, first name, last name, and custom properties.

Parameters
profile_id, email, phone_number, first_name, last_name, properties

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_update_profile '{"profile_id":"example_profile_id","email":"example_email","phone_number":"example_phone_number","first_name":"example_first_name","last_name":"example_last_name","properties":"example_properties"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_update_profile '{"profile_id":"example_profile_id","email":"example_email","phone_number":"example_phone_number","first_name":"example_first_name","last_name":"example_last_name","properties":"example_properties"}' --json

klaviyo.klaviyo_list_profiles

Read read

List profiles in Klaviyo with cursor-based pagination. Returns each profile's ID, email, phone number, name, and custom properties. Use the page_cursor from a previous response to fetch the next page of results.

Parameters
limit, page_cursor

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_list_profiles '{"limit":1,"page_cursor":"example_page_cursor"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_list_profiles '{"limit":1,"page_cursor":"example_page_cursor"}' --json

klaviyo.klaviyo_subscribe_profile

Write write

Subscribe a profile to a Klaviyo list using their email address. Requires a valid list ID and the subscriber's email. Optionally provide a phone number and an ISO 8601 consented_at timestamp.

Parameters
list_id, email, phone_number, consented_at

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_subscribe_profile '{"list_id":"example_list_id","email":"example_email","phone_number":"example_phone_number","consented_at":"example_consented_at"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_subscribe_profile '{"list_id":"example_list_id","email":"example_email","phone_number":"example_phone_number","consented_at":"example_consented_at"}' --json

klaviyo.klaviyo_create_event

Write write

Track a new event for an existing Klaviyo profile. Provide the profile ID, event name, and optional properties, numeric value, and timestamp. Events are used to trigger flows and segment profiles based on behaviour.

Parameters
profile_id, event_name, properties, value, time

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_create_event '{"profile_id":"example_profile_id","event_name":"example_event_name","properties":"example_properties","value":1,"time":"example_time"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_create_event '{"profile_id":"example_profile_id","event_name":"example_event_name","properties":"example_properties","value":1,"time":"example_time"}' --json

klaviyo.klaviyo_get_event

Read read

Retrieve a single Klaviyo event by its ID. Returns the event with its metric name, properties, value, timestamp, and associated profile.

Parameters
event_id

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_get_event '{"event_id":"example_event_id"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_get_event '{"event_id":"example_event_id"}' --json

klaviyo.klaviyo_list_events

Read read

List events in Klaviyo with optional filtering and cursor-based pagination. Supports Klaviyo filter expressions (e.g. "greater-than(timestamp,2024-01-01)") to narrow results. Use page_cursor to paginate through large result sets.

Parameters
filter, limit, page_cursor

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_list_events '{"filter":"example_filter","limit":1,"page_cursor":"example_page_cursor"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_list_events '{"filter":"example_filter","limit":1,"page_cursor":"example_page_cursor"}' --json

klaviyo.klaviyo_list_lists

Read read

List all lists in the connected Klaviyo account. Returns each list's ID, name, and other metadata. Use cursor-based pagination to iterate through large numbers of lists.

Parameters
limit, page_cursor

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_list_lists '{"limit":1,"page_cursor":"example_page_cursor"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_list_lists '{"limit":1,"page_cursor":"example_page_cursor"}' --json

klaviyo.klaviyo_create_list

Write write

Create a new list in Klaviyo. Provide a name for the list. Returns the newly created list with its ID.

Parameters
name

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_create_list '{"name":"example_name"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_create_list '{"name":"example_name"}' --json

klaviyo.klaviyo_get_list

Read read

Retrieve a single Klaviyo list by its ID. Returns the list's name, member count, and other metadata.

Parameters
list_id

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_get_list '{"list_id":"example_list_id"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_get_list '{"list_id":"example_list_id"}' --json

klaviyo.klaviyo_list_list_profiles

Read read

List profiles that belong to a specific Klaviyo list. Returns each profile's ID, email, phone number, name, and custom properties. Use cursor-based pagination to iterate through large lists.

Parameters
list_id, limit, page_cursor

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_list_list_profiles '{"list_id":"example_list_id","limit":1,"page_cursor":"example_page_cursor"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_list_list_profiles '{"list_id":"example_list_id","limit":1,"page_cursor":"example_page_cursor"}' --json

klaviyo.klaviyo_list_flows

Read read

List all flows in the connected Klaviyo account. Returns each flow's ID, name, status, and other metadata. Use cursor-based pagination to iterate through large numbers of flows.

Parameters
limit, page_cursor

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_list_flows '{"limit":1,"page_cursor":"example_page_cursor"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_list_flows '{"limit":1,"page_cursor":"example_page_cursor"}' --json

klaviyo.klaviyo_get_flow

Read read

Retrieve a single Klaviyo flow by its ID. Returns the flow's name, status, trigger type, and other metadata.

Parameters
flow_id

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_get_flow '{"flow_id":"example_flow_id"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_get_flow '{"flow_id":"example_flow_id"}' --json

klaviyo.klaviyo_list_campaigns

Read read

List all campaigns in the connected Klaviyo account. Returns each campaign's ID, name, status, and other metadata. Use cursor-based pagination to iterate through large numbers of campaigns.

Parameters
limit, page_cursor

Generic CLI call

kosmo integrations:call klaviyo.klaviyo_list_campaigns '{"limit":1,"page_cursor":"example_page_cursor"}' --json

Provider shortcut

kosmo integrations:klaviyo klaviyo_list_campaigns '{"limit":1,"page_cursor":"example_page_cursor"}' --json

Function Schemas

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

klaviyo.klaviyo_create_profile

Create a new profile in Klaviyo. Provide at least an email address or phone number. Optionally set first name, last name, and custom properties. Returns the newly created profile with its Klaviyo ID.

Operation
Write write
Schema command
kosmo integrations:schema klaviyo.klaviyo_create_profile --json
ParameterTypeRequiredDescription
email string yes The profile's email address.
phone_number string no Phone number in E.164 format (e.g. +1234567890).
first_name string no First name of the profile.
last_name string no Last name of the profile.
properties object no Custom profile properties as key-value pairs.

klaviyo.klaviyo_get_profile

Retrieve a single Klaviyo profile by its ID. Returns the full profile including email, phone number, name, and custom properties.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_get_profile --json
ParameterTypeRequiredDescription
profile_id string yes The Klaviyo profile ID.

klaviyo.klaviyo_update_profile

Update an existing Klaviyo profile by ID. Provide only the fields you want to change — omitted fields are left untouched. Supports updating email, phone number, first name, last name, and custom properties.

Operation
Write write
Schema command
kosmo integrations:schema klaviyo.klaviyo_update_profile --json
ParameterTypeRequiredDescription
profile_id string yes The Klaviyo profile ID to update.
email string no New email address for the profile.
phone_number string no New phone number in E.164 format.
first_name string no Updated first name.
last_name string no Updated last name.
properties object no Custom profile properties to update as key-value pairs.

klaviyo.klaviyo_list_profiles

List profiles in Klaviyo with cursor-based pagination. Returns each profile's ID, email, phone number, name, and custom properties. Use the page_cursor from a previous response to fetch the next page of results.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_list_profiles --json
ParameterTypeRequiredDescription
limit integer no Number of profiles to return (default 20, max 100).
page_cursor string no Pagination cursor from a previous response to fetch the next page.

klaviyo.klaviyo_subscribe_profile

Subscribe a profile to a Klaviyo list using their email address. Requires a valid list ID and the subscriber's email. Optionally provide a phone number and an ISO 8601 consented_at timestamp.

Operation
Write write
Schema command
kosmo integrations:schema klaviyo.klaviyo_subscribe_profile --json
ParameterTypeRequiredDescription
list_id string yes The Klaviyo list ID to subscribe the profile to.
email string yes The subscriber's email address.
phone_number string no Phone number in E.164 format.
consented_at string no ISO 8601 timestamp of when consent was given.

klaviyo.klaviyo_create_event

Track a new event for an existing Klaviyo profile. Provide the profile ID, event name, and optional properties, numeric value, and timestamp. Events are used to trigger flows and segment profiles based on behaviour.

Operation
Write write
Schema command
kosmo integrations:schema klaviyo.klaviyo_create_event --json
ParameterTypeRequiredDescription
profile_id string yes The Klaviyo profile ID to associate the event with.
event_name string yes The event name (metric name), e.g. "Placed Order".
properties object no Event properties as key-value pairs.
value number no Numeric value associated with the event (e.g. order total).
time string no ISO 8601 timestamp of when the event occurred.

klaviyo.klaviyo_get_event

Retrieve a single Klaviyo event by its ID. Returns the event with its metric name, properties, value, timestamp, and associated profile.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_get_event --json
ParameterTypeRequiredDescription
event_id string yes The Klaviyo event ID.

klaviyo.klaviyo_list_events

List events in Klaviyo with optional filtering and cursor-based pagination. Supports Klaviyo filter expressions (e.g. "greater-than(timestamp,2024-01-01)") to narrow results. Use page_cursor to paginate through large result sets.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_list_events --json
ParameterTypeRequiredDescription
filter string no Klaviyo filter expression (e.g. "greater-than(timestamp,2024-01-01)").
limit integer no Number of events to return (default 20, max 100).
page_cursor string no Pagination cursor from a previous response to fetch the next page.

klaviyo.klaviyo_list_lists

List all lists in the connected Klaviyo account. Returns each list's ID, name, and other metadata. Use cursor-based pagination to iterate through large numbers of lists.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_list_lists --json
ParameterTypeRequiredDescription
limit integer no Number of lists to return (default 20, max 100).
page_cursor string no Pagination cursor from a previous response to fetch the next page.

klaviyo.klaviyo_create_list

Create a new list in Klaviyo. Provide a name for the list. Returns the newly created list with its ID.

Operation
Write write
Schema command
kosmo integrations:schema klaviyo.klaviyo_create_list --json
ParameterTypeRequiredDescription
name string yes The name for the new list.

klaviyo.klaviyo_get_list

Retrieve a single Klaviyo list by its ID. Returns the list's name, member count, and other metadata.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_get_list --json
ParameterTypeRequiredDescription
list_id string yes The Klaviyo list ID.

klaviyo.klaviyo_list_list_profiles

List profiles that belong to a specific Klaviyo list. Returns each profile's ID, email, phone number, name, and custom properties. Use cursor-based pagination to iterate through large lists.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_list_list_profiles --json
ParameterTypeRequiredDescription
list_id string yes The Klaviyo list ID.
limit integer no Number of profiles to return (default 20, max 100).
page_cursor string no Pagination cursor from a previous response to fetch the next page.

klaviyo.klaviyo_list_flows

List all flows in the connected Klaviyo account. Returns each flow's ID, name, status, and other metadata. Use cursor-based pagination to iterate through large numbers of flows.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_list_flows --json
ParameterTypeRequiredDescription
limit integer no Number of flows to return (default 20, max 100).
page_cursor string no Pagination cursor from a previous response to fetch the next page.

klaviyo.klaviyo_get_flow

Retrieve a single Klaviyo flow by its ID. Returns the flow's name, status, trigger type, and other metadata.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_get_flow --json
ParameterTypeRequiredDescription
flow_id string yes The Klaviyo flow ID.

klaviyo.klaviyo_list_campaigns

List all campaigns in the connected Klaviyo account. Returns each campaign's ID, name, status, and other metadata. Use cursor-based pagination to iterate through large numbers of campaigns.

Operation
Read read
Schema command
kosmo integrations:schema klaviyo.klaviyo_list_campaigns --json
ParameterTypeRequiredDescription
limit integer no Number of campaigns to return (default 20, max 100).
page_cursor string no Pagination cursor from a previous response to fetch the next page.

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.