# Connect

Connect a Klaviyo account to a profile with a private API key, from the dashboard or with the API.

Klaviyo has no sign-in flow for this. You create a private API key in Klaviyo and send it to Zernio, which checks it before saving the account.

## Connect with a private API key

Send the key for a profile:

```bash
curl -X POST "https://zernio.com/api/v1/connect/klaviyo/credentials" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "profileId": "PROFILE_ID",
    "apiKey": "pk_KLAVIYO_PRIVATE_KEY"
  }'
```

```json
{ "accountId": "6507a1b2c3d4e5f6a7b8c9d0", "klaviyoAccountId": "AbC123", "accountName": "Example Store", "testAccount": false }
```

| Field | Where to find it |
|-------|------------------|
| `apiKey` | A private API key from **Settings**, **API keys** in Klaviyo, with the **Events** (write) and **Accounts** (read) scopes. It starts with `pk_`. Required. |
| `name` | A display name for the account, up to 100 characters. Optional: Zernio uses the organization name from Klaviyo. |

In the dashboard, open **Connections**, pick **Klaviyo** and paste the same key.

## How it behaves

- Zernio reads the key's Klaviyo account once to check it. Nothing is saved unless Klaviyo accepts the key.
- The account id becomes the connection's only destination. List it with `GET /v1/ads/conversions/destinations`.
- `testAccount` is `true` when the key belongs to a Klaviyo test account.
- A profile holds one Klaviyo account. Connecting the same account again replaces its key.
- Every call on this page is also a tool on the [Zernio MCP server](/mcp/tools).

## If it fails

| Error | Cause | Fix |
|-------|-------|-----|
| `400` on `apiKey` | The key does not start with `pk_` | Use a private API key, not the public site id. |
| `401` with `invalid_credentials` | Klaviyo refused the key, or it lacks a scope | Create a key with Events (write) and Accounts (read). |
| `402` | The account cannot connect more accounts on its plan | Upgrade the plan or remove an account. |
| `403` | The Ads add-on is off | Turn on the Ads add-on, then connect. |
| `409` with `profile_platform_conflict` | The profile already has another Klaviyo account | Disconnect it first, or use another profile. |
| `502` with `platform_api_error` | Klaviyo could not confirm the key right now; nothing was saved | Retry in a minute. |

## Related

- [Connect a Klaviyo account](/connect/connect-klaviyo-credentials)
- [List conversion destinations](/conversions/list-ad-conversion-destinations)
- [Conversions](/platforms/klaviyo/conversions)