Ecommerce email platform
Klaviyo logo

Klaviyo API + MCP (2026): First Marketing ESP with GA MCP Server

Klaviyo’s API v2023 is one of the most modern and well-designed ESP APIs on the market. Stable date-versioned schema (revision header per request), 5 official SDKs, generous rate limits with distinct steady-state and burst budgets per endpoint category. What sets Klaviyo apart from every other marketing ESP in 2026: it ships an official Model Context Protocol server, Generally Available, letting Claude Desktop, Cursor, and ChatGPT (Pro/Plus) drive Klaviyo operations through natural language. This tab inventories the API surface, MCP capabilities, and the gotchas ecommerce buyers need to evaluate before committing.

At a glance

v2023
Current API revision
Date-versioned, backward-compatible
5
Official SDKs
Python, PHP, Ruby, Node.js, .NET
GA
Official MCP server
Generally Available in 2026

MCP integration in 2026

Model Context Protocol is the emerging standard for connecting LLM agents to external tools. Klaviyo is one of the first ecommerce marketing platforms to ship an official MCP server past the BETA phase — a signal of how seriously the company treats AI-agent-driven workflows.

Klaviyo ships an official MCP server — Generally Available in 2026

The Klaviyo MCP Server is officially maintained by Klaviyo (not community-forked) and reached General Availability in 2026 after a beta phase. Coverage spans profile operations (create, update, search), event tracking, segment management, campaign creation and sending, flow inspection, template management, and reporting queries. Compatible with Claude Desktop, Cursor, VSCode, and ChatGPT Pro/Plus (developer mode). Klaviyo is the first marketing-focused ESP to reach MCP GA status — competitor MCPs are either community-built (Mailchimp) or still BETA (MailerSend).

Available MCP servers for Klaviyo

Three ways to reach Klaviyo from an AI agent as of August 2026, ordered by maturity. Only the first is official Klaviyo, and it is the most maintained.

Why Klaviyo went GA on MCP first among marketing ESPs. Ecommerce marketing sits at the intersection of two workflows AI agents are unusually good at: data exploration (which segments perform best, why a flow underperformed) and content drafting (subject lines, campaign copy, template variations). Klaviyo’s product team recognized this fit early and prioritized MCP as a first-class surface. Expect the tool count and depth to expand quarterly through 2026 and 2027.

API v2023 essentials

Klaviyo’s API v2023 uses a date-based revision system (similar to Stripe): every request specifies a revision header, and Klaviyo maintains backward compatibility per revision. This is unusually developer-friendly for the ESP category.

Base URLhttps://a.klaviyo.com/api
Response formatJSON:API spec (typed relationships, sparse fieldsets, pagination cursors)
Revision headerrevision: 2023-10-15 (example) — required, date format
Authentication (server-side)Authorization: Klaviyo-API-Key YOUR_PRIVATE_KEY
Authentication (client-side)Public API key in query string (limited to specific endpoints)
Rate limitsPer-endpoint burst + steady-state limits (see rate-limits section)
PaginationCursor-based via page[cursor] and page[size] (max 100)
Sparse fieldsetsfields[profile]=email,phone_number to shrink payload
Response on rate exceedHTTP 429 with Retry-After header
Bulk operationsAsync job endpoints for profile imports, exports, segment operations

The JSON:API spec adds some verbosity (every object has type, id, attributes, relationships wrappers) but delivers cleaner semantics for graph-like customer data. If you have not used JSON:API before, expect a 30-minute learning curve; the official SDKs abstract most of the ceremony away.

Authentication methods

Two API key types, both operating through custom HTTP headers.

Private API key (server-side)

Used for the majority of API calls: profiles, events, segments, campaigns, flows, templates, reporting. Full read/write access at the account level. Generate under Account › Settings › API Keys. Send in the Authorization header:

Authorization: Klaviyo-API-Key pk_XXXXXXXXXXXXXXXX
revision: 2023-10-15
Content-Type: application/json
Accept: application/json

Private keys support optional scopes: read-only, campaign management, profile management, etc. Scoped keys are the recommended pattern for third-party integrations — unlike most ESPs, Klaviyo genuinely offers granular scopes.

