---
title: "Make a test API request"
description: "Test your connection via API request, confirm your authentication is working, and that your application can connect with Klaviyo's servers."
url: "https://developers.klaviyo.com/en/docs/make_your_first_api_call"
category: "Get started"
lastUpdated: "2026-11-06"
related: ["https://developers.klaviyo.com/en/docs/llms.txt","https://developers.klaviyo.com/en/docs/get_started.md"]
---

# Make a test API request

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

Test your connection via API request, confirm your authentication is working, and that your application can connect with Klaviyo's servers.

## Test POST request

```prompt Make a test request to the Klaviyo API
Make a test request to the Klaviyo API that creates a list, to check that my private API key works.

First read https://developers.klaviyo.com/en/docs/make_your_first_api_call.md.

Ask me for these before you change anything, unless I've already given them:
- The name of the environment variable that holds my private API key. If I'm using a test account, the key must belong to that account.
- A name for the test list.

Then:
1. Send `POST https://a.klaviyo.com/api/lists/` with these headers: `Authorization: Klaviyo-API-Key <key>`, `accept: application/json`, `content-type: application/json`, and `revision` set to the latest API revision, a date such as `2026-10-15`, which https://developers.klaviyo.com/en/reference/api_overview.md gives.
2. Send this body: `{"data": {"type": "list", "attributes": {"name": "<list name>"}}}`. The name is required.
3. Use curl unless I ask for a script. If I do, write it in this codebase's language, following its conventions.
4. Read the key from the environment variable in the command itself. Don't paste it into the command, print it, or write it to a file, and don't commit it.
5. Send the request once. It creates a real list in the account, so don't repeat it or send any other requests.

A successful response returns the new list's `id` and its `name`, `created` and `updated` attributes. If you get an error, show me the error body and what you think caused it.

When you're done, tell me the list ID and what you ran. Remind me to check the list exists by searching for its name in Lists & Segments (https://www.klaviyo.com/lists) in the account.
```

To check that your integration is working correctly, make a test request to the List API using the code below to create a new list. Replace `your-private-api-key` with your own private API key. If you are using a test account, first check the key is associated with your test account. 

A successful request returns the list ID of the newly created list, as well as its associated attributes.

```curl
curl --request POST \
     --url https://a.klaviyo.com/api/lists/ \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'revision: 2026-10-15' \
     --data '
{
     "data": {
          "type": "list",
          "attributes": {
							"name": "THIS IS REQUIRED"
              }
     }
}
```
```python
import requests

url = "https://a.klaviyo.com/api/lists/"

payload = {"data": {"type": "list"}}
headers = {
    "accept": "application/json",
    "revision": "2026-10-15",
    "content-type": "application/json",
    "Authorization": "Klaviyo-API-Key your-private-api-key"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```
```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://a.klaviyo.com/api/lists/', [
  'body' => '{"data":{"type":"list"}}',
  'headers' => [
    'Authorization' => 'Klaviyo-API-Key your-private-api-key',
    'accept' => 'application/json',
    'content-type' => 'application/json',
    'revision' => '2026-10-15',
  ],
]);

echo $response->getBody();
```
```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://a.klaviyo.com/api/lists/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["revision"] = '2026-10-15'
request["content-type"] = 'application/json'
request["Authorization"] = 'Klaviyo-API-Key your-private-api-key'
request.body = "{\"data\":{\"type\":\"list\"}}"

response = http.request(request)
puts response.read_body
```
```json Success
{
  "data": {
    "type": "list",
    "id": "string",
    "attributes": {
      "name": "string",
      "created": "2022-10-19T16:10:03.923Z",
      "updated": "2022-10-19T16:10:03.923Z"
    },
    "links": {
      "self": "string"
    }
  }
}
```

## Test with Postman

Before you begin testing with Postman, check out our [guide on how to use our Postman collections](https://developers.klaviyo.com/en/docs/use_klaviyos_postman_collections.md). Fork our latest collection of prebuilt API requests into your personal workspace to get started. 

To confirm that your application can send data to Klaviyo, open the **Lists & Segments** folder and select the **Create List** POST request. Replace `your-private-api-key` with a private API key from your account. If you are using a test account, first check the key is associated with your test account. 

When you are ready, click **Send**. A successful request returns the list ID of the newly created list.

```json Success
{
  "data": {
    "type": "list",
    "id": "string",
    "attributes": {
      "name": "string",
      "created": "2022-10-19T16:10:03.923Z",
      "updated": "2022-10-19T16:10:03.923Z"
    },
    "links": {
      "self": "string"
    }
  }
}
```

## Confirm success in account

Double-check that your test request successfully created a list in your preferred account. While logged in to your account, navigate to <a href="https://www.klaviyo.com/lists" target="_blank">**Lists & Segments**</a> a search for the name of your newly-created list to verify.  
<img src="https://files.readme.io/3e2fea6-apicreatetestlist.png" alt="Lists and Segments tab in Klaviyo with Test List visible">
