Skip to content

This page is available as Markdown at https://developers.klaviyo.com/en/docs/get_started.md. An index of every page is at https://developers.klaviyo.com/llms.txt.

KlaviyoKlaviyoDevelopers
v2026-10-15

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.

  1. In Klaviyo, go to Settings and select API keys.
  2. Under Private API Keys, select Create Private API Key.
  3. Name the key, then choose Custom Key and give Lists full access. This quickstart only needs the lists:read and lists:write scopes.
  4. 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:

bash
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, after Klaviyo-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.
  • accept and content-type: the API uses JSON:API, so request and response bodies are application/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:

json
{
  "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:

bash
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

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.

Last updated 2026-11-10