Klaviyo
E-commerce email and SMS marketing platform with profiles, flows, campaigns, segments, and event tracking.
Klaviyo
E-commerce email and SMS marketing platform with profiles, flows, campaigns, segments, and event tracking.
Capabilities
| Integration | Available | Notes |
|---|---|---|
| API | ✓ | REST API with JSON:API spec, revision-versioned |
| MCP | ✓ | Official remote server at mcp.klaviyo.com (docs), checked 2026-10-27 |
| CLI | ✓ | [klaviyo.js](../clis/klaviyo.js) |
| SDK | ✓ | Python, Node.js, Ruby, PHP, Java, C# |
Authentication
- Type: Private API Key
- Header:
Authorization: Klaviyo-API-Key {private_api_key} - Revision Header:
revision: 2024-10-15(required on all requests) - Get key: Account Settings > API Keys at https://www.klaviyo.com/settings/account/api-keys
- Note: Private keys are prefixed with
pk_; public keys (6-char site ID) are for client-side only
Common Agent Operations
List profiles
GET https://a.klaviyo.com/api/profiles/?page[size]=20
# Filter by email
GET https://a.klaviyo.com/api/profiles/?filter=equals(email,"[email removed]")Create profile
POST https://a.klaviyo.com/api/profiles/
{
"data": {
"type": "profile",
"attributes": {
"email": "[email removed]",
"first_name": "Jane",
"last_name": "Doe",
"phone_number": "+15551234567"
}
}
}Update profile
PATCH https://a.klaviyo.com/api/profiles/{profileId}/
{
"data": {
"type": "profile",
"id": "{profileId}",
"attributes": {
"first_name": "Updated Name"
}
}
}List all lists
GET https://a.klaviyo.com/api/lists/Create list
POST https://a.klaviyo.com/api/lists/
{
"data": {
"type": "list",
"attributes": {
"name": "Newsletter Subscribers"
}
}
}Add profiles to list
POST https://a.klaviyo.com/api/lists/{listId}/relationships/profiles/
{
"data": [
{ "type": "profile", "id": "{profileId1}" },
{ "type": "profile", "id": "{profileId2}" }
]
}Track event
The monetary event value belongs in data.attributes, alongside properties. Custom event properties do not set the metric's monetary value. See the Create Event API.
POST https://a.klaviyo.com/api/events/
{
"data": {
"type": "event",
"attributes": {
"metric": {
"data": {
"type": "metric",
"attributes": { "name": "Placed Order" }
}
},
"profile": {
"data": {
"type": "profile",
"attributes": { "email": "[email removed]" }
}
},
"value": 99.99,
"properties": {
"items": ["Product A"]
},
"time": "2025-01-15T10:00:00Z"
}
}
}List campaigns
GET https://a.klaviyo.com/api/campaigns/?filter=equals(messages.channel,"email")List flows
GET https://a.klaviyo.com/api/flows/Update flow status
PATCH https://a.klaviyo.com/api/flows/{flowId}/
{
"data": {
"type": "flow",
"id": "{flowId}",
"attributes": {
"status": "live"
}
}
}List metrics
GET https://a.klaviyo.com/api/metrics/List segments
GET https://a.klaviyo.com/api/segments/API Pattern
Klaviyo uses the JSON:API specification. All request/response bodies use { "data": { "type": "...", "attributes": {...} } } format. Relationships are managed via /relationships/ sub-endpoints. The revision header is required on every request and determines API behavior version.
Key Metrics
Profile Fields
email- Email addressphone_number- Phone for SMSfirst_name,last_name- Name fieldsproperties- Custom properties objectsubscriptions- Email/SMS subscription status
Event Fields
metric- The metric/event nameproperties- Custom event propertiestime- Event timestampvalue- Monetary value (for revenue tracking)
Campaign/Flow Metrics
send_count- Number of sendsopen_rate- Open percentageclick_rate- Click percentagerevenue- Attributed revenue
Parameters
Common Query Parameters
page[size]- Results per page (default 20, max 100)page[cursor]- Cursor for paginationfilter- Filter expressions (e.g.,equals(email,"[email removed]"))sort- Sort field (prefix-for descending)include- Include related resourcesfields[resource]- Sparse fieldsets
When to Use
- E-commerce email/SMS marketing automation
- Syncing customer profiles from external systems
- Tracking purchase events and customer behavior
- Managing email flows and drip campaigns
- Segmenting audiences for targeted campaigns
- Reporting on campaign and flow performance
Rate Limits
- Steady-state: 75 requests/second for most endpoints
- Burst: up to 700 requests in 1 minute
- Rate limit headers:
RateLimit-Limit,RateLimit-Remaining,RateLimit-Reset - Lower limits on some write endpoints (profiles, events)
Relevant Skills
- emails
- ecommerce-email
- lifecycle-marketing
- customer-segmentation
Structured event properties
For product arrays and typed event fields, use a JSON object instead of the flat --property key:value,key:value shorthand:
node tools/clis/klaviyo.js events create --metric "Placed Order" --email [email removed] \
--properties '{"items":[{"SKU":"sku-1","quantity":2}],"VIP":true}' --value 42.50 --dry-run--properties preserves JSON types and nested values; it cannot be combined with --property. The CLI retains the existing API revision. API acceptance and eligibility for segmentation are separate: Klaviyo excludes some values (such as zero, null and empty strings) from segmentation. See the official Create Event API.
Source: https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/klaviyo.md
Author: coreyhaines31, Marketing skills. License: MIT.
Shown here with formatting for the web; email addresses removed. Keep the author and license notice when you reuse it.
Related entries
There are more like this in the members library
The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.