productivity
Klaviyo CLI for Shell Scripts
Use the Klaviyo CLI for shell scripts with headless JSON commands, schema discovery, credentials, and permission controls.
15 functions 10 read 5 write API key auth
Klaviyo CLI for Shell Scripts
Call integration functions from shell scripts with stable JSON input and output.
Use shell scripts for small local automations that need one or more integration calls. The Klaviyo CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# Klaviyo CLI for Shell Scripts
kosmokrator integrations:configure klaviyo --enable --read allow --write ask --json
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 Discovery Before Execution
Agents and scripts can inspect Klaviyo docs and schemas 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 Useful Klaviyo CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
klaviyo.klaviyo_create_profile | Write | email, phone_number, first_name, last_name, properties | 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. |
klaviyo.klaviyo_get_profile | Read | profile_id | Retrieve a single Klaviyo profile by its ID. Returns the full profile including email, phone number, name, and custom properties. |
klaviyo.klaviyo_update_profile | Write | profile_id, email, phone_number, first_name, last_name, properties | 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. |
klaviyo.klaviyo_list_profiles | Read | limit, page_cursor | 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. |
klaviyo.klaviyo_subscribe_profile | Write | list_id, email, phone_number, consented_at | 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. |
klaviyo.klaviyo_create_event | Write | profile_id, event_name, properties, value, time | 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. |
klaviyo.klaviyo_get_event | Read | event_id | Retrieve a single Klaviyo event by its ID. Returns the event with its metric name, properties, value, timestamp, and associated profile. |
klaviyo.klaviyo_list_events | Read | filter, limit, page_cursor | 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. |
klaviyo.klaviyo_list_lists | Read | limit, page_cursor | 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. |
klaviyo.klaviyo_create_list | Write | name | Create a new list in Klaviyo. Provide a name for the list. Returns the newly created list with its ID. |
klaviyo.klaviyo_get_list | Read | list_id | Retrieve a single Klaviyo list by its ID. Returns the list's name, member count, and other metadata. |
klaviyo.klaviyo_list_list_profiles | Read | list_id, limit, page_cursor | 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. |
klaviyo.klaviyo_list_flows | Read | limit, page_cursor | 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. |
klaviyo.klaviyo_get_flow | Read | flow_id | Retrieve a single Klaviyo flow by its ID. Returns the flow's name, status, trigger type, and other metadata. |
klaviyo.klaviyo_list_campaigns | Read | limit, page_cursor | 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. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.