Public API key (client-side)

Used for browser-safe operations: track events from client-side JavaScript, identify profiles, subscribe to lists. Six-character alphanumeric ID passed as a query parameter or in JavaScript SDK config. Cannot be used for read operations or destructive actions — safe to expose in front-end code.

Scoped API keys are unusually well-implemented. Most ESPs (Mailchimp, MailerLite, Postmark) do not offer granular scopes on their API tokens — a token can do anything the account allows. Klaviyo lets you generate keys scoped to read-only, full, or specific object categories. This is the right architecture for enterprise deployments with multiple third-party integrations. Use scoped keys and rotate on staff turnover.

Rate limits

Klaviyo publishes per-endpoint rate limits with distinct burst (short-window peak) and steady-state (per-minute sustained) buckets. This is more granular than any competitor ESP in 2026 — use it to your advantage when planning batch operations.

Endpoint categoryBurst limitSteady-state
Profiles (create, update, get)75/s700/min
Events (track custom events)350/s3,500/min
Lists / Segments (read)75/s700/min
Campaigns (CRUD)10/s150/min
Flows (CRUD)3/s60/min
Templates10/s150/min
Bulk profile import (async)N/A (job-based)10 concurrent jobs
Response on exceedHTTP 429 + Retry-After headerRetry per header value

The Events endpoint at 3,500/min steady-state is designed for high-volume ecommerce event ingestion (order placed, viewed product, added to cart, checkout started). For bulk profile operations, use the async job endpoints instead of looping single-profile calls — the job endpoints do not consume the 75/s profile burst budget.

Retry-After header is honored. Unlike Mailchimp (no Retry-After) or Postmark (informal enforcement), Klaviyo’s HTTP 429 responses always include a Retry-After header with the exact number of seconds to wait. Implement exponential backoff using the header value rather than a fixed schedule — this is the fastest way to stay compliant during traffic spikes.

Official SDKs

Five official client libraries maintained by Klaviyo. All auto-generated from the OpenAPI spec, updated per API revision release.

LanguagePackageInstallRepo
Pythonklaviyo-apipip install klaviyo-apiGitHub
PHPklaviyo/apicomposer require klaviyo/apiGitHub
Rubyklaviyo-api-sdkgem install klaviyo-api-sdkGitHub
Node.js / TypeScriptklaviyo-apinpm install klaviyo-apiGitHub
.NETKlaviyo.SDKInstall-Package Klaviyo.SDKGitHub

No official Go, Rust, Kotlin, or Swift SDKs. For those languages, call the API directly with your language’s HTTP client — the OpenAPI spec is public and can be used to generate a client with openapi-generator if needed. The 5 official SDKs are actively maintained per API revision — new SDK releases follow each date-versioned API revision within days.

Endpoints reference

The endpoint groups you will actually use in production. Full reference at developers.klaviyo.com.

ResourceHTTP methodsDescription
Profiles
/profiles
GET, POST, PATCHFull CRUD on profiles. Bulk import via async job endpoints. Custom properties as JSON.
Events
/events
GET, POSTTrack custom events (order placed, viewed product, added to cart). 3,500/min steady-state limit.
Lists
/lists
GET, POST, PATCH, DELETEStatic profile lists. Manage members via /lists/{id}/relationships/profiles.
Segments
/segments
GETRead dynamic segments (definition + member profiles). Segments are UI-created, API read-only.
Campaigns
/campaigns
GET, POST, PATCH, DELETEFull CRUD on email and SMS campaigns. Schedule, cancel, send now, get reports.
Campaign send job
/campaign-send-jobs
POST, GETTrigger a campaign send. Async job with status polling.
Flows
/flows
GET, PATCHList flows, activate/deactivate, view messages. Flow creation is UI-only.
Templates
/templates
GET, POST, PATCH, DELETEFull CRUD on email templates. HTML + text bodies.
Metrics
/metrics
GETQuery aggregate metric definitions (Placed Order, Received Email, etc.) and export values.
Reporting queries
/reporting/campaign-values
POSTQuery campaign performance (opens, clicks, revenue) by date range and grouping.
Data Privacy
/data-privacy-deletion-jobs
POST, GETGDPR-style right-to-erasure requests. Async job for profile + associated data removal.
Bulk profile import
/profile-bulk-import-jobs
POST, GETAsync bulk profile upsert. Preferred over looping POST /profiles for large imports.
Catalog items
/catalog-items
GET, POST, PATCH, DELETEProduct catalog for ecommerce recommendations and back-in-stock flows. Auto-synced by Shopify integration.

