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.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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
No credentials are required.
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
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 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 Discovery
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 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.
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.
write - Parameters
- email, phone_number, first_name, last_name, properties
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 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
Retrieve a single Klaviyo profile by its ID. Returns the full profile including email, phone number, name, and custom properties.
read - Parameters
- profile_id
kosmo integrations:call klaviyo.klaviyo_get_profile '{"profile_id":"example_profile_id"}' --json kosmo integrations:klaviyo klaviyo_get_profile '{"profile_id":"example_profile_id"}' --json 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.
write - Parameters
- profile_id, email, phone_number, first_name, last_name, properties
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 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
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.
read - Parameters
- limit, page_cursor
kosmo integrations:call klaviyo.klaviyo_list_profiles '{"limit":1,"page_cursor":"example_page_cursor"}' --json kosmo integrations:klaviyo klaviyo_list_profiles '{"limit":1,"page_cursor":"example_page_cursor"}' --json 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.
write - Parameters
- list_id, email, phone_number, consented_at
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 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
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.
write - Parameters
- profile_id, event_name, properties, value, time
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 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
Retrieve a single Klaviyo event by its ID. Returns the event with its metric name, properties, value, timestamp, and associated profile.
read - Parameters
- event_id
kosmo integrations:call klaviyo.klaviyo_get_event '{"event_id":"example_event_id"}' --json kosmo integrations:klaviyo klaviyo_get_event '{"event_id":"example_event_id"}' --json 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.
read - Parameters
- filter, limit, page_cursor
kosmo integrations:call klaviyo.klaviyo_list_events '{"filter":"example_filter","limit":1,"page_cursor":"example_page_cursor"}' --json kosmo integrations:klaviyo klaviyo_list_events '{"filter":"example_filter","limit":1,"page_cursor":"example_page_cursor"}' --json 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.
read - Parameters
- limit, page_cursor
kosmo integrations:call klaviyo.klaviyo_list_lists '{"limit":1,"page_cursor":"example_page_cursor"}' --json kosmo integrations:klaviyo klaviyo_list_lists '{"limit":1,"page_cursor":"example_page_cursor"}' --json klaviyo.klaviyo_create_list
Create a new list in Klaviyo. Provide a name for the list. Returns the newly created list with its ID.
write - Parameters
- name
kosmo integrations:call klaviyo.klaviyo_create_list '{"name":"example_name"}' --json kosmo integrations:klaviyo klaviyo_create_list '{"name":"example_name"}' --json klaviyo.klaviyo_get_list
Retrieve a single Klaviyo list by its ID. Returns the list's name, member count, and other metadata.
read - Parameters
- list_id
kosmo integrations:call klaviyo.klaviyo_get_list '{"list_id":"example_list_id"}' --json kosmo integrations:klaviyo klaviyo_get_list '{"list_id":"example_list_id"}' --json 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.
read - Parameters
- list_id, limit, page_cursor
kosmo integrations:call klaviyo.klaviyo_list_list_profiles '{"list_id":"example_list_id","limit":1,"page_cursor":"example_page_cursor"}' --json kosmo integrations:klaviyo klaviyo_list_list_profiles '{"list_id":"example_list_id","limit":1,"page_cursor":"example_page_cursor"}' --json 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.
read - Parameters
- limit, page_cursor
kosmo integrations:call klaviyo.klaviyo_list_flows '{"limit":1,"page_cursor":"example_page_cursor"}' --json kosmo integrations:klaviyo klaviyo_list_flows '{"limit":1,"page_cursor":"example_page_cursor"}' --json klaviyo.klaviyo_get_flow
Retrieve a single Klaviyo flow by its ID. Returns the flow's name, status, trigger type, and other metadata.
read - Parameters
- flow_id
kosmo integrations:call klaviyo.klaviyo_get_flow '{"flow_id":"example_flow_id"}' --json kosmo integrations:klaviyo klaviyo_get_flow '{"flow_id":"example_flow_id"}' --json 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.
read - Parameters
- limit, page_cursor
kosmo integrations:call klaviyo.klaviyo_list_campaigns '{"limit":1,"page_cursor":"example_page_cursor"}' --json 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 5 parameters
kosmo integrations:schema klaviyo.klaviyo_create_profile --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 1 parameters
kosmo integrations:schema klaviyo.klaviyo_get_profile --json | Parameter | Type | Required | Description |
|---|---|---|---|
profile_id | string | yes | The Klaviyo profile ID. |
klaviyo.klaviyo_update_profile 6 parameters
kosmo integrations:schema klaviyo.klaviyo_update_profile --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 2 parameters
kosmo integrations:schema klaviyo.klaviyo_list_profiles --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 4 parameters
kosmo integrations:schema klaviyo.klaviyo_subscribe_profile --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 5 parameters
kosmo integrations:schema klaviyo.klaviyo_create_event --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 1 parameters
kosmo integrations:schema klaviyo.klaviyo_get_event --json | Parameter | Type | Required | Description |
|---|---|---|---|
event_id | string | yes | The Klaviyo event ID. |
klaviyo.klaviyo_list_events 3 parameters
kosmo integrations:schema klaviyo.klaviyo_list_events --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 2 parameters
kosmo integrations:schema klaviyo.klaviyo_list_lists --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 1 parameters
kosmo integrations:schema klaviyo.klaviyo_create_list --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | The name for the new list. |
klaviyo.klaviyo_get_list 1 parameters
kosmo integrations:schema klaviyo.klaviyo_get_list --json | Parameter | Type | Required | Description |
|---|---|---|---|
list_id | string | yes | The Klaviyo list ID. |
klaviyo.klaviyo_list_list_profiles 3 parameters
kosmo integrations:schema klaviyo.klaviyo_list_list_profiles --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 2 parameters
kosmo integrations:schema klaviyo.klaviyo_list_flows --json | Parameter | Type | Required | Description |
|---|---|---|---|
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 1 parameters
kosmo integrations:schema klaviyo.klaviyo_get_flow --json | Parameter | Type | Required | Description |
|---|---|---|---|
flow_id | string | yes | The Klaviyo flow ID. |
klaviyo.klaviyo_list_campaigns 2 parameters
kosmo integrations:schema klaviyo.klaviyo_list_campaigns --json | Parameter | Type | Required | Description |
|---|---|---|---|
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.