Get started with Klaviyo
Create a private API key and make your first call to the Klaviyo API in a few minutes.
You will learn
Klaviyo is a customer platform for email, SMS and push marketing, built on the data your customers create. The Klaviyo API lets your code read and change that data: profiles, events, lists, catalogs, campaigns and more.
In this quickstart, you'll create a private API key, use it to create a list, and check that the list appears in Klaviyo. It takes about five minutes.
Before you begin
You need a Klaviyo account. To keep test data out of your production account, create a test account first, and use it for every step below.
Creating an API key takes an Owner, Admin or Manager role on the account. Without one, ask someone who has one to create the key in Step 1 for you.
Step 1: Create a private API key
Server-side code authenticates with a private API key.
- In Klaviyo, go to Settings and select API keys.
- Under Private API Keys, select Create Private API Key.
- Name the key, then choose Custom Key and give Lists full access. This quickstart only needs the
lists:readandlists:writescopes. - Select Create, and copy the key to a secure location. Klaviyo doesn't show it again.
A private key starts with pk_. Never put it in code that runs in a browser or a mobile app; those use the account's public key with the client endpoints instead. See Authenticate API requests for both.
Step 2: Create a list
Send a Create List request, replacing your-private-api-key with your key:
curl --request POST \
--url https://a.klaviyo.com/api/lists \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2026-10-15' \
--data '{"data": {"type": "list", "attributes": {"name": "My first API list"}}}'Every request sends:
Authorization: your private key, afterKlaviyo-API-Key.revision: the API revision your code is written against. Klaviyo releases a new revision each quarter; see the changelog for what each one changed.acceptandcontent-type: the API uses JSON:API, so request and response bodies areapplication/vnd.api+json.
A successful request returns 201 Created and the new list, including its ID. Trimmed to those fields, the body looks like this:
{
"data": {
"type": "list",
"id": "Y6nRLr",
"attributes": {
"name": "My first API list"
}
}
}A 401 response means the key is missing or wrong, and a 403 that it doesn't have the lists:write scope. See Rate limits and error handling for every status code the API returns.
Step 3: Check the result
Get the new list with Get List, replacing your-list-id with the ID from Step 2:
curl --request GET \
--url https://a.klaviyo.com/api/lists/your-list-id \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'revision: 2026-10-15'The response has the list you created, named "My first API list". You can also find it in Klaviyo under Audience > Lists & segments.
Next steps
- Use an SDK. Klaviyo's SDKs for Python, Node.js, Ruby and PHP set the headers for you: Install a library.
- Add test data. Generate sample data fills a test account with sample Klaviyo, ecommerce and catalog data to build against.
- Learn the data model. Klaviyo's data model explains how profiles, events, metrics and lists relate, and Klaviyo's architecture how data flows through Klaviyo.
- Explore the API. The API reference covers every endpoint, and Klaviyo's Postman collections let you try them without code.
- Build an integration. If you're building an app for other Klaviyo accounts, see the partner resources.
- Take the developer certificate. The Klaviyo developer certificate covers Klaviyo's data model, its server-side and client-side APIs, and troubleshooting.
Not a developer?
The Help Center has how-to guides for using Klaviyo and connecting its built-in integrations. The API fundamentals for marketers learning path covers how to use and troubleshoot Klaviyo's API endpoints.