Klaviyo

Knowi enables visualization, analysis, and reporting automation from your Klaviyo email marketing and SMS data.

Connect your Klaviyo account to pull profiles, events, lists, campaigns, metrics, and flows into Knowi for analytics and dashboards -- no manual exports or CSV files needed.

Overview

Connect directly to Klaviyo using your private API key. Knowi handles authentication, pagination, and data extraction automatically.

Klaviyo uses a JSON:API response format. Knowi's Cloud9QL expand() function flattens the nested response structure into tabular rows for easy analysis.

Prerequisites

You need a Klaviyo Private API Key to connect. This is different from your Public API Key (which is site ID only).

Generate a Klaviyo Private API Key

  1. Log in to Klaviyo.

  2. Click your account name in the bottom left corner, then go to Settings > API keys (or navigate directly to Account > Settings > API Keys).

  3. Click Create Private API Key.

  4. Give the key a name (e.g., "Knowi Analytics").

  5. Set permissions ? grant Read access to the scopes you want to query:

    • Profiles ? required for the Profiles collection
    • Events ? required for the Events collection
    • Lists ? required for the Lists collection
    • Campaigns ? required for the Campaigns collection
    • Metrics ? required for the Metrics collection
    • Flows ? required for the Flows collection
    • For Custom Endpoint queries, grant read access to whatever resources you plan to query

    Tip: For the easiest setup, grant Full Read Access (all read scopes). You can always create a more restricted key later.

  6. Click Create and copy the key immediately. Klaviyo only shows the full key once. It starts with pk_ (e.g., pk_abc123def456...).

Connecting

  1. Log in to Knowi and navigate to Queries from the left sidebar.

  2. Click New Datasource (the + icon), then search for Klaviyo in the datasource selector.

  3. Fill in the form:

    a. Datasource Name: A label for this connection (e.g., "Klaviyo Production")

    b. Private API Key: Paste the private API key you copied above (starts with pk_)

  4. Click Test Connection to verify. You should see "Connection Successful".

  5. Click Save to store the datasource.

Collections

After connecting, select a collection from the dropdown to query your Klaviyo data.

Profiles

Retrieves all profiles (contacts) in your Klaviyo account, including email, name, phone number, and custom properties.

Optional Filters: * Filter - Klaviyo filter syntax. Examples: equals(email,"user@example.com"), greater-than(created,2024-01-01T00:00:00Z). * Sort By - Sort by created, updated, or email (ascending or descending). * Fields - Limit returned fields (e.g., email,first_name,last_name).

Default Cloud9QL:

select data;
select expand(data);
select id, attributes.email, attributes.first_name, attributes.last_name, attributes.phone_number, attributes.created, attributes.updated order by attributes.created desc;

The expand(data) flattens Klaviyo's JSON:API response so each profile becomes its own row.

Events

Retrieves all events (activity) in your Klaviyo account, such as email opens, clicks, purchases, and custom events.

Optional Filters: * Filter - Filter by metricid, profileid, or datetime. Example: equals(metric_id,"METRIC_ID"),greater-than(datetime,2024-01-01T00:00:00Z). * Sort By - Sort by datetime or timestamp.

Default Cloud9QL:

select data;
select expand(data);
select id, attributes.datetime, attributes.timestamp, attributes.event_properties, type order by attributes.datetime desc;

Lists

Retrieves all lists in your Klaviyo account.

Default Cloud9QL:

select data;
select expand(data);
select id, attributes.name, attributes.created, attributes.updated order by attributes.name asc;

Campaigns

Retrieves campaigns from your Klaviyo account. A channel filter is required by the Klaviyo API.

Required Parameters: * Channel - Select email, SMS, or mobile push.

Optional Filters: * Additional Filter - Filter by status. Example: equals(status,"Sent").

Default Cloud9QL:

select data;
select expand(data);
select id, attributes.name, attributes.status, attributes.created_at, attributes.updated_at, attributes.send_time order by attributes.created_at desc;

Metrics

Retrieves all available metrics (event types) in your Klaviyo account. Use the metric IDs from this collection to filter the Events collection.

Optional Filters: * Filter - Filter by integration. Example: equals(integration.name,"Klaviyo") for Klaviyo-native metrics only.

Default Cloud9QL:

select data;
select expand(data);
select id, attributes.name, attributes.created, attributes.updated, attributes.integration order by attributes.name asc;

Flows

Retrieves all automated flows in your Klaviyo account, including welcome series, abandoned cart, and post-purchase flows.

Optional Filters: * Filter - Filter by status. Examples: equals(status,"live"), equals(status,"draft"), equals(status,"manual"). * Sort By - Sort by name, status, created, or updated.

Default Cloud9QL:

select data;
select expand(data);
select id, attributes.name, attributes.status, attributes.trigger_type, attributes.created, attributes.updated order by attributes.name asc;

Custom Endpoint

For power users who need to access any Klaviyo API resource not covered by the predefined collections.

Required Parameters: * Resource - The Klaviyo API resource path (e.g., segments, tags, catalogs, templates, coupons).

Refer to the Klaviyo API documentation for available resources.

Querying

After selecting a collection, click Preview to see the data. Use the Cloud9QL editor to transform and filter the results.

Klaviyo returns data in JSON:API format with a data array. Common transformations:

Cross-Source Joins

Klaviyo data becomes powerful when joined with other sources:

Use Knowi's multi-datasource joins to combine Klaviyo with any of the 30+ supported data sources.

Scheduling

Once your query is configured, you can schedule it to run automatically (e.g., every hour, daily) to keep your dashboards up to date. Knowi handles cursor-based pagination automatically -- all pages are fetched until the data is complete.

Notes