> ## Documentation Index
> Fetch the complete documentation index at: https://vexidata.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Klaviyo

> Connect Klaviyo to VexiData to query campaigns, flows, lists, and revenue with your AI assistant — and manage them with approval.

Connect Klaviyo and ask your AI assistant about email and SMS performance — campaigns, flows, segments, lists, profiles, and the revenue they drive. Klaviyo connects with a private API key instead of OAuth.

## Prerequisites

* A [Klaviyo](https://www.klaviyo.com) account where you can create private API keys
* The **Connect sources** capability in your VexiData organization, to connect the platform — Owners and Admins have it by default

## Connect Klaviyo

**1. Create a private API key in Klaviyo**

1. In Klaviyo, open **Settings** > **API keys**
2. Click **Create Private API Key**
3. Name it (for example, `VexiData`) and grant it **Full Access** — read-only keys make every write fail
4. Copy the key (it starts with `pk_`) — Klaviyo shows it only once

**2. Paste the key into VexiData**

Go to the [**Integrations**](https://vexidata.com/integrations) page in VexiData, click **Connect** on **Klaviyo**, paste the key into **Private API key**, and click **Connect**. VexiData validates it live and names the connection after your Klaviyo account automatically.

> [!NOTE]
>
> **Good to know about Klaviyo's API:**
>
> * Requests follow the **JSON:API** convention — the AI handles the `filter`/`fields`/`page[cursor]` syntax for you
> * Performance reports (opens, clicks, conversions, revenue) have **much stricter rate limits** than ordinary reads — if the AI reports a rate limit, give it a moment before asking again
> * VexiData pins every call to one Klaviyo API revision, so responses stay stable over time

## Managing the connection

To connect more Klaviyo accounts, click **Add account** on the Klaviyo card on the [**Integrations**](https://vexidata.com/integrations) page and paste that account's key — each account keeps its own key.

The connection with the **Primary** badge is the primary, which tools use when a request doesn't name one. To change it, open another connection and click **Make primary** in its **Connection** card.

To rotate a key, create a new one in Klaviyo and connect the same Klaviyo account again with the new key — VexiData recognizes the account and updates the existing connection. To remove the account, open its connection and click **Disconnect** in the **Connection** card.

## What the AI can do

| Tool | What it does | Access |
| - | - | - |
| `klaviyo_read` | Reads campaigns, flows, lists, segments, metrics, and profiles with full JSON:API filtering and pagination. | Read |
| `klaviyo_report` | Queries campaign, flow, and segment performance — opens, clicks, conversions, revenue, deliverability, and segment membership changes. | Read |
| `klaviyo_write` | Creates and updates lists, campaigns, flows, profiles, and events. | Write |
| `klaviyo_delete` | Permanently deletes a resource, only on your explicit, item-by-item approval. | Destructive |

Reads and reports are available to anyone with access to the connection. Write and delete tools need **Write** access on the connection (by default, Owners and Admins). The AI is instructed to confirm changes with you first and to prefer pausing over deleting. Try asking: *"How much revenue did email campaigns drive in the last 30 days?"*

## Troubleshooting

> [accordion] Requests fail with an authorization error
>
> The key was revoked, copied incompletely, or created with read-only scope. Create a new **private** key with **Full Access** under **Settings** > **API keys**, then connect Klaviyo again in VexiData with the new key.

> [accordion] The AI says a list request needs a filter
>
> Many Klaviyo list endpoints require a filter by design. The AI normally adds one itself — narrow your question (a channel, a date range, a campaign name) and it will retry with a valid filter.

> [accordion] Report questions hit a rate limit
>
> Klaviyo limits report queries far more tightly than ordinary reads. The AI is instructed to wait the full period Klaviyo asks for; batching several statistics into one question helps stay under the limit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.