Klaviyo Developer
Expert-level guidance for building with the Klaviyo API — custom event tracking, profile management, SDK integration, webhooks, catalog sync, and data pipeline architecture.
For marketing strategy, flow auditing, segmentation, deliverability, and campaign optimization, see the klaviyo-analyst skill.
Install
git clone https://github.com/thatrebeccarae/claude-marketing.git && cp -r claude-marketing/skills/klaviyo-developer ~/.claude/skills/
MCP vs. SDK: When to Use Which
This skill is SDK-first by design — you're building production integrations against the Klaviyo API, not running ad-hoc queries. That said, Klaviyo's official MCP server is the right tool for parts of integration work, and you should know when to reach for it.
Use the SDK (klaviyo-api) when… | Use the MCP (https://mcp.klaviyo.com/mcp) when… |
|---|---|
| Writing production event-tracking code | Exploring an account's event schema before writing the integration |
| Building bulk import / sync pipelines | Sanity-checking that events landed with the right property shape |
| Implementing webhook handlers | Pulling a quick property inventory during integration design |
| Catalog sync jobs | Inspecting flow trigger conditions while debugging why an event isn't firing a flow |
| Anything in CI, cron, or a deployed service | Iterating on event schema design with the marketing analyst in the room |
The MCP wraps the same API this skill targets, so the schema rules, rate limits, and nesting constraints below apply equally to MCP-driven calls. The MCP is currently pinned to API revision 2026-04-15 — keep that in mind if you're versioning your own SDK code against an older revision.
For the full MCP tool inventory, OAuth setup, and read-only mode flag, see REFERENCE.md. For audit/analyst work, see the klaviyo-analyst skill — it's built around the MCP.
Core Capabilities
API Authentication & Versioning
- Private API key setup and key management best practices
- Public API key usage for client-side tracking (klaviyo.js)
- OAuth 2.0 authorization flow for third-party apps
- API revision headers and version lifecycle management
Custom Event Tracking
- Server-side event tracking via Events API
- Client-side tracking with klaviyo.js
- Event schema design and property naming conventions
- Idempotent event submission patterns
Profile Management
- Profile create, upsert, and bulk import patterns
- Custom property management and data types
- Subscription management (email, SMS consent)
- Profile merge and deduplication strategies
Webhooks
- Webhook subscription setup and event types
- Payload verification and signature validation
- Retry handling and idempotent webhook processing
SDK Usage & Libraries
- Python SDK (klaviyo-api)
- Node.js SDK (klaviyo-api-node)
- Ruby, PHP, and other community SDKs
- SDK initialization, error handling, and retry configuration
Catalog & Product Feed Sync
- Catalog item create/update/delete via API
- Category and variant management
- Product feed sync architecture for recommendations
- Handling large catalogs with bulk operations
Data Export & Warehouse Sync
- Metric aggregation API for reporting
- Profile and event export patterns
- Cursor-based pagination for large datasets
- ETL pipeline design for data warehouse integration
SDK Quick Reference
| Language | Package | Install |
|---|---|---|
| Python | klaviyo-api | pip install klaviyo-api |
| Node.js | klaviyo-api | npm install klaviyo-api |
| Ruby | klaviyo-api-sdk | gem install klaviyo-api-sdk |
| PHP | klaviyo/api | composer require klaviyo/api |
Rate Limits
| Endpoint Category | Limit | Window |
|---|---|---|
| Most endpoints | 75 requests | per second |
| Bulk imports | 10 requests | per second |
| Profile/Event create | 350 requests | per second |
| Campaign send | 10 requests | per second |
Headers returned: RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset
API Revision Timeline
| Revision | Key Changes |
|---|---|
| 2026-01-15 | Latest. Custom Objects Ingestion, Geofencing API (beta). |
| 2025-10-15 | Forms API, Flow Actions API, SMS ROI reporting. |
| 2025-07-15 | Mapped Metrics API, Custom Objects API (GA). |
| 2025-04-15 | Web Feeds API, Custom Metrics, Push Token registration. |
| 2025-01-15 | Reviews APIs, Flows Create API, Campaign image management. |
| 2024-10-15 | Universal Content API, Form/Segment Reporting, Reviews API. |
| 2024-07-15 | Forms API (retrieval), Webhooks API. |
| 2024-02-15 | Reporting API, Create or Update Profile (upsert). |
Always include the revision header in API requests.
Essential Developer Checklist
- API key management — Store private keys in environment variables, never commit to source. Rotate keys periodically.
- Revision header — Always include
revision: YYYY-MM-DDheader. Pin to a specific version. - Rate limit handling — Implement exponential backoff with jitter on 429 responses.
- Idempotent events — Include a unique
unique_idproperty to prevent duplicate event tracking. - Profile upserts — Use
POST /profiles/with existing identifier for upsert behavior (creates or updates). - Webhook verification — Validate webhook signatures before processing payloads.
- Pagination — Use cursor-based pagination for list endpoints. Never assume result counts.
- Error handling — Parse JSON:API error responses. Handle 4xx (client) and 5xx (server) differently.
- SDK initialization — Configure SDK with API key at app startup, not per-request.
- Testing — Use Klaviyo test/sandbox accounts. Mock API responses in unit tests.
Workflow: Custom Integration Setup
When building a custom Klaviyo integration:
- Define requirements — What events to track, what profile data to sync, what triggers are needed
- API key provisioning — Create a private API key with minimum required scopes
- Event schema design — Map business events to Klaviyo metric names and properties
- Profile sync strategy — Determine identifier (email vs phone vs external_id), upsert frequency
- Implement tracking — Server-side event tracking with proper error handling and retries
- Catalog sync (if applicable) — Product feed sync for recommendations and browse abandonment
- Webhook setup — Subscribe to relevant events, implement handler with signature verification
- Rate limit strategy — Queue and throttle API calls, implement backoff
- Monitoring — Log API errors, track event delivery rates, alert on failures
- Testing & validation — Verify events appear in Klaviyo, test flow triggers, validate profile data
Workflow: Integration Health Audit
When auditing an existing Klaviyo integration for health and data quality:
- Inventory active integrations — List all configured integrations (built-in and custom). Identify active vs stale connections.
- Map event sources — For each metric in the account, identify its source (built-in integration, custom API, Klaviyo-internal, form). Flag metrics with zero recent volume.
- Audit event schemas — Pull property structures for key events (Placed Order, Started Checkout, Viewed Product, Added to Cart). Check for:
- Missing standard properties (e.g.,
$value,ItemNames, line items) - Duplicate/redundant metrics (e.g., "Placed Order" and "Order Placed" from different sources)
- Inconsistent property naming (camelCase vs snake_case across events)
- Missing standard properties (e.g.,
- Check profile data pipeline — Verify profile properties are being synced correctly. Look for:
- Properties set by API vs properties set by events
- Stale properties (set once, never updated)
- Properties used in segmentation vs properties sitting unused
- Review catalog sync — Verify product catalog is synced and fresh. Check:
- Total