Skip to main content

Klaviyo

Klaviyo is a comprehensive email and SMS marketing platform that specializes in customer data-driven campaigns, providing advanced segmentation, automation, and personalization tools to help businesses build meaningful relationships with customers and drive revenue through targeted marketing communications.

Klaviyo icon

Power end-to-end data operations for your Klaviyo API with Nexla. Our bi-directional Klaviyo connector is purpose-built for Klaviyo, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Klaviyo or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Klaviyo workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a Klaviyo credential, you need to obtain an API Key from your Klaviyo account. The API Key is required to authenticate with the Klaviyo API.

To obtain your API Key, sign in to your Klaviyo account and navigate to your account settings. In the account settings, locate the API Keys section where you can view and manage your private API keys. You can generate a new API key or use an existing one. The API Key is used to authenticate all API requests to Klaviyo. The API Key is sent as a query parameter (api_key) in the URL for all API requests to the Klaviyo API. The Klaviyo API provides access to email marketing data including campaigns, lists, metrics, profiles, and events. For detailed information about obtaining API keys, API authentication, and available endpoints, refer to the Klaviyo API documentation.

Authenticate

Credentials required

FieldRequiredSecretDescription
API KeyYesYesYour Klaviyo API Key. You can manage your private API keys from your Klaviyo Account.

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – Klaviyo

KlaviyoCred.png
  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  2. Klaviyo uses API Key authentication for all API requests. Enter your Klaviyo API Key in the API Key field. This is the API Key you obtained from your Klaviyo account settings in Prerequisites. The API Key is required for all API requests and is sent as a query parameter (api_key) in the URL for all API requests to the Klaviyo API.

    Keep your API Key secure and do not share it publicly. The API Key provides access to your Klaviyo account data and should be treated as sensitive information. If your API Key is compromised, you should immediately regenerate it in your Klaviyo account settings. For detailed information about obtaining and managing API keys, API authentication, and available endpoints, see the Klaviyo API documentation.

  3. Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Klaviyo connector tile, then select the credential that will be used to connect to the Klaviyo account, and click Next; or, create a new Klaviyo credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Klaviyo endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

Get Campaigns

Fetch a list of all the campaigns you've created. The campaigns are returned in reverse sorted order by the time they were created.

  • This endpoint automatically retrieves all campaigns from your Klaviyo account. No additional configuration is required beyond selecting this endpoint template.
  • The endpoint uses GET requests to https://a.klaviyo.com/api/v1/campaigns?api_key={api_key} where {api_key} is your Klaviyo API key. The endpoint URL is automatically constructed based on the Klaviyo API base URL and your credential configuration.
  • The endpoint uses pagination (iteration.type: paging.incrementing) to retrieve all campaigns. Pagination starts from page 0 and uses the page query parameter to navigate through pages. The count parameter controls how many records are returned per page, with an expected 100 records per page. The endpoint will automatically fetch all pages until all campaigns are retrieved.
  • The response data path is $.data[*], which extracts all campaign objects from the data array in the API response.

This endpoint retrieves a list of all campaigns you've created in your Klaviyo account. The endpoint requires API key authentication via the api_key query parameter, which is handled automatically by your credential configuration. The campaigns are returned in reverse chronological order by creation time. The endpoint supports pagination through the page and count parameters, which allows you to retrieve large lists of campaigns efficiently. For detailed information about campaigns, pagination, and API response formats, see the Klaviyo API documentation.

Get Lists

Fetch a listing of all the lists in your account. Check API documentation url for details about response.

  • This endpoint automatically retrieves all lists from your Klaviyo account. No additional configuration is required beyond selecting this endpoint template.
  • The endpoint uses GET requests to https://a.klaviyo.com/api/v2/lists?api_key={api_key} where {api_key} is your Klaviyo API key. The endpoint URL is automatically constructed based on the Klaviyo API base URL and your credential configuration.
  • The endpoint does not use pagination (iteration.type: static.url) and returns a single response. The response data path is $[*], which extracts all list objects from the response array.

