# Klaviyo Integration via LowCodeAPI

**Last Updated**: February 11, 2026

## Overview

Email marketing and automation

The Klaviyo API provides access to:

- **Marketing Email** - Related functionality

## Base Endpoint

```
https://api.lowcodeapi.com/klaviyo/
```

**Important**: Always include the provider name in the URL path after `api.lowcodeapi.com/`

## Authentication

LowCodeAPI handles authentication automatically. You only need to:

1. **Sign up** at [Klaviyo](https://www.klaviyo.com/)
3. **Connect your account** in LowCodeAPI dashboard
4. **Use your `api_token`** in all requests

The `api_token` is your LowCodeAPI authentication token. LowCodeAPI will automatically:
- Fetch your provider credentials (API keys, OAuth tokens, etc.)
- Apply them to each request
- Handle token refresh for OAuth providers

**Auth Type**: TOKEN

## URL Format (Important)

LowCodeAPI supports **two URL formats** for endpoints with path parameters. **Always try New Format first**, and only fall back to Old Format if it doesn't work.

### New Format (Priority) - Dynamic Path Parameters

- **Path parameters stay in the URL path** - Do NOT convert to query parameters
- **Provider name is always in the URL path** after `api.lowcodeapi.com/`
- Pattern: `https://api.lowcodeapi.com/{provider}/{path_with_params}?api_token={api_token}`

**Example**:
```bash
# New Format - Path parameter stays in the URL path
https://api.lowcodeapi.com/klaviyo/resource/{RESOURCE_ID}?api_token=YOUR_API_TOKEN
```

### Old Format (Fallback) - Sanitized Path + Query Parameters

- **Path parameters become query parameters**
- **Provider name is always in the URL path**
- Pattern: `https://api.lowcodeapi.com/{provider}/{sanitized_path}?{path_params}&api_token={api_token}`

**Example**:
```bash
# Old Format - Path parameter becomes a query parameter
https://api.lowcodeapi.com/klaviyo/resource/id?id=RESOURCE_ID&api_token=YOUR_API_TOKEN
```

### Decision Flow for AI Agents

1. Always use **New Format first** - Keep path parameters in the URL path
2. If you get a 404 or error, try **Old Format** with sanitized path
3. Log which format worked for future requests to this provider

## API Categories

- **Accounts** - 1 endpoints
- **Campaigns** - 1 endpoints
- **Catalog ** - 1 endpoints
- **Coupons** - 1 endpoints

## Common Endpoints

### Category: Accounts

#### Get Accounts

**Method**: `GET` | **LowCodeAPI Path**: `/api/accounts`

**New Format (Priority)**:
```bash
https://api.lowcodeapi.com/klaviyo/api/accounts?api_token=YOUR_API_TOKEN
```

**Old Format (Fallback)**:
```bash
https://api.lowcodeapi.com/klaviyo/api/accounts?api_token={api_token}
```

**Description**: Retrieve the account(s) associated with a given private API key.

**Example Request**:
```bash
# NEW FORMAT (PRIORITY) - Path parameters stay in URL
curl -X GET "https://api.lowcodeapi.com/klaviyo/api/accounts?api_token=YOUR_API_TOKEN"
```

**Example Response**:
```json
{
  "data": {
    // Provider response here
  }
}
```

**Official Documentation**: [Get Accounts](https://developers.klaviyo.com/en/reference/get_accounts)

---

### Category: Campaigns

#### Get Campaigns

**Method**: `GET` | **LowCodeAPI Path**: `/api/campaigns`

**New Format (Priority)**:
```bash
https://api.lowcodeapi.com/klaviyo/api/campaigns?api_token=YOUR_API_TOKEN
```

**Old Format (Fallback)**:
```bash
https://api.lowcodeapi.com/klaviyo/api/campaigns?api_token={api_token}
```

**Description**: Returns some or all campaigns based on filters.

**Example Request**:
```bash
# NEW FORMAT (PRIORITY) - Path parameters stay in URL
curl -X GET "https://api.lowcodeapi.com/klaviyo/api/campaigns?api_token=YOUR_API_TOKEN"
```

**Example Response**:
```json
{
  "data": {
    // Provider response here
  }
}
```

**Official Documentation**: [Get Campaigns](https://developers.klaviyo.com/en/reference/get_campaigns)

---

### Category: Catalog 

#### Get Catalog Items

**Method**: `GET` | **LowCodeAPI Path**: `/api/catalog-items`

**New Format (Priority)**:
```bash
https://api.lowcodeapi.com/klaviyo/api/catalog-items?api_token=YOUR_API_TOKEN
```

**Old Format (Fallback)**:
```bash
https://api.lowcodeapi.com/klaviyo/api/catalog-items?api_token={api_token}
```

**Description**: Get Catalog Items

**Example Request**:
```bash
# NEW FORMAT (PRIORITY) - Path parameters stay in URL
curl -X GET "https://api.lowcodeapi.com/klaviyo/api/catalog-items?api_token=YOUR_API_TOKEN"
```

**Example Response**:
```json
{
  "data": {
    // Provider response here
  }
}
```

**Official Documentation**: [Get Catalog Items](https://developers.klaviyo.com/en/reference/get_catalog_items)

---

### Category: Coupons

#### Get Coupons

**Method**: `GET` | **LowCodeAPI Path**: `/api/coupons`

**New Format (Priority)**:
```bash
https://api.lowcodeapi.com/klaviyo/api/coupons?api_token=YOUR_API_TOKEN
```

**Old Format (Fallback)**:
```bash
https://api.lowcodeapi.com/klaviyo/api/coupons?api_token={api_token}
```

**Description**: Get all coupons in an account.

**Example Request**:
```bash
# NEW FORMAT (PRIORITY) - Path parameters stay in URL
curl -X GET "https://api.lowcodeapi.com/klaviyo/api/coupons?api_token=YOUR_API_TOKEN"
```

**Example Response**:
```json
{
  "data": {
    // Provider response here
  }
}
```

**Official Documentation**: [Get Coupons](https://developers.klaviyo.com/en/reference/get_coupons)

---

## API Definition Endpoints

You can retrieve the complete OpenAPI specification for this provider using these endpoints:

**New Format (OpenAPI spec with dynamic path parameters):**
```bash
curl -X GET "https://backend.lowcodeapi.com/klaviyo/openapi"
```

**Old Format (API definition with sanitized paths):**
```bash
curl -X GET "https://backend.lowcodeapi.com/klaviyo/definition"
```

## Response Format

All responses from LowCodeAPI are wrapped in a `data` key:

```json
{
  "data": {
    // Actual response from provider API
  }
}
```

The `data` key contains the raw response from the provider's API.

## Complete Endpoint Reference

For a complete list of all 4 endpoints, refer to:
- **Official Provider Documentation**: https://developers.klaviyo.com/en/docs/authenticate_#private-key-authentication

## Usage Examples

### Example 1: Basic API Request (New Format)

Making a simple request to Klaviyo:

```bash
# Replace RESOURCE_ID with an actual resource ID from your Klaviyo account
curl -X GET "https://api.lowcodeapi.com/klaviyo/resource/{RESOURCE_ID}?api_token=YOUR_API_TOKEN"
```

### Example 2: Request with Query Parameters (New Format)

Request with specific parameters:

```bash
# Include query parameters for filtering
curl -X GET "https://api.lowcodeapi.com/klaviyo/resources?filter=value&api_token=YOUR_API_TOKEN"
```

## Error Handling

Standard HTTP status codes apply. All responses are wrapped in a `data` key:
```json
{
  "data": {
    // Actual response from provider
  }
}
```