Klaviyo - Printing Press CLI
Prerequisites: Install the CLI
This skill drives the klaviyo-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
- Install via the Printing Press installer. It defaults binaries to
$HOME/.local/binon macOS/Linux and%LOCALAPPDATA%\Programs\PrintingPress\binon Windows:
```bash
npx -y @mvanhorn/printing-press-library install klaviyo --cli-only
```
- Verify:
klaviyo-pp-cli --version - Ensure the reported install directory is on
$PATHfor the agent/runtime that will invoke this skill.
If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer):
go install github.com/mvanhorn/printing-press-library/library/marketing/klaviyo/cmd/klaviyo-pp-cli@latest
If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.
When to Use This CLI
Use this CLI when an agent needs to inspect or operate Klaviyo without the web UI, especially for profiles, events, campaigns, flows, segments, templates, metrics, and compound growth workflows.
Generated with Printing Press 4.35.4 against Klaviyo API revision 2026-10-15. Every request sends revision: 2026-10-15.
At this revision, a campaign is a container. Messages carry status and send time; campaign-audiences carry included and excluded lists and segments; variations carry channel, template, subject, and sender. IDs issued before 2026-10-15 are now message IDs. Campaign workflows accept either a container ID or a historical campaign/message ID and resolve its audiences and variations. The raw campaigns get-id read expects a container ID and explains historical IDs on a 404.
Default local databases and response caches are scoped by a non-secret API-key fingerprint and honor XDG paths. Use an explicit --db only when intentionally selecting a tenant-specific store.
Unique Capabilities
These capabilities aren't available in any other tool for this API.
Campaign operations
campaigns deploy- Create an email template and a campaign with an inline audience, message, and email variation, then verify that the result is an unscheduled draft.
Repeat --list-id and --segment-id to include audiences; repeat --exclude for excluded list or segment IDs. --preview-text, --reply-to, and --send-timezone set the email preview, reply address, and timezone. The reply address defaults to the sender and the timezone defaults to the account timezone. Use --template-file for an HTML file or --template-html for inline HTML. Deployment never schedules or sends the campaign.
```bash
klaviyo-pp-cli campaigns deploy --template-file ./email.html --campaign-name "Acme offer" \
--list-id LIST_ID --list-id SECOND_LIST_ID --segment-id SEGMENT_ID --exclude EXCLUDED_ID \
--subject "Acme offer" --preview-text "This week's offer" --from-email marketing@example.com \
--from-label "Acme" --reply-to replies@example.com --send-timezone America/Chicago --json
```
campaigns test-send- Run the same campaign checks asplan qa-gate, then send template previews for email variations to up to five recipients. Use it to review a draft in an inbox before launch; a failed QA verdict sends nothing.
Repeat --to or use comma-separated addresses; without --to, recipients come from KLAVIYO_TEST_SEND_TO. --variation-id limits preview sends to one email variation while QA still checks the campaign. --dry-run runs QA and shows planned sends without sending. Preview POSTs are never retried; an ambiguous result says "unknown, check the inbox".
--brand reads Klaviyo's brand kit (brand colors, logos, buttons, email defaults), warns on off-brand colors and old logos, and fails on a missing footer. Add --brand-strict-neutrals to flag grays that are not in the palette.
```bash
klaviyo-pp-cli campaigns test-send --campaign-id CAMPAIGN_ID --to qa@example.com --json
```
campaigns image-swap- Replace an image URL in every targeted email variation's template while preserving the rest of the draft.
_Agents can make safe creative swaps without rebuilding a whole campaign._
```bash
klaviyo-pp-cli campaigns image-swap --campaign-id CAMPAIGN_ID --old-url https://cdn.example.com/old.jpg --new-url https://cdn.example.com/new.jpg --json
```
campaigns ab-test create- Add one to six subject-line alternatives to an unscheduled draft email message. The existing variation is A; new variations B through G share A's template and sender fields.
Repeat --subject for each new variation. Preview text is copied from A unless --preview-text is repeated once per new subject. Empty subjects, duplicate subjects, scheduled messages and existing tests are refused. --campaign-id accepts a container with exactly one email message or a message ID; containers with several messages list the IDs to choose from.
--winner-metric accepts clicks (default), opens or orders. --test-percent defaults to 20 and accepts 1 to 100; this share is split evenly across all variations, and the remaining share receives the winner. --wait-hours defaults to 4 and accepts 1 to 264. Apple Mail Privacy Protection inflates opens, so clicks or orders pick a truer winner.
--dry-run reads current state and prints the plan without writing. Creates are attempted once; a failed create or settings update triggers best-effort deletion of this run's known new variations. An ambiguous create can leave an unconfirmed variation and reports that uncertainty. A successful command re-reads subjects, settings, draft status and send time. It never schedules or sends. Run campaigns test-send --campaign-id acme-message-id afterward to preview every variation.
```bash
klaviyo-pp-cli campaigns ab-test create --campaign-id acme-message-id \
--subject "Acme: a new way to start" --subject "Start with Acme today" \
--preview-text "Your next step" --preview-text "See what's new" \
--winner-metric clicks --test-percent 20 --wait-hours 4 --dry-run --json
```
campaigns ab-test results- Read recipient counts, unique opens and clicks, rates, orders, revenue and revenue per recipient for each email variation. Unsent messages returntoo_earlywithout querying reports. Missing variation rows produce zeros for available metrics.
--metric accepts clicks, opens or orders; it defaults to the test's winner metric, then clicks. The rate leader must beat every other variation in a two-sided pooled two-proportion z-test with p < 0.05 for clear_winner; otherwise the verdict is no_clear_winner. P-values, an opens privacy note and small-sample notes (fewer than 100 selected metric events) accompany the result. When the winner audience share is positive, the most-mailed variation is labelled as a Klaviyo winner inferred from recipient counts.
Reports use the day before the send date through now in KLAVIYO_TIMEZONE (default UTC), capped to the provider's 364-day window. --conversion-metric-id overrides the default Shopify Placed Order auto-resolution. If auto-resolution cannot find a usable order metric, clicks and opens use Received Email for reporting; orders, revenue and revenue per recipient are unavailable (null in JSON), with a note. Comparing orders requires a usable order metric. JSON includes message ID, A/B settings, timeframe, variations, verdict, leader, p-values and notes.
```bash
klaviyo-pp-cli campaigns ab-test results --campaign-id acme-message-id --metric clicks --json
```
Flow and form operations
flows insert-step- Preview one new action after an existing flow action. Use--step-filefor a JSON action definition without links, or--stdinto read it from stdin; add--applyto insert it once and verify placement.
--after identifies the existing action. --link selects next, next_if_true, next_if_false, or a multi-branch branch ID. Unsupported step types are refused, and timing or logic steps in a live flow require --allow-live-action.
```bash
klaviyo-pp-cli flows insert-step FLOW_ID --after ACTION_ID --step-file ./step.json --json
```
forms publish- Review live-versus-draft changes and the last 30 days of views, submits, and submit rate before publishing a form. The default is a preview;--applypublishes and re-reads the form to verify its status.
```bash
klaviyo-pp-cli forms publish FORM_ID --apply --json
```
forms unpublish- Take a live form down after reviewing its draft and performance evidence. The default is a preview;--applyunpublishes and verifies the status.
```bash
klaviyo-pp-cli forms unpublish FORM_ID --apply --json
```
Both form commands refuse a draft A/B test. --dry-run always previews, even with --apply; ambiguous publish or unpublish requests are never retried.
Behavior graph analytics
flow-decay- Identify flows whose open or click performance has decayed across recent time buckets using synced local data.
_Agents can spot lifecycle automations that need refresh before revenue falls further._
```bash
klaviyo-pp-cli flow-decay --days 90 --threshold 0.15 --json
```
cohort- Group profiles by first event date and compute retention or repeat-action curves from synced profiles and events.
_Agents can answer which acquisition cohorts keep buying without exporting CSVs._
```bash
klaviyo-pp-cli cohort --metric "Placed Order" --interval month --json --select cohort,profiles,retained
```
attribution- Join order events with campaign and flow attribution properties to summarize revenue by channel and source.
_Agents can explain which automation or campaign generated revenue using local event evidence._
```bash
klaviyo-pp-cli attribution --metric "Placed Order" --group-by flow --since 2026-01-01 --json
```
Reporting
send-budget- Compare email sends in the current billing period with the plan cap and scheduled email message recipient estimates. Use it before scheduling more sends; later periods are shown against the same cap, and missing estimates remain unknown rather than zero.
Missing or stale estimates are refreshed with estimation jobs by default. --wait bounds that work (default two minutes); --no-refresh uses GET requests only.
```bash
klaviyo-pp-cli send-budget --no-refresh --json
```
campaign-values-reports- Query campaign performance with the required statistics, timeframe, and conversion metric request attributes. The conversion metric defaults to the account's Shopify Placed Order metric.
```bash
klaviyo-pp-cli campaign-values-reports --timeframe last_12_months --statistics recipients,opens,clicks,conversion_value --agent
```
report targeting- Resolve campaign audiences against both segments and lists, then join sends, attributed revenue, last-mailed dates, exclusions, and distinct never-mailed collections.
```bash
klaviyo-pp-cli report targeting --timeframe last_12_months --agent
```
Data hygiene
list-quality-score- Score every list using API-valid collection fields plus paced per-listprofile_countenrichment.
```bash
klaviyo-pp-cli list-quality-score --json --no-cache
```
segments get --with-counts- Enrich returned segments with current profile counts. Thelistalias has the same behavior. Add--allfor every page; count requests are paced at Klaviyo's 1/s burst and 15/m steady limit and honorRetry-After.
```bash
klaviyo-pp-cli segments get --all --with-counts --json --no-cache
```
dedup- Find profiles that appear duplicated by email, phone, or cross-channel collisions in the local profile mirror.
_Agents can flag customer records that split behavior and revenue history across identities._
```bash
klaviyo-pp-cli dedup --by email,phone --json
```
reconcile- Compare campaign UTM evidence with local Klaviyo order events and optional Shopify credentials when available.
_Agents can check whether campaign performance agrees with order evidence before reporting numbers._
```bash
klaviyo-pp-cli reconcile --campaign-id CAMPAIGN_ID --since 2026-01-01 --json
```
Growth planning
plan brief-to-strategy- Turn a growth brief into a structured Klaviyo campaign, flow, segment, and experiment strategy.
_Agents can convert strategy notes into a concrete Klaviyo execution plan._
```bash
klaviyo-pp-cli plan brief-to-strategy --brief ./brief.md --json
```
plan qa-gate- Run a launch-readiness checklist for links, offers, dates, timezone, fallback tokens, unsubscribe placement, compliance, and deliverability flags.
_Agents can block risky campaign launches with explicit findings instead of vague review notes._
```bash
klaviyo-pp-cli plan qa-gate --campaign-id CAMPAIGN_ID --html ./email.html --json
```
--brand reads Klaviyo's brand kit (brand colors, logos, buttons, email defaults), warns on off-brand colors and old logos, and fails on a missing footer. Add --brand-strict-neutrals to flag grays that are not in the palette.
Command Reference
accounts - accounts
klaviyo-pp-cli accounts get- Retrieve the account(s) associated with a given private API key. This will return 1 account object within the array....klaviyo-pp-cli accounts get-id- Retrieve a single account object by its account ID. You can only request the account by which the private API key...
back-in-stock-subscriptions - Manage back in stock subscriptions
klaviyo-pp-cli back-in-stock-subscriptions- Subscribe a profile to receive back in stock notifications. Check out [our Back in Stock API...
campaign-clone - Manage campaign clone
klaviyo-pp-cli campaign-clone- Clones an existing campaign, returning a new campaign based on the original with a new ID and name.<br><br>*Rate...
campaign-message-assign-template - Manage campaign message assign template
klaviyo-pp-cli campaign-message-assign-template- Assign a non-reusable template copy to an email variation.--data-idis a variation ID, or a message ID with exactly one email variation.--stdinpreserves the body while resolving the ID and checking unsubscribe links.
campaign-messages - Manage campaign messages
klaviyo-pp-cli campaign-messages get- List campaign messages with optional filters. Messages carry status and send time; channel and content belong to variations.klaviyo-pp-cli campaign-messages update- Update a campaign message<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:campaigns:write
campaign-recipient-estimation-jobs - Manage campaign recipient estimation jobs
klaviyo-pp-cli campaign-recipient-estimation-jobs get- Retrieve the status of a recipient estimation job triggered with theCreate Campaign Recipient Estimation Job...klaviyo-pp-cli campaign-recipient-estimation-jobs refresh-campaign-recipient-estimation- Trigger an asynchronous job to update the estimated number of recipients for the given campaign ID. Use the `Get...
campaign-recipient-estimations - Manage campaign recipient estimations
klaviyo-pp-cli campaign-recipient-estimations <id>- Get the estimated recipient count for a campaign with the provided campaign ID. You can refresh this count by using...
campaign-send-jobs - Manage campaign send jobs
klaviyo-pp-cli campaign-send-jobs cancel-campaign-send- Permanently cancel the campaign, setting the status to CANCELED or revert the campaign, setting the status back to...klaviyo-pp-cli campaign-send-jobs get- Get a campaign send job<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:campaigns:readklaviyo-pp-cli campaign-send-jobs send-campaign- Trigger a campaign to send asynchronously<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...
campaign-values-reports - Manage campaign values reports
klaviyo-pp-cli campaign-values-reports- Returns the requested campaign analytics values data<br><br>Rate limits:<br>Burst:1/s<br>Steady:...
campaigns - campaigns
Use campaigns deploy for an unscheduled email draft and campaigns test-send for QA followed by inbox previews. Use campaigns ab-test create for subject-line alternatives and campaigns ab-test results to compare their performance.
campaigns create translates legacy --data-attributes-name and --data-attributes-campaign-messages into the new definition, messages, and variations; a legacy audience object becomes one inline audience. --stdin bodies pass through unchanged and must already use the new model. The flags --data-attributes-send-options, --data-attributes-send-strategy, and --data-attributes-tracking-options were removed: put campaign send_settings in --data-attributes-definition and supported message settings (is_add_utm, throttling_type) in --data-attributes-messages.
klaviyo-pp-cli campaigns create- Creates a campaign given a set of parameters, then returns it.<br><br>Rate limits:<br>Burst:10/s<br>Steady:...klaviyo-pp-cli campaigns delete- Delete a campaign with the given campaign ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...klaviyo-pp-cli campaigns get- List campaign containers with optional filters. No channel filter is required or supported on this collection; read message status and send time from messages and channel from variations.klaviyo-pp-cli campaigns get-id- Read a campaign container by ID. A 404 explains that IDs from before 2026-10-15 are now message IDs.klaviyo-pp-cli campaigns update- Update a campaign with the given campaign ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...
catalog-categories - Manage catalog categories
klaviyo-pp-cli catalog-categories create-catalog-category- Create a new catalog category.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:catalogs:writeklaviyo-pp-cli catalog-categories delete-catalog-category- Delete a catalog category using the given category ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...klaviyo-pp-cli catalog-categories get- Get all catalog categories in an account. Catalog categories can be sorted by the following fields, in ascending and...klaviyo-pp-cli catalog-categories get-catalog-category- Get a catalog category with the given category ID.<br><br>Rate limits:<br>Burst:350/s<br>Steady:3500/m...klaviyo-pp-cli catalog-categories update-catalog-category- Update a catalog category with the given category ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...
catalog-category-bulk-create-jobs - Manage catalog category bulk create jobs
klaviyo-pp-cli catalog-category-bulk-create-jobs bulk-create-catalog-categories- Create a catalog category bulk create job to create a batch of catalog categories. Accepts up to 100 catalog...klaviyo-pp-cli catalog-category-bulk-create-jobs get-bulk-create-categories-job- Get a catalog category bulk create job with the given job ID. Anincludeparameter can be provided to get the...klaviyo-pp-cli catalog-category-bulk-create-jobs get-bulk-create-categories-jobs- Get all catalog category bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate...
catalog-category-bulk-delete-jobs - Manage catalog category bulk delete jobs
klaviyo-pp-cli catalog-category-bulk-delete-jobs bulk-delete-catalog-categories- Create a catalog category bulk delete job to delete a batch of catalog categories. Accepts up to 100 catalog...klaviyo-pp-cli catalog-category-bulk-delete-jobs get-bulk-delete-categories-job- Get a catalog category bulk delete job with the given job ID.<br><br>Rate limits:<br>Burst:350/s<br>Steady:...klaviyo-pp-cli catalog-category-bulk-delete-jobs get-bulk-delete-categories-jobs- Get all catalog category bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate...
catalog-category-bulk-update-jobs - Manage catalog category bulk update jobs
klaviyo-pp-cli catalog-category-bulk-update-jobs bulk-update-catalog-categories- Create a catalog category bulk update job to update a batch of catalog categories. Accepts up to 100 catalog...klaviyo-pp-cli catalog-category-bulk-update-jobs get-bulk-update-categories-job- Get a catalog category bulk update job with the given job ID. Anincludeparameter can be provided to get the...klaviyo-pp-cli catalog-category-bulk-update-jobs get-bulk-update-categories-jobs- Get all catalog category bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate...
catalog-item-bulk-create-jobs - Manage catalog item bulk create jobs
klaviyo-pp-cli catalog-item-bulk-create-jobs bulk-create-catalog-items- Create a catalog item bulk create job to create a batch of catalog items. Accepts up to 100 catalog items per...klaviyo-pp-cli catalog-item-bulk-create-jobs get-bulk-create-catalog-items-job- Get a catalog item bulk create job with the given job ID. Anincludeparameter can be provided to get the...klaviyo-pp-cli catalog-item-bulk-create-jobs get-bulk-create-catalog-items-jobs- Get all catalog item bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst:...
catalog-item-bulk-delete-jobs - Manage catalog item bulk delete jobs
klaviyo-pp-cli catalog-item-bulk-delete-jobs bulk-delete-catalog-items- Create a catalog item bulk delete job to delete a batch of catalog items. Accepts up to 100 catalog items per...klaviyo-pp-cli catalog-item-bulk-delete-jobs get-bulk-delete-catalog-items-job- Get a catalog item bulk delete job with the given job ID.<br><br>Rate limits:<br>Burst:350/s<br>Steady:...klaviyo-pp-cli catalog-item-bulk-delete-jobs get-bulk-delete-catalog-items-jobs- Get all catalog item bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst:...
catalog-item-bulk-update-jobs - Manage catalog item bulk update jobs
klaviyo-pp-cli catalog-item-bulk-update-jobs bulk-update-catalog-items- Create a catalog item bulk update job to update a batch of catalog items. Accepts up to 100 catalog items per...klaviyo-pp-cli catalog-item-bulk-update-jobs get-bulk-update-catalog-items-job- Get a catalog item bulk update job with the given job ID. Anincludeparameter can be provided to get the...klaviyo-pp-cli catalog-item-bulk-update-jobs get-bulk-update-catalog-items-jobs- Get all catalog item bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst:...
catalog-items - Manage catalog items
klaviyo-pp-cli catalog-items create- Create a new catalog item.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:catalogs:writeklaviyo-pp-cli catalog-items delete- Delete a catalog item with the given item ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:...klaviyo-pp-cli catalog-items get- Get all catalog items in an account. Catalog items can be sorted by the following fields, in ascending and...klaviyo-pp-cli catalog-items get-catalogitems- Get a specific catalog item with the given item ID.<br><br>Rate limits:<br>Burst:350/s<br>Steady:3500/m...klaviyo-pp-cli catalog-items update- Update a catalog item with the given item ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:...
catalog-variant-bulk-create-jobs - Manage catalog variant bulk create jobs
klaviyo-pp-cli catalog-variant-bulk-create-jobs bulk-create-catalog-variants- Create a catalog variant bulk create job to create a batch of catalog variants. Accepts up to 100 catalog variants...klaviyo-pp-cli catalog-variant-bulk-create-jobs get-bulk-create-variants-job- Get a catalog variant bulk create job with the given job ID. Anincludeparameter can be provided to get the...klaviyo-pp-cli catalog-variant-bulk-create-jobs get-bulk-create-variants-jobs- Get all catalog variant bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst:...
catalog-variant-bulk-delete-jobs - Manage catalog variant bulk delete jobs
klaviyo-pp-cli catalog-variant-bulk-delete-jobs bulk-delete-catalog-variants- Create a catalog variant bulk delete job to delete a batch of catalog variants. Accepts up to 100 catalog variants...klaviyo-pp-cli catalog-variant-bulk-delete-jobs get-bulk-delete-variants-job- Get a catalog variant bulk delete job with the given job ID.<br><br>Rate limits:<br>Burst:350/s<br>Steady:...klaviyo-pp-cli catalog-variant-bulk-delete-jobs get-bulk-delete-variants-jobs- Get all catalog variant bulk delete jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst:...
catalog-variant-bulk-update-jobs - Manage catalog variant bulk update jobs
klaviyo-pp-cli catalog-variant-bulk-update-jobs bulk-update-catalog-variants- Create a catalog variant bulk update job to update a batch of catalog variants. Accepts up to 100 catalog variants...klaviyo-pp-cli catalog-variant-bulk-update-jobs get-bulk-update-variants-job- Get a catalog variate bulk update job with the given job ID. Anincludeparameter can be provided to get the...klaviyo-pp-cli catalog-variant-bulk-update-jobs get-bulk-update-variants-jobs- Get all catalog variant bulk update jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst:...
catalog-variants - Manage catalog variants
klaviyo-pp-cli catalog-variants create- Create a new variant for a related catalog item.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...klaviyo-pp-cli catalog-variants delete- Delete a catalog item variant with the given variant ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...klaviyo-pp-cli catalog-variants get- Get all variants in an account. Variants can be sorted by the following fields, in ascending and descending order:...klaviyo-pp-cli catalog-variants get-catalogvariants- Get a catalog item variant with the given variant ID.<br><br>Rate limits:<br>Burst:350/s<br>Steady:3500/m...klaviyo-pp-cli catalog-variants update- Update a catalog item variant with the given variant ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...
client - client
klaviyo-pp-cli client bulk-create-events- Create new events to track a profile's activity. This endpoint is specifically designed to be called from...klaviyo-pp-cli client create-back-in-stock-subscription- Subscribe a profile to receive back in stock notifications. Check out [our Back in Stock API...klaviyo-pp-cli client create-event- Create a new event to track a profile's activity. This endpoint is specifically designed to be called from...klaviyo-pp-cli client create-profile- Create or update properties about a profile without tracking an associated event. This endpoint is specifically...klaviyo-pp-cli client create-push-token- Create or update a push token. This endpoint is specifically designed to be called from our mobile SDKs...klaviyo-pp-cli client create-review- Create a review with the given ID. This endpoint is for client-side environments only.<br><br>*Rate...klaviyo-pp-cli client create-subscription- Creates a subscription and consent record for email and/or SMS channels based on the providedemailand...klaviyo-pp-cli client get-geofences- Get all geofences in an account. Returns a paginated list of all geofences for the specified company. This is the GA...klaviyo-pp-cli client get-review-values-reports- Get all reviews values reports in an account.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mklaviyo-pp-cli client get-reviews- Get all reviews. This endpoint is for client-side environments only, for server-side use, refer to...klaviyo-pp-cli client unregister-push-token- Unregister a push token. This endpoint is specifically designed to be called from our mobile SDKs...
conversation-messages - Manage conversation messages
klaviyo-pp-cli conversation-messages- Send an outbound message to a conversation. Requires OAuth authentication and account-level enablement. To request...
coupon-code-bulk-create-jobs - Manage coupon code bulk create jobs
klaviyo-pp-cli coupon-code-bulk-create-jobs bulk-create-coupon-codes- Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we...klaviyo-pp-cli coupon-code-bulk-create-jobs get-bulk-create-coupon-code-jobs- Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst:...klaviyo-pp-cli coupon-code-bulk-create-jobs get-bulk-create-coupon-codes-job- Get a coupon code bulk create job with the given job ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...
coupon-codes - Manage coupon codes
klaviyo-pp-cli coupon-codes create- Synchronously creates a coupon code for the given coupon.<br><br>Rate limits:<br>Burst:350/s<br>Steady:...klaviyo-pp-cli coupon-codes delete- Deletes a coupon code specified by the given identifier synchronously. If a profile has been assigned to the coupon...klaviyo-pp-cli coupon-codes get- Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a...klaviyo-pp-cli coupon-codes get-couponcodes- Returns a Coupon Code specified by the given identifier.<br><br>Rate limits:<br>Burst:350/s<br>Steady:3500/m...klaviyo-pp-cli coupon-codes update- Updates a coupon code specified by the given identifier synchronously. We allow updating the 'status' and...
coupons - coupons
klaviyo-pp-cli coupons create- Creates a new coupon.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:coupons:writeklaviyo-pp-cli coupons delete- Delete the coupon with the given coupon ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:...klaviyo-pp-cli coupons get- Get all coupons in an account. To learn more, see our [Coupons API...klaviyo-pp-cli coupons get-id- Get a specific coupon with the given coupon ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...klaviyo-pp-cli coupons update- Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:coupons:write
custom-metrics - Manage custom metrics
klaviyo-pp-cli custom-metrics create- Create a new custom metric. Custom metric objects must include anameanddefinition.<br><br>*Rate...klaviyo-pp-cli custom-metrics delete- Delete a custom metric with the given custom metric ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/m...klaviyo-pp-cli custom-metrics get- Get all custom metrics in an account.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:metrics:readklaviyo-pp-cli custom-metrics get-custommetrics- Get a custom metric with the given custom metric ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/m...klaviyo-pp-cli custom-metrics update- Update a custom metric with the given custom metric ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:...
data-privacy-deletion-jobs - Manage data privacy deletion jobs
klaviyo-pp-cli data-privacy-deletion-jobs- Request a deletion for the profiles corresponding to one of the following identifiers:email,phone_number, or...
data-source-record-bulk-create-jobs - Manage data source record bulk create jobs
klaviyo-pp-cli data-source-record-bulk-create-jobs- Create a bulk data source record import job to create a batch of records. Accepts up to 500 records per request. The...
data-source-record-create-jobs - Manage data source record create jobs
klaviyo-pp-cli data-source-record-create-jobs- Create a data source record import job to create a single record. The maximum allowed payload size per-record is...
data-sources - Manage data sources
klaviyo-pp-cli data-sources create- Create a new data source in an account<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:...klaviyo-pp-cli data-sources delete- Delete a data source in an account.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:...klaviyo-pp-cli data-sources get- Get all data sources in an account.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:...klaviyo-pp-cli data-sources get-datasources- Retrieve a data source in an account.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:...
event-bulk-create-jobs - Manage event bulk create jobs
klaviyo-pp-cli event-bulk-create-jobs- Create a batch of events for one or more profiles. Note that this endpoint allows you to create new profiles or...
events - events
klaviyo-pp-cli events create- Create a new event to track a profile's activity. Note that this endpoint allows you to create a new profile or...klaviyo-pp-cli events get- Get all events in an account Requests can be sorted by the following fields:datetime,timestamp[Custom...klaviyo-pp-cli events get-id- Get an event with the given event ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...
flow-actions - Manage flow actions
klaviyo-pp-cli flow-actions get- Get a flow action from a flow with the given flow action ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/m...klaviyo-pp-cli flow-actions update- Update a flow action.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:flows:write
flow-messages - Manage flow messages
klaviyo-pp-cli flow-messages <id>- Get a flow message from a flow with the given flow message ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:...
klaviyo-pp-cli flow-messages template get-for-flow-message <id>- Read the template related to a flow message.klaviyo-pp-cli flow-messages flow-action get-action-for-flow-message <id>- Read the flow action related to a flow message.
flow-series-reports - Manage flow series reports
klaviyo-pp-cli flow-series-reports- Returns the requested flow analytics series data<br><br>Rate limits:<br>Burst:1/s<br>Steady:2/m<br>Daily:...
flow-values-reports - Manage flow values reports
klaviyo-pp-cli flow-values-reports- Returns the requested flow analytics values data<br><br>Rate limits:<br>Burst:1/s<br>Steady:2/m<br>Daily:...
flows - flows
klaviyo-pp-cli flows create- Create a new flow using an encoded flow definition. New objects within the flow definition, such as actions, will...klaviyo-pp-cli flows delete- Delete a flow with the given flow ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:flows:writeklaviyo-pp-cli flows get- Get all flows in an account. Returns a maximum of 50 flows per request, which can be paginated with cursor-based...klaviyo-pp-cli flows get-id- Get a flow with the given flow ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:flows:readklaviyo-pp-cli flows update- Update the status of a flow with the given flow ID, and all actions in that flow.<br><br>Rate limits:<br>Burst:...
form-series-reports - Manage form series reports
klaviyo-pp-cli form-series-reports- Returns the requested form analytics series data.<br><br>Rate limits:<br>Burst:1/s<br>Steady:2/m<br>Daily:...
form-values-reports - Manage form values reports
klaviyo-pp-cli form-values-reports- Returns the requested form analytics values data.<br><br>Rate limits:<br>Burst:1/s<br>Steady:2/m<br>Daily:...
form-versions - Manage form versions
klaviyo-pp-cli form-versions <id>- Get the form version with the given ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:forms:read
klaviyo-pp-cli form-versions form get-for-version <id>- Read the form associated with a form version.klaviyo-pp-cli form-versions relationships get-form-id-for-form-version <id>- Read only the associated form ID.
forms - forms
klaviyo-pp-cli forms create- Create a new form.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:forms:writeklaviyo-pp-cli forms delete- Delete a given form.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:forms:writeklaviyo-pp-cli forms get- Get all forms in an account.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:forms:readklaviyo-pp-cli forms get-id- Get the form with the given ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:forms:read
image-upload - Manage image upload
klaviyo-pp-cli image-upload- Upload an image from a file. If you want to import an image from an existing url or a data uri, use the Upload Image...
images - images
klaviyo-pp-cli images get- Get all images in an account.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:images:readklaviyo-pp-cli images get-id- Get the image with the given image ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...klaviyo-pp-cli images update- Update the image with the given image ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...klaviyo-pp-cli images upload-from-url- Import an image from a url or data uri. If you want to upload an image from a file, use the Upload Image From File...
lists - lists
klaviyo-pp-cli lists create- Create a new list.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/m<br>Daily:150/dScopes:lists:writeklaviyo-pp-cli lists delete- Delete a list with the given list ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...klaviyo-pp-cli lists get- Get all lists in an account. Filter to request a subset of all lists. Lists can be filtered byid,name,...klaviyo-pp-cli lists get-id- Get a list with the given list ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m<br><br>Rate limits when...klaviyo-pp-cli lists update- Update the name of a list with the given list ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/m...
mapped-metrics - Manage mapped metrics
klaviyo-pp-cli mapped-metrics get- Get all mapped metrics in an account.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:metrics:readklaviyo-pp-cli mapped-metrics get-mappedmetrics- Get the mapped metric with the given ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:...klaviyo-pp-cli mapped-metrics update- Update the mapped metric with the given ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/m<br>Daily:30/d...
metric-aggregates - Manage metric aggregates
klaviyo-pp-cli metric-aggregates- Query and aggregate event data associated with a metric, including native Klaviyo metrics, integration-specific...
metric-properties - Manage metric properties
klaviyo-pp-cli metric-properties <id>- Get a metric property with the given metric property ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/m...
klaviyo-pp-cli metric-properties metric get-for-property <id>- Read the metric associated with a metric property.klaviyo-pp-cli metric-properties relationships get-metric-id-for-metric-property <id>- Read only the associated metric ID.
metrics - metrics
klaviyo-pp-cli metrics get- Get all metrics in an account. Requests can be filtered by the following fields: integrationname, integration...klaviyo-pp-cli metrics get-id- Get a metric with the given metric ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...
profile-bulk-import-jobs - Manage profile bulk import jobs
klaviyo-pp-cli profile-bulk-import-jobs bulk-import-profiles- Create a bulk profile import job to create or update a batch of profiles. Accepts up to 10,000 profiles per request....klaviyo-pp-cli profile-bulk-import-jobs get-bulk-import-profiles-job- Get a bulk profile import job with the given job ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/m...klaviyo-pp-cli profile-bulk-import-jobs get-bulk-import-profiles-jobs- Get all bulk profile import jobs. Returns a maximum of 100 jobs per request.<br><br>Rate limits:<br>Burst:...
profile-import - Manage profile import
klaviyo-pp-cli profile-import- Given a set of profile attributes and optionally an ID, create or update a profile. Returns 201 if a new profile was...
profile-merge - Manage profile merge
klaviyo-pp-cli profile-merge- Merge a given related profile into a profile with the given profile ID. The profile provided underrelationships...
profile-subscription-bulk-create-jobs - Manage profile subscription bulk create jobs
klaviyo-pp-cli profile-subscription-bulk-create-jobs- Subscribe one or more profiles to email marketing, SMS marketing, WhatsApp, or push. If the provided list has double...
profile-subscription-bulk-delete-jobs - Manage profile subscription bulk delete jobs
klaviyo-pp-cli profile-subscription-bulk-delete-jobs- > 🚧 > > Profiles not in the specified list will be globally unsubscribed. Always verify profile list membership...
profile-suppression-bulk-create-jobs - Manage profile suppression bulk create jobs
klaviyo-pp-cli profile-suppression-bulk-create-jobs bulk-suppress-profiles- Manually suppress profiles by email address or specify a segment/list ID to suppress all current members of a...klaviyo-pp-cli profile-suppression-bulk-create-jobs get-bulk-suppress-profiles-job- Get the bulk suppress profiles job with the given job ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...klaviyo-pp-cli profile-suppression-bulk-create-jobs get-bulk-suppress-profiles-jobs- Get the status of all bulk profile suppression jobs.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...
profile-suppression-bulk-delete-jobs - Manage profile suppression bulk delete jobs
klaviyo-pp-cli profile-suppression-bulk-delete-jobs bulk-unsuppress-profiles- Manually unsuppress profiles by email address or specify a segment/list ID to unsuppress all current members of a...klaviyo-pp-cli profile-suppression-bulk-delete-jobs get-bulk-unsuppress-profiles-job- Get the bulk unsuppress profiles job with the given job ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:...klaviyo-pp-cli profile-suppression-bulk-delete-jobs get-bulk-unsuppress-profiles-jobs- Get all bulk unsuppress profiles jobs.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:...
profiles - profiles
klaviyo-pp-cli profiles create- Create a new profile. Use theadditional-fieldsparameter to include subscriptions and predictive analytics data...klaviyo-pp-cli profiles get- Get all profiles in an account. Profiles can be sorted by the following fields in ascending and descending order:...klaviyo-pp-cli profiles get-id- Get the profile with the given profile ID. Use theadditional-fieldsparameter to include subscriptions and...klaviyo-pp-cli profiles update- Update the profile with the given profile ID. Use theadditional-fieldsparameter to include subscriptions and...
push-tokens - Manage push tokens
klaviyo-pp-cli push-tokens create- Create or update a push token. This endpoint can be used to migrate push tokens from another platform to Klaviyo....klaviyo-pp-cli push-tokens delete- Delete a specific push token based on its ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:...klaviyo-pp-cli push-tokens get- Return push tokens associated with company.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...klaviyo-pp-cli push-tokens get-pushtokens- Return a specific push token based on its ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:...
reviews - reviews
klaviyo-pp-cli reviews get- Get all reviews.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:reviews:readklaviyo-pp-cli reviews get-id- Get the review with the given ID.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:reviews:readklaviyo-pp-cli reviews update- Update a review.<br><br>Rate limits:<br>Burst:10/s<br>Steady:150/mScopes:reviews:write
segment-series-reports - Manage segment series reports
klaviyo-pp-cli segment-series-reports- Returns the requested segment analytics series data.<br><br>Rate limits:<br>Burst:1/s<br>Steady:...
segment-values-reports - Manage segment values reports
klaviyo-pp-cli segment-values-reports- Returns the requested segment analytics values data.<br><br>Rate limits:<br>Burst:1/s<br>Steady:...
segments - segments
klaviyo-pp-cli segments create- Create a segment.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/m<br>Daily:100/dScopes:segments:writeklaviyo-pp-cli segments delete- Delete a segment with the given segment ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:...klaviyo-pp-cli segments get- Get all segments in an account. Add--with-countsfor paced per-itemprofile_countenrichment and--allfor every page.klaviyo-pp-cli segments get-id- Get a segment with the given segment ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m<br><br>Rate...klaviyo-pp-cli segments update- Update a segment with the given segment ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/m<br>Daily:...
tag-groups - Manage tag groups
klaviyo-pp-cli tag-groups create- Create a tag group. An account cannot have more than 50 unique tag groups. Ifexclusiveis not specified...klaviyo-pp-cli tag-groups delete- Delete the tag group with the given tag group ID. Any tags inside that tag group, and any associations between those...klaviyo-pp-cli tag-groups get- List all tag groups in an account. Every account has one default tag group. Tag groups can be filtered byname,...klaviyo-pp-cli tag-groups get-taggroups- Retrieve the tag group with the given tag group ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/m...klaviyo-pp-cli tag-groups update- Update the tag group with the given tag group ID. Only a tag group'snamecan be changed. A tag group's...
tags - tags
klaviyo-pp-cli tags create- Create a tag. An account cannot have more than 500 unique tags. A tag belongs to a single tag group. If...klaviyo-pp-cli tags delete- Delete the tag with the given tag ID. Any associations between the tag and other resources will also be...klaviyo-pp-cli tags get- List all tags in an account. Tags can be filtered byname, and sorted bynameoridin ascending or descending...klaviyo-pp-cli tags get-id- Retrieve the tag with the given tag ID.<br><br>Rate limits:<br>Burst:3/s<br>Steady:60/mScopes:tags:readklaviyo-pp-cli tags update- Update the tag with the given tag ID. Only a tag'snamecan be changed. A tag cannot be moved from one tag group...
template-clone - Manage template clone
klaviyo-pp-cli --agent template-clone --template-id TEMPLATE_ID [--name NAME]- Clone a template. Reads source HTML to include any unsubscribe warning in stderr and JSON.
template-render - Manage template render
klaviyo-pp-cli template-render --stdin < request.json- Render a template from its JSON request body. A bodyless invocation fails before any request.campaign-message-assign-template --stdinalso accepts a complete JSON body; use either stdin or its body flags, never both. Assignment retains the unsubscribe compliance check.
template-universal-content - Manage template universal content
klaviyo-pp-cli template-universal-content create-universal-content- Create universal content. Currently supported block types are:button,drop_shadow,horizontal_rule,html,...klaviyo-pp-cli template-universal-content delete-universal-content- Delete the universal content with the given ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/m...klaviyo-pp-cli template-universal-content get-all-universal-content- Get all universal content in an account.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:...klaviyo-pp-cli template-universal-content get-universal-content- Get the universal content with the given ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:...klaviyo-pp-cli template-universal-content update-universal-content- Update universal content. Thedefinitionfield can only be updated on the following block types at this time:...
templates - templates
klaviyo-pp-cli templates create- Create a new HTML or drag-and-drop template. If there are 1,000 or more templates in an account, creation will fail...klaviyo-pp-cli templates delete- Delete a template with the given template ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:...klaviyo-pp-cli templates get- Get all templates in an account. Useadditional-fields[template]=definitionto include the full template...klaviyo-pp-cli templates get-id- Get a template with the given template ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:...klaviyo-pp-cli templates update- Update a template with the given template ID.<br><br>Rate limits:<br>Burst:75/s<br>Steady:750/mScopes:...
tracking-settings - tracking settings
klaviyo-pp-cli tracking-settings get- Get all UTM tracking settings in an account. Returns an array with a single tracking setting. More information about...klaviyo-pp-cli tracking-settings get-trackingsettings- Get the UTM tracking setting with the given account ID. More information about UTM tracking settings can be found...klaviyo-pp-cli tracking-settings update- Update the UTM tracking setting with the given account ID. More information about UTM tracking settings can be found...
web-feeds - web feeds
klaviyo-pp-cli web-feeds create- Create a web feed.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:web-feeds:writeklaviyo-pp-cli web-feeds delete- Delete the web feed with the given ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:...klaviyo-pp-cli web-feeds get- Get all web feeds for an account.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:web-feeds:readklaviyo-pp-cli web-feeds get-webfeeds- Get the web feed with the given ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:web-feeds:readklaviyo-pp-cli web-feeds update- Update the web feed with the given ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:...
webhook-topics - Manage webhook topics
klaviyo-pp-cli webhook-topics get- Get all webhook topics in a Klaviyo account.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:...klaviyo-pp-cli webhook-topics get-webhooktopics- Get the webhook topic with the given ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:...
webhooks - webhooks
klaviyo-pp-cli webhooks create- Create a new Webhook<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:webhooks:writeklaviyo-pp-cli webhooks delete- Delete a webhook with the given ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:webhooks:writeklaviyo-pp-cli webhooks get- Get all webhooks in an account.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:webhooks:readklaviyo-pp-cli webhooks get-id- Get the webhook with the given ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:webhooks:readklaviyo-pp-cli webhooks update- Update the webhook with the given ID.<br><br>Rate limits:<br>Burst:1/s<br>Steady:15/mScopes:...
Finding the right command
When you know what you want to do but not which command does it, ask the CLI directly:
klaviyo-pp-cli which "<capability in your own words>"
which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match - fall back to --help or use a narrower query.
Recipes
Inspect a profile compactly
klaviyo-pp-cli profiles get --page-size 1 --json --select data.id,data.email,data.first_name
Fetch one profile and select only the fields an agent needs.
Find a revenue metric
klaviyo-pp-cli metrics list --json --select data.id,data.name | jq '.data[] | select(.name=="Placed Order")'
Locate the Placed Order metric before attribution or cohort work.
Run a launch QA gate
klaviyo-pp-cli plan qa-gate --campaign-id CAMPAIGN_ID --html ./email.html --json
Review offer, link, unsubscribe, compliance, date, and deliverability findings before launch. Missing or broken unsubscribe tags fail the gate. A fail verdict exits nonzero after printing JSON. With --campaign-id and no --html, the command fetches every email variation's assigned template HTML; SMS and push variations do not use email checks. Use {% unsubscribe %} as standalone text or {% unsubscribe_link %} inside the Unsubscribe anchor's href; use {% manage_preferences_link %} inside the Manage Preferences anchor's href. Kit {{ unsubscribe_url }} and {{ manage_preferences_url }} tags fail even when mixed with a valid Klaviyo link. campaigns deploy, campaign-message-assign-template, and campaign-send-jobs send-campaign block before writing when the check fails. templates create, templates update, and template-clone allow the write with a stderr and JSON warning for flow and transactional templates.
⚠️ Pitfall: Configuration Conflict - Client Profile vs Env Var
If a client profile is selected and KLAVIYO_API_KEY is present without an
env:KLAVIYO_API_KEY reference in that profile, the CLI refuses with:
Error: configuration conflict: KLAVIYO_API_KEY cannot override a selected client profile
Unset an unrelated legacy key, or explicitly bind it to the selected profile:
klaviyo-pp-cli client source set acme --credential-ref env:KLAVIYO_API_KEY --expected-account-id 'trusted-account-id' --expected-org-name 'Acme'
klaviyo-pp-cli --client-profile acme campaigns get --agent
Provider data commands are tenant-gated, so omitting the client profile is not
a supported workaround. If the key exists only as a legacy environment value,
bind an exact credential reference with client source set (or create the
profile with client add) before running data commands.
Run klaviyo-pp-cli client list --agent to see which profiles are configured.
Auth Setup
Use a tenant-gated client profile for every data command:
teach, recall, learnings, and playbook also run through the selected profile's live tenant gate and use that profile's database and learning journal. Learned IDs, queries, and playbooks do not cross clients; a saved --profile of command flags is separate from the --client-profile tenant selector.
klaviyo-pp-cli client add acme --credential-ref 'op://Example/Klaviyo/private-api-key' --expected-account-id 'trusted-account-id' --expected-org-name 'Acme'
klaviyo-pp-cli client validate acme
klaviyo-pp-cli --client-profile acme whoami --no-cache
On hosts without 1Password, use --credential-ref env:KLAVIYO_API_KEY with the
same expected identity flags. --username-ref and named
--additional-credential-ref values also accept env:NAME. The variable must be
set and non-empty at use time; every reference still runs the live tenant gate.
Profiles, receipts, and command output retain references or safe metadata only.
Keep raw values out of run profiles, receipts, logs, and argv.
Agent Mode
Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.
- Pipeable - JSON on stdout, errors on stderr
- Filterable -
--selectkeeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
```bash
klaviyo-pp-cli accounts get --agent --select id,name,status
```
- Previewable -
--dry-runshows the request without sending - Offline-friendly - sync/search commands can use the local SQLite store when available
- Non-interactive - never prompts, every input is a flag
Response envelope
Commands that read from the local store or the API wrap output in a provenance envelope:
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <data>
}
Parse .results for data and .meta.source to know whether it's live or local. A human-readable N results (live) summary is printed to stderr only when stdout is a terminal - piped/agent consumers get pure JSON on stdout.
Agent Feedback
When you (or the agent) notice something off about this CLI, record it:
klaviyo-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
klaviyo-pp-cli feedback --stdin < notes.txt
klaviyo-pp-cli feedback list --json --limit 10
Entries are stored locally at ~/.klaviyo-pp-cli/feedback.jsonl. They are never POSTed unless KLAVIYO_FEEDBACK_ENDPOINT is set AND either --send is passed or KLAVIYO_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.
Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.
Output Delivery
Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:
| Sink | Effect |
|------|--------|
| stdout | Default; write to stdout only |
| file:<path> | Atomically write output to <path> (tmp + rename) |
| webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |
Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.
Named Profiles
A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.
klaviyo-pp-cli profile save briefing --json
klaviyo-pp-cli --profile briefing accounts get
klaviyo-pp-cli profile list --json
klaviyo-pp-cli profile show briefing
klaviyo-pp-cli profile delete briefing --yes
Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.
Exit Codes
| Code | Meaning |
|------|---------|
| 0 | Success |
| 2 | Usage error (wrong arguments) |
| 3 | Resource not found |
| 4 | Authentication required |
| 5 | API error (upstream issue) |
| 7 | Rate limited (wait and retry) |
| 10 | Config error |
Argument Parsing
Parse $ARGUMENTS:
- Empty,
help, or--help→ showklaviyo-pp-cli --helpoutput - Starts with
install→ ends withmcp→ MCP installation; otherwise → see Prerequisites above - Anything else → Direct Use (execute as CLI command with
--agent)
MCP Server Installation
The server uses the generator's code-orchestration surface: klaviyo_search discovers endpoints, klaviyo_get returns GET endpoint metadata without an API call, klaviyo_read runs read-only requests, and klaviyo_execute handles mutations. Local search, read-only sql, context, and the hand-written command tools are also available; there is no separate tool for each endpoint.
klaviyo_execute returns a preview until confirm is boolean true; the string "true" does not confirm a write. Confirmed campaign sends and template assignments run the same unsubscribe checks as the CLI. Set PRINTING_PRESS_CLIENT_PROFILE to an already configured profile such as acme in the MCP server's environment; the server and its learning commands stay bound to that profile.
- Install the MCP server:
```bash
go install github.com/mvanhorn/printing-press-library/library/marketing/klaviyo/cmd/klaviyo-pp-mcp@latest
```
- Register with Claude Code:
```bash
claude mcp add klaviyo-pp-mcp -- klaviyo-pp-mcp
```
- Verify:
claude mcp list
Direct Use
- Check if installed:
which klaviyo-pp-cli
If not found, offer to install (see Prerequisites at the top of this skill).
- Match the user query to the best command from the Unique Capabilities and Command Reference above.
- Execute with the
--agentflag:
```bash
klaviyo-pp-cli <command> [subcommand] [args] --agent
```
- If ambiguous, drill into subcommand help:
klaviyo-pp-cli <command> --help.