This endpoint retrieves a listing of all lists in your Klaviyo account. The endpoint requires API key authentication via the api_key query parameter, which is handled automatically by your credential configuration. Lists are used to organize and segment your email subscribers. The endpoint returns all lists in a single response without pagination. For detailed information about lists and API response formats, see the Klaviyo API documentation.

Get Metrics

Returns a list of all the metrics in Klaviyo. Check API documentation url for details about response.

  • This endpoint automatically retrieves all metrics from your Klaviyo account. No additional configuration is required beyond selecting this endpoint template.
  • The endpoint uses GET requests to https://a.klaviyo.com/api/v1/metrics?api_key={api_key} where {api_key} is your Klaviyo API key. The endpoint URL is automatically constructed based on the Klaviyo API base URL and your credential configuration.
  • The endpoint uses pagination (iteration.type: paging.incrementing) to retrieve all metrics. Pagination starts from page 0 and uses the page query parameter to navigate through pages. The count parameter controls how many records are returned per page, with an expected 100 records per page. The endpoint will automatically fetch all pages until all metrics are retrieved.
  • The response data path is $.data[*], which extracts all metric objects from the data array in the API response.

This endpoint retrieves a list of all metrics in your Klaviyo account. Metrics represent different types of events tracked in Klaviyo, such as email opens, clicks, purchases, and other customer actions. The endpoint requires API key authentication via the api_key query parameter, which is handled automatically by your credential configuration. The endpoint supports pagination through the page and count parameters, which allows you to retrieve large lists of metrics efficiently. For detailed information about metrics and API response formats, see the Klaviyo API documentation.

Get Metrics Timeline

Returns a batched timeline of all events in your Klaviyo account. Check API documentation url for details about response.

  • This endpoint automatically retrieves a batched timeline of all events from your Klaviyo account. No additional configuration is required beyond selecting this endpoint template.
  • The endpoint uses GET requests to https://a.klaviyo.com/api/v1/metrics/timeline?api_key={api_key} where {api_key} is your Klaviyo API key. The endpoint URL is automatically constructed based on the Klaviyo API base URL and your credential configuration.
  • The endpoint uses pagination (iteration.type: paging.next.token) to retrieve all events. Pagination uses the since parameter with a token value from the API response to navigate through pages. The since parameter is extracted from $.next in the API response. The endpoint will automatically fetch all pages until all events are retrieved.
  • The response data path is $.data[*], which extracts all event objects from the data array in the API response.

This endpoint retrieves a batched timeline of all events in your Klaviyo account. Events represent customer actions tracked in Klaviyo across all metrics. The endpoint requires API key authentication via the api_key query parameter, which is handled automatically by your credential configuration. The endpoint supports token-based pagination through the since parameter, which allows you to retrieve large timelines of events efficiently. For detailed information about metrics timeline, pagination, and API response formats, see the Klaviyo API documentation.

Get Timeline For One Metric

Returns a batched timeline of all events for one specific type of metrics. Check API documentation url for details about response.

  • Enter the Metric ID in the Metric ID field. This is the unique identifier for a specific metric in Klaviyo. You can obtain Metric IDs from the "Get Metrics" endpoint or from your Klaviyo account dashboard. The Metric ID determines which type of events will be retrieved.
  • The endpoint uses GET requests to https://a.klaviyo.com/api/v1/metrics/{metric_id}/timeline?api_key={api_key} where {metric_id} is the Metric ID you configured and {api_key} is your Klaviyo API key. The endpoint URL is automatically constructed based on the Klaviyo API base URL, the Metric ID you specify, and your credential configuration.
  • The endpoint uses pagination (iteration.type: paging.next.token) to retrieve all events for the specified metric. Pagination uses the since parameter with a token value from the API response to navigate through pages. The since parameter is extracted from $.next in the API response. The endpoint will automatically fetch all pages until all events for the metric are retrieved.
  • The response data path is $.data[*], which extracts all event objects from the data array in the API response.