Code examples

Two representative snippets covering the most common first-day tasks: track an event, then upsert a profile.

Python: track an event and upsert profile properties

from klaviyo_api import KlaviyoAPI

client = KlaviyoAPI(
    api_key='pk_YOUR_PRIVATE_KEY',
    max_delay=60,
    max_retries=3
)

# Track a "Placed Order" event, upserting profile in the same call
response = client.Events.create_event({
    'data': {
        'type': 'event',
        'attributes': {
            'properties': {
                'OrderId': 'ORD-1234',
                'Total': 89.50,
                'Items': ['Product A', 'Product B']
            },
            'metric': {
                'data': {
                    'type': 'metric',
                    'attributes': {'name': 'Placed Order'}
                }
            },
            'profile': {
                'data': {
                    'type': 'profile',
                    'attributes': {
                        'email': 'customer@example.com',
                        'first_name': 'Alaa',
                        'last_name': 'Touil'
                    }
                }
            }
        }
    }
})

print(f"Event tracked: {response['data']['id']}")

Node.js: create a campaign and send it

const { KlaviyoApi } = require('klaviyo-api');

const client = new KlaviyoApi({ apiKey: 'pk_YOUR_PRIVATE_KEY' });

async function sendCampaign(listId) {
  // 1. Create the campaign
  const campaign = await client.Campaigns.createCampaign({
    data: {
      type: 'campaign',
      attributes: {
        name: 'Weekly Newsletter',
        audiences: { included: [listId] },
        send_options: { use_smart_sending: true },
        tracking_options: {
          is_add_utm: true,
          utm_params: [{ name: 'utm_source', value: 'klaviyo' }]
        }
      }
    }
  });

  // 2. Set message content (HTML + subject) - separate call
  // 3. Trigger send
  const job = await client.Campaigns.createCampaignSendJob({
    data: {
      type: 'campaign-send-job',
      id: campaign.data.id
    }
  });

  console.log(`Campaign send job created: ${job.data.id}`);
}

sendCampaign('LIST_ID_HERE').catch(console.error);

Common gotchas

Revision header is mandatory — missing it returns 400

Every API v2023 request MUST include a revision header with a valid date (e.g., revision: 2023-10-15). Missing this returns HTTP 400 with a message about missing revision. Pin your revision explicitly and only bump it when you have tested the newer schema.

JSON:API wrapper is verbose but correct

Klaviyo’s API returns JSON:API-shaped payloads with data.type, data.id, data.attributes, and data.relationships. This is more ceremony than a plain REST API but delivers cleaner semantics for related objects. Use the SDKs to abstract the wrapping if you find the raw shape verbose.

Flow creation is UI-only

You can list, activate, deactivate, and inspect flows via the API. You cannot create a new flow programmatically — the flow builder is UI-only (same pattern as Mailchimp’s Customer Journey Builder). Plan around this: build flow templates in the UI, then use the API to bulk-add profiles or trigger flow enrollment via events.

Segment creation is UI-only, but segments are API-readable

Similar to flows: you can read segment definitions and member profiles via API, but cannot create or modify segments programmatically. Use /lists for API-managed groupings; use /segments when the segment must be UI-editable and dynamic.

Rate limits are per-endpoint, not global

Each endpoint category has its own burst + steady-state budget. Hitting the campaign endpoint (10/s burst) does not consume the events endpoint budget (350/s burst). Plan your request patterns per endpoint category, and monitor Retry-After headers per endpoint.

Deprecations and changelog

