Skip to main content

Klaviyo Data Source

Nexla's bi-directional connectors allow data to flow both to and from any location, making it simple to create a FlexFlow, DB-CDC, Spark ETL, or Replication data flow that ingests data from a Klaviyo location.
klaviyo.png

Klaviyo

Follow the instructions below to create a new data flow that ingests data from a Klaviyo source in Nexla.

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Klaviyo connector tile from the list of available 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.

  3. In Nexla, Klaviyo data sources can be created using pre-built endpoint templates, which expedite source setup for common Klaviyo endpoints. Each template is designed specifically for the corresponding Klaviyo endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Klaviyo sources can also be configured manually, allowing you to ingest data from Klaviyo endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Klaviyo endpoints. Each template is designed specifically for the corresponding Klaviyo endpoint, making data source setup easy and efficient.

Endpoint Settings

  • 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. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    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.

Configure Manually

Klaviyo data sources can be manually configured to ingest data from any valid Klaviyo API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Klaviyo sources, such as sources that use custom query parameters, different HTTP methods, or custom data transformations.

Content Format

  1. Select the format in which the data from the Klaviyo API will be received from the Content Format pulldown menu. Nexla will automatically parse the data in the selected format. The Klaviyo API typically returns data in JSON format.

API Endpoint URL

  1. Enter the URL of the Klaviyo API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including the protocol (https://), the API base URL, and any required path parameters. Klaviyo API endpoints typically follow the pattern https://a.klaviyo.com/api/v1/{endpoint_path} or https://a.klaviyo.com/api/v2/{endpoint_path}. Include the api_key query parameter in the URL, or it will be automatically added based on your credential configuration.

Ensure the API endpoint URL is correct and accessible with your current credentials. You can test the endpoint using the Test button after configuring the URL. The endpoint requires API key authentication via the api_key query parameter, which is handled automatically by your credential configuration. The API key is sent as a query parameter in the URL for all API requests to the Klaviyo API. For detailed information about Klaviyo API endpoints, authentication, and available APIs, see the Klaviyo API documentation.