This endpoint retrieves a batched timeline of all events for a specific metric in your Klaviyo account. The endpoint requires API key authentication via the api_key query parameter, which is handled automatically by your credential configuration. The Metric ID identifies which type of events to retrieve (e.g., email opens, clicks, purchases). The endpoint supports token-based pagination through the since parameter, which allows you to retrieve large timelines of events efficiently. For detailed information about metric timelines, pagination, and API response formats, see the Klaviyo API documentation.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

Klaviyo data sources can also be manually configured to ingest data from any valid Klaviyo API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.

Klaviyo API endpoints typically follow the pattern https://a.klaviyo.com/api/v1/{endpoint_path} or https://a.klaviyo.com/api/v2/{endpoint_path}, and return data in JSON format. The api_key query parameter is included in the URL automatically based on your credential configuration. For detailed information about Klaviyo API endpoints, authentication, and available APIs, see the Klaviyo API documentation.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Klaviyo data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.

Use as a destination

Click the + icon on the Nexset that will be sent to the Klaviyo destination, and select the Send to Destination option from the menu. Select the Klaviyo connector from the list of available destination connectors, then select the credential that will be used to connect to the Klaviyo account, and click Next; or, create a new Klaviyo credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common Klaviyo endpoints. Select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.

Add Profiles to a List

Add profiles to a list. This endpoint is functionally equivalent to adding profiles to a list via a CSV upload and will immediately add profiles to the list.

  • Enter the List ID in the List ID field. This is the unique identifier for a Klaviyo list to which you want to add profiles. You can obtain List IDs from the "Get Lists" endpoint or from your Klaviyo account dashboard.
  • The endpoint uses POST requests to https://a.klaviyo.com/api/v2/list/{list_id}/members where {list_id} is the List ID you configured. The endpoint URL is automatically constructed based on the Klaviyo API base URL and the List ID you specify.
  • The endpoint sends data from your Nexset as the request body in JSON format. The request body is automatically formatted according to the schema fields and data mapping you configure. The body transformation function automatically wraps your data with the api_key and profiles structure required by the Klaviyo API.
  • Batch mode is enabled by default for this endpoint (batch.mode: true), which means multiple profiles from your Nexset can be combined into a single API request. This allows you to add multiple profiles to a list efficiently in a single API call.
  • This endpoint does not automatically create a data source to track the responses received from the Klaviyo API after each call.

The request body must be properly formatted JSON that matches the Klaviyo API specification for adding profiles to a list. The endpoint requires API key authentication via the api_key field in the request body, which is handled automatically by your credential configuration. The Content-Type: application/json header is automatically included in requests. The request body is automatically transformed to include the api_key and wrap your profile data in a profiles array. Batch mode is enabled by default, which allows multiple profiles to be added in a single API request. The List ID identifies which list to add profiles to. For detailed information about adding profiles to lists, including required fields, request formats, and batch processing, see the Klaviyo API documentation.

Manual configuration

Klaviyo destinations can also be manually configured to send data to any valid Klaviyo API endpoint. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, data format, endpoint URL, request headers, attribute exclusions, record batching, and response webhooks.

Klaviyo API endpoints typically follow the pattern https://a.klaviyo.com/api/v1/{endpoint_path} or https://a.klaviyo.com/api/v2/{endpoint_path}, and typically use JSON format for request bodies. Include the api_key query parameter in the URL, or ensure it's included in the request body as required by the specific endpoint.

Save & activate

Once all endpoint settings have been configured, click the Done button in the upper right corner of the screen to save and create the destination. To send the data to the configured Klaviyo endpoint, open the destination resource menu, and select Activate.

The Nexset data will not be sent to the Klaviyo endpoint until the destination is activated. Destinations can be activated immediately or at a later time, providing full control over data movement.