Connector guide — Klaviyo (klaviyo)
Fixed sections (Phase D1 format; tests/governance/test_onboarding_connector_guides.py pins them). Facts marked [Validated] are measured in code or tests; [Observed] facts carry a date; [Gap] names an open item. No credential, token, account identifier or tenant value appears in this file. No connector is unconditional; consent is the one universal requirement.
What it is
The customer's Klaviyo account (email/SMS). The private API key serves the KLV-1 pull half — aggregate campaign reporting only — and the optional webhook signing secret serves the flag-off webhook receiver. Catalog category email-sms, wave 1.
Status (measured)
[Validated] available: true in CONNECTOR_CATALOG (services/service-marketing-connectors/connector_credentials.py, measured 2026-10-12). Required field api_key; optional webhook_secret. Test connection calls Klaviyo's /api/accounts/ with the Klaviyo-API-Key header and the pinned revision. [Validated] the pull (klaviyo_connector.py) is structurally restricted to the campaigns list and the campaign-values report — _assert_aggregate_endpoint refuses any URL naming profiles, events, lists, segments or data-privacy resources — and reads the key from the vault with no environment fallback (503 klaviyo_ready_to_connect). [Validated] the webhook receiver (klaviyo_webhook.py) answers 404 while KLAVIYO_WEBHOOK_ENABLED is unset. Required only where the tenant declared the Klaviyo rail in pilot.measurement_rails. [Gap] OB-GAP-7: the W5 push rail still reads an environment variable, not this vault entry.
Who owns the account
The customer. The Klaviyo account and its API keys stay in the customer's name; MIZ OKI holds a key they can deactivate at any time and, for discovery, a read-only user seat they can remove (law 3).
Prerequisites
- The customer is an Owner or Admin of the Klaviyo account (only those roles can open the API keys tab).
- A private API key with read scope (sufficient for the pull half). Never a public key.
- For the webhook half only: a webhook created in Klaviyo pointing at the gateway's receiver, whose signing secret is issued when the webhook is created. The receiver is flag-off, so this is optional and a tenant without it is simply not webhook-connected.
- For the campaign-values report: the tenant's conversion metric id (for example the Placed Order metric) — see Known gaps.
Visibility invite (click path)
Klaviyo → Settings → Users → add user → a read-only role, to the Media Intelligence access seat (playbook §5). Vendor UIs drift — if a label differs, follow Klaviyo's current help article. This invite is for discovery; it is not the API connection.
Connecting in the onboarding UI
- Open
/onboarding→ Connectors → the Klaviyo card (shown as required only when the tenant declared the Klaviyo rail; otherwise optional). - In Klaviyo: account name (lower left) → Settings → Account → API keys → create a private API key with read scope. Paste it into
api_keyon the card — nowhere else (law 2). Klaviyo shows the value once. - Optionally enter
webhook_secret(issued when the webhook is created). - Click Test connection. Move on only when it passes.
Fields
| key | where the tenant finds it | format | secret? | required? |
|---|---|---|---|---|
api_key |
Settings → Account → API keys → Private API keys | catalog placeholder pk_…; never echoed, masked hint only |
yes | yes |
webhook_secret |
issued when the webhook is created in Klaviyo | catalog placeholder whsec_…; never echoed |
yes | no |
Test connection
| Failure | Plain-English fix |
|---|---|
422 missing_required_fields on api_key |
The private key is required; re-save the card with it. |
422 unknown_fields |
Only api_key and webhook_secret are accepted on this card; remove anything else. |
| "Klaviyo rejected the API key" (401/403) | The key is wrong, was deactivated, or is a public key. Create a new private key with read scope and re-save. |
| "Klaviyo answered HTTP |
Klaviyo did not answer 200 for /api/accounts/; retry once, then check the key's scopes. |
Sync: 503 klaviyo_ready_to_connect |
No Klaviyo key is stored for this tenant; complete the card. There is no environment fallback, by design. |
Sync: 422 conversion_metric_id_required |
Klaviyo's reporting API needs the tenant's conversion metric id on every values report; it must be passed with the sync request today (see Known gaps). |
| Webhook door answers 401 | Uniform by design: unknown tenant, no stored webhook_secret, or a bad signature are indistinguishable from outside. Save the signing secret on the card and re-create the webhook if needed. |
| Webhook door answers 404 | The receiver is flag-off (KLAVIYO_WEBHOOK_ENABLED unset); arming is an owner step. "Not yet available." |
404 not_configured (stored-credential test) |
Nothing is saved for this tenant yet; connect first. |
429 test_rate_limited |
More than 20 tests for this provider in 60 s from this tenant; wait the retry_after_seconds it names. |
| 503 fail-closed (vault error) | The credential vault could not be read; an operator checks vault health. Nothing for the customer to re-enter. |
What it feeds
The KLV-1 pull half: campaign_performance records (campaigns list + campaign-values report, aggregates only) into canonical ingestion → mizoki_unified_data, projected onto the account_klv_* / campaign_klv_* KG vocabulary. The webhook receiver (flag-off) forwards person events through the canonical door under the consent gate. The W5 push rail (measurement-rails/klaviyo_feed) is a separate lane that reads KLAVIYO_PRIVATE_API_KEY from its environment and reports not_configured until that is set — it does not read this vault entry (OB-GAP-7). Writebacks stay dark under MEASUREMENT_WRITEBACK=false; saving the key arms nothing (law 8).
Consent posture
The pull is aggregate campaign reporting and cannot reach person data (the aggregate-endpoint guard refuses profile, event, list and segment URLs). Webhook deliveries are person events: each passes the consent gate before the canonical door (fail-closed; redacted and counted without a per-subject basis), and no per-person KG node is ever minted. The tenant's consent declaration (P2-5) is required of every tenant and never substitutes for a per-subject basis. Consent is the one universal requirement; no connector is unconditional.
Revoke / offboard
Customer side: Settings → Account → API keys → create a replacement if needed and deactivate the old private key; delete the webhook; Settings → Users → remove the MIZ OKI seat. Platform side: the operator removes the tenant's klaviyo vault entry through the governed path, or offboards the whole tenant with POST /api/v1/tenant/offboard/credentials; readiness then reports connectors.klaviyo:not-configured where the rail is declared.
Known gaps
- OB-GAP-7 — the W5 push rail reads the environment, not the vault; a completed card can leave W5
not_configured. Never ask the tenant for the key twice. - OB-GAP-6 — one vault entry per provider per tenant.
- [Gap] No catalog field holds the conversion metric id:
klaviyo_connector.pyreadsconversion_metric_idfrom the request or "beside the credential", but the card refuses unknown keys (422), so today it can only arrive per sync request. A checklist row and catalog field are the fix (law 10); no OB-GAP id yet. - [Gap] The webhook receiver is flag-off; arming is owner-held.
Last verified
Catalog and readiness code measured 2026-10-12 on main 47309238. Vendor documentation: Klaviyo Developers — "Authenticate API requests" (developers.klaviyo.com/en/docs/authenticate_) — fetched 2026-10-12; Klaviyo Help Center — "How to manage your account's API keys" (help.klaviyo.com/hc/en-us/articles/115005062267) — fetched 2026-10-12. Lane records: docs/tenants/TENANT_ONBOARDING_CHECKLIST.md P2-3 and §5.3.