Klaviyo maintains a public API changelog at developers.klaviyo.com/en/reference/api-revisions. Key items to know:

  • API v2023 is current. Date-versioned revisions maintain backward compatibility. New revisions add features; old revisions continue to work indefinitely.
  • Legacy v1 and v2 APIs deprecated. Klaviyo has communicated a shutoff timeline for the pre-2023 APIs. Migrate to v2023 for any active integration.
  • Klaviyo MCP Server released GA in 2026 after a beta phase. First marketing-focused ESP to reach MCP GA.
  • Scoped API keys added in 2024. Read-only + full + object-scoped tokens. Recommended pattern for third-party integrations.
  • Bulk profile import job endpoint added in 2023. Preferred over looping single-profile POST calls for large migrations.

Frequently asked questions

Does Klaviyo have an official MCP server for AI agents?

Yes. The Klaviyo MCP Server reached General Availability in 2026 after a beta phase. Officially maintained by Klaviyo. Wide coverage: profiles, events, segments, campaigns, flows, templates, reporting. Compatible with Claude Desktop, Cursor, VSCode, and ChatGPT Pro/Plus (developer mode). Klaviyo is the first marketing-focused ESP to reach MCP GA status — competitor MCPs are either community-built (Mailchimp) or still BETA (MailerSend).

Which programming languages have official Klaviyo SDKs?

Five official SDKs: Python, PHP, Ruby, Node.js/TypeScript, .NET. All auto-generated from the OpenAPI spec and updated per API revision release. No official Go, Rust, Kotlin, or Swift SDK — for those languages, use the public OpenAPI spec with openapi-generator or call the API directly with your standard HTTP client.

What is the Klaviyo API rate limit?

Per-endpoint burst and steady-state limits. Profiles: 75/s burst, 700/min steady. Events: 350/s burst, 3,500/min steady. Campaigns: 10/s burst, 150/min steady. Flows: 3/s burst, 60/min steady. HTTP 429 responses include a Retry-After header with exact wait time in seconds — implement exponential backoff using the header value. Unlike Mailchimp or Postmark, Klaviyo publishes concrete limits per endpoint category.

How do I authenticate with the Klaviyo API?

Two API key types. Private API key for server-side operations: Authorization: Klaviyo-API-Key pk_XXXXXXXXXXXXXXXX. Supports optional granular scopes (read-only, full, object-scoped) — unusual and welcome vs competitor ESPs. Public API key for browser-safe operations: 6-character alphanumeric ID in query string or JavaScript SDK config. Cannot read data or perform destructive actions.

What is the difference between Lists and Segments in the API?

Lists are static profile groupings, fully CRUD-able via API. Segments are dynamic definitions (rules-based membership) that Klaviyo evaluates continuously. Segments are UI-created and API read-only. Use /lists when you need programmatic membership control; use /segments when segmentation must be UI-editable and rule-based.

Can I send emails through Klaviyo from Claude Desktop or Cursor?

Yes. Install the official Klaviyo MCP Server and add it to your Claude Desktop or Cursor config. Configure with a Klaviyo Private API key. Once loaded, you can prompt operations like “Send the summer promo campaign to the VIP customers segment” and the agent creates the campaign and triggers the send through Klaviyo. Coverage includes profiles, events, segments, campaigns, flows, templates, and reporting.

Is the Klaviyo API v1 or v2 still supported?

Deprecated. Klaviyo has communicated a shutoff timeline for the pre-2023 APIs. All new development should target the current API v2023 with date-versioned revisions. Legacy integrations still on v1 or v2 should migrate promptly — the v2023 API offers cleaner semantics (JSON:API spec), granular scopes, and MCP compatibility.

Changelog (recent)

  • 2026-08-18 API + MCP tab published on SMTPedia. First profile documenting Klaviyo API v2023 alongside the GA MCP server for AI-agent workflows.
  • 2026-07-28 MCP specification 2026-07-28 released. Stateless HTTP transport becomes default. Klaviyo MCP already positioned for the new transport.
  • 2026 Klaviyo MCP Server reached General Availability. First marketing-focused ESP to ship a GA MCP server. Coverage: profiles, events, segments, campaigns, flows, templates, reporting.
AAlaa Touil RRabeb How we test →

This review follows our email infrastructure testing methodology. We disclose affiliate relationships in our editorial independence policy.