Your ERP knows the status of every order. Your loyalty tool knows who has just become a VIP. Klaviyo knows neither.
The Klaviyo API is there to close that gap. Klaviyo is not just for sending emails: it centralises your customer data, and its API lets you connect it to any tool, even one with no native connector.
At Standard Ecom, we build Klaviyo integrations like these every day.
This guide is for e-commerce directors, CTOs and CEOs who want to know what the API makes possible, and what it requires. What we cover : the definition, the types of API, step-by-step setup, the data you can sync, use cases, best practice and the mistakes to avoid.
What is the Klaviyo API and why is it central to your e-commerce stack?
An API (Application Programming Interface) lets two applications exchange data automatically, without anyone exporting a file or re-keying a single line.
The Klaviyo API applies this principle to your ecosystem. It connects the platform to the tools that already generate customer data:
- your CMS or online shop
- your sales CRM
- your ERP and stock management
- your loyalty programme
- your customer support solution
- your business intelligence tool
Klaviyo can only segment and trigger on what it receives. An order from the ERP, a ticket closed by support or a loyalty tier reached reaches it in real time, instead of staying in the application that created it.
Klaviyo handles an average of 1.6 billion API calls a day (Klaviyo, 2026), a volume that shows how robust the infrastructure behind your integrations is.

What types of API does Klaviyo offer?
Klaviyo offers two families of API: server-side APIs, called from your systems with a private key, and client-side APIs, called from a browser or mobile app with the public key. Webhooks complete the set by sending data from Klaviyo back to your tools.
Server-side APIs: read, create and manage your data
The server-side APIs follow a REST architecture and exchange data in JSON format.
They give access to your whole account, split into specialised APIs:
- Profiles: create and update customer profiles
- Events: send your customers’ actions (order placed, subscription started, product viewed, added to basket)
- Lists and Segments: manage your lists and segments programmatically
- Catalogs: sync your product catalogue, essential for recommendations on a shop with no native integration
- Campaigns and Flows: control your sends
- Metrics and Reporting: extract your results
For large volumes, such as a first ERP sync of tens of thousands of profiles, bulk imports send the data in batches rather than one call per profile.
Client-side APIs: capture behaviour on your site and app
Client-side APIs are called directly from the browser or a mobile app, using the public key. They record what happens on the visitor’s side: product viewed, added to basket, sign-up through a form.
On platforms with a native integration (Shopify, WooCommerce, Magento 2, PrestaShop, BigCommerce), the Klaviyo tracking script is installed automatically. Our PrestaShop and Klaviyo guide walks through this setup for one of them. On a headless shop or a custom-built platform, the script and the client-side calls have to be added by hand.

Webhooks: send data back to your tools
Most data flows into Klaviyo, but webhooks also allow the reverse route. Placed in a flow, a webhook can tell your loyalty tool that a customer has just entered a VIP journey, or ask your sales CRM to create a task.
How do you set up the Klaviyo API step by step?
Public key vs private key: understanding the difference
The public key is for client-side APIs, the private key for server-side APIs.
The public key, which Klaviyo also calls the site ID, is a short identifier unique to each account. It gives no access to sensitive data and can sit in your site’s code. It can still be used to send sign-ups and events from the browser, so protect your forms against fake sign-ups with double opt-in or a captcha.
Private keys, on the other hand, read data and manage sensitive objects such as lists, profiles and subscriptions, so treat them with the same confidentiality as a password.
There is no limit on how many you create. Set up one per integration so you can trace incoming data and revoke access without affecting the others. Only account owners and admins can reach the API keys tab.
For a third-party app or a technical partner connecting to several accounts, Klaviyo recommends OAuth rather than a private key.
Create a private API key and run your first call
In Klaviyo, click your organisation name in the bottom left, then Settings, then API keys. The Create Private API Key button opens the setup screen, where you name the key (ERP Sync, BI Dashboard) and choose its access level from:
- Read-only
- Full
- Custom
Choose Custom and only enable the permissions you need, read or write, on profiles, events or lists. You can then test the key from the command line. This call simply returns your account details. For this test, the key needs read access to Accounts, otherwise Klaviyo returns a 403 error.
curl –request GET \
–url https://a.klaviyo.com/api/accounts \
–header ‘Authorization: Klaviyo-API-Key your-private-key’ \
–header ‘accept: application/vnd.api+json’ \
–header ‘revision: 2026-07-15’
Standard Ecom tip
A private key is only displayed when it is created. Open your password manager before you click Create, and save the key under its exact Klaviyo name.
What data should you sync through the Klaviyo API?
Four families of data pass through the API, each with its own purpose.
Profiles are identified by email address, phone number or an external ID (external_id), for example the one from your ERP or CRM. Each profile then carries the name, address and any custom properties you add, from a date of birth to an RFM score calculated elsewhere.
Events describe behaviour:
- orders placed,
- products viewed,
- abandoned baskets,
- support tickets,
- event registrations.
Lists and segments can both be managed programmatically, but not in the same way. In a list, you add and remove profiles yourself. A segment fills itself based on its conditions: the API lets you create and read it, not add a profile to it manually.
Performance data, finally, is extracted through the Reporting API: segment size, additions, opens, clicks and conversions (Reporting API documentation). Klaviyo Academy offers a dedicated module on custom reports.

Watch out for consent: creating or updating a profile through the API does not subscribe it to your emails or SMS. Subscribing goes through a dedicated call, which records consent. Importing customers from your ERP who have never agreed to your marketing communications, then emailing them, exposes you to GDPR risk as much as to spam filters.
What are the real-world e-commerce use cases for the Klaviyo API?
Trigger journeys from external events
A customer signs up for your pop-up shop through a third-party form. The API passes the event to Klaviyo, which triggers a thank-you flow with a personalised offer.
The same logic applies to loyalty. Your tool uses the API to report that a customer has reached VIP status, and Klaviyo launches the exclusive campaign reserved for that tier. Almost all of our custom automated journeys start from a trigger like this, and they rely on flow architectures built to last.
Segment using your external data
Connect a CRM or a data warehouse, and your Klaviyo segments can draw on:
- customer lifetime value (LTV),
- loyalty score,
- product category purchased,
- or acquisition channel.
Your promotions, content and send schedule can then rely on criteria that native integrations do not pass through.
Standard Ecom tip
Store each piece of external data in a dedicated, prefixed property, such as crm_loyalty_score, rather than in an existing Klaviyo field. You always know where each value comes from, and a failed sync overwrites nothing.
Centralise reporting in a BI tool
The Reporting API extracts the metrics you want to compare with your other channels in a single dashboard:
- attributed revenue
- open and click rates
- average order value
- segment trends
The figures go down to the level of an individual campaign message, so you can compare two variants of the same send. Your teams then read revenue attribution in the same place as the rest of their data.
Best practice and mistakes to avoid with the Klaviyo API
A first call that works is only the beginning: what matters is that the sync still holds up in six months. Here are the six points we check in every audit, with the incident each one prevents.
Klaviyo API best practice · findings from our audits · September 2026
| Best practice | The incident it prevents | Technical benchmark |
|---|---|---|
| Never expose a private key | Key picked up from a public Git repository or a front-end script | Server-side calls; if a key leaks, create a new one and disable the old one |
| Apply least privilege | One compromised integration opens up the whole account | One key per integration, Custom level, only the permissions strictly needed |
| Respect rate limits | Requests rejected with a 429 error and data lost | From 1 to 350 calls per second at peak depending on the endpoint, retries with exponential backoff |
| Pin the API version | Silent breakage at the next release | Dated revision header on every request |
| Monitor error codes | Dead sync spotted weeks later | Automatic alert on 4xx and 5xx codes |
| Follow the official documentation | Endpoint retired or specification changed without notice | Keep an eye on Klaviyo’s developer portal |
These limits change over time, so check them in the developer documentation before going live.
Expert view
“At Darwin Microfluidics, some of the most useful data was not in the shop but in their data warehouse. We used it to classify each customer as an academic or industrial lab, then sent that information to Klaviyo through the API. The emails can now follow up with each lab when its budget renews, with a tailored message.”
Justine Bassin, Head of Marketing, Standard Ecom
Why get expert support to integrate the Klaviyo API?
A poorly scoped integration costs more to fix than to get right from the start. The wrong identifier creates duplicates, a badly named field mixes two sources, and an import without consent exposes the brand to GDPR risk.
We support brands such as Chloé, Jimmy Fairly, Mustela and Delsey with the technical setup and optimisation of their Klaviyo accounts, as our success stories show.
Our team works on:
- API connections with your existing tools: ERP, CRM and BI
- structuring your customer data and naming your properties
- the architecture of the automated flows that use this data
Read nextNew to the platform? Start with our guide What is Klaviyo and how does it work?
Your Klaviyo API questions answered
What is the difference between Klaviyo’s public API key and private API key?
The public key, or site ID, is used by the client-side APIs and can be visible in your site’s code. It can send sign-ups and events, so protect your forms. The private key reads and modifies profiles, lists and subscriptions, and must never leave your server.
Does the Klaviyo API work with Shopify, Magento and headless CMSs?
Yes. Shopify, WooCommerce, Magento 2, PrestaShop and BigCommerce have a native integration that installs the tracking script automatically. Headless shops and custom-built platforms use the server-side and client-side APIs, with the tracking script added by hand.
How many private API keys can you create in a Klaviyo account?
As many as you need. Create one per integration, with permissions limited to its purpose, so you can trace where data comes from and revoke access without cutting off the others.
What should you do if a Klaviyo private API key has been exposed publicly?
Create a new key, update the integration concerned, then disable the old one in the API keys tab. Then review the events received during the exposure to spot any suspicious writes.
Do you need development skills to use the Klaviyo API?
For a test call, no: a single cURL command is enough. In production, yes, because handling errors, rate limits and versions requires maintained code, often entrusted to an agency.
Can you send data from Klaviyo to another tool?
Yes. A webhook placed in a flow sends information to the tool of your choice when a customer reaches that step. To retrieve data in bulk, such as profiles or campaign results, your tools query the API directly.








