---
title: "Get started with Klaviyo"
description: "Create a private API key and make your first call to the Klaviyo API in a few minutes."
url: "https://developers.klaviyo.com/en/docs/get_started"
category: "Get started"
lastUpdated: "2026-11-10"
related: ["https://developers.klaviyo.com/en/docs/llms.txt","https://developers.klaviyo.com/en/docs/create_a_test_account.md","https://developers.klaviyo.com/en/docs/install_a_library.md","https://developers.klaviyo.com/en/docs/authenticate_.md","https://developers.klaviyo.com/en/docs/make_your_first_api_call.md"]
---

# Get started with Klaviyo

> This is the Markdown version of https://developers.klaviyo.com/en/docs/get_started

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.

> [!NOTE]
> Building with an AI agent? See [Set up your AI agent](https://developers.klaviyo.com/en/docs/agent_setup.md) to give it these docs as Markdown, the OpenAPI spec and Klaviyo's MCP server.

## Before you begin

You need a Klaviyo account. To keep test data out of your production account, [create a test account](https://developers.klaviyo.com/en/docs/create_a_test_account.md) 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](https://www.klaviyo.com/settings/account/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](https://developers.klaviyo.com/en/docs/authenticate_.md) for both.

## Step 2: Create a list

Send a [Create List](https://developers.klaviyo.com/en/reference/create_list.md) 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](https://developers.klaviyo.com/en/docs/changelog_.md) for what each one changed.
- `accept` and `content-type`: the API uses [JSON:API](https://jsonapi.org), 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](https://developers.klaviyo.com/en/docs/rate_limits_and_error_handling.md) for every status code the API returns.

## Step 3: Check the result

Get the new list with [Get List](https://developers.klaviyo.com/en/reference/get_list.md), 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

- **Use an SDK.** Klaviyo's SDKs for Python, Node.js, Ruby and PHP set the headers for you: [Install a library](https://developers.klaviyo.com/en/docs/install_a_library.md).
- **Add test data.** [Generate sample data](https://developers.klaviyo.com/en/docs/generate_sample_data.md) fills a test account with sample Klaviyo, ecommerce and catalog data to build against.
- **Learn the data model.** [Klaviyo's data model](https://developers.klaviyo.com/en/docs/introduction_to_klaviyos_data_model.md) explains how profiles, events, metrics and lists relate, and [Klaviyo's architecture](https://developers.klaviyo.com/en/docs/klaviyos_architecture.md) how data flows through Klaviyo.
- **Explore the API.** The [API reference](https://developers.klaviyo.com/en/reference.md) covers every endpoint, and [Klaviyo's Postman collections](https://developers.klaviyo.com/en/docs/use_klaviyos_postman_collections.md) let you try them without code.
- **Build an integration.** If you're building an app for other Klaviyo accounts, see the [partner resources](https://developers.klaviyo.com/en/docs/build_your_integration.md).
- **Take the developer certificate.** The [Klaviyo developer certificate](https://academy.klaviyo.com/klaviyo-developer-certificate?utm_source=dev_portal&utm_medium=referral&utm_campaign=developer_cert) covers Klaviyo's data model, its server-side and client-side APIs, and troubleshooting.

## Not a developer?

The [Help Center](https://help.klaviyo.com/hc/en-us) has how-to guides for using Klaviyo and connecting its built-in integrations. The [API fundamentals for marketers](https://academy.klaviyo.com/en-us/collections/api-fundamentals-for-marketers) learning path covers how to use and troubleshoot Klaviyo's API endpoints.
