Klaviyo Connector > Klaviyo operations > Klaviyo source operations
  

Klaviyo source operations

Create a Source transformation in the Mapping Task wizard to read data from Klaviyo.
To configure the Source operation, perform the following steps:
  1. 1In the Source transformation, select a Klaviyo connection.
  2. 2On the Source tab, select an operation from the list of operations.
  3. 3Configure the request message for the operation. Copy the request message from the sample template, and edit the JSON based on your use case.

Configuring a request using Request Message Editor

When you create a Source transformation, configure a JSON request message for the operation that you want to perform in Klaviyo.
Use the Request Message Editor to create a request message. The request message uses the JSON format and contains request parameters exposed by the Klaviyo REST API for a specific operation. You can use the default request message for the operation, and then customize it to specify the data that you want to include.
To customize your request, copy the request message from the sample template to the Request Message Editor pane where you can edit the JSON message and add the attributes for the request. Remove unnecessary and empty tags from the request message to avoid operation failure. You can hide the optional elements to see the required elements for the request message.
For example, to retrieve a specific profile with the get_profiles operation, use the filter parameter. The following sample request message shows the filter parameter:
{
"filter": "equals(email,'testuser06@example.com')"
}
The following image shows the request message template and a request message configured to filter profiles in the Mapping Designer:
In the Request Message Editor, the request message template at the top lists the empty parameters for the operation. Below the template, the Request Message section shows a request message with an example configuration.
To retrieve profiles created after a specific date and sort them in an ascending order by creation date, combine the filter and sort parameters. The following sample request message shows these parameters::
{
"filter" : "greater-than(created,2026-01-01T00:00:00Z)",
"sort" : "created"
}
The request message format in Klaviyo Connector follows the service request definition in Klaviyo. Use well-formed JSON in the request message, and include the parameters that you need for your use case.

Field mapping in a Source transformation

The response message format follows the service response definition in Klaviyo. You can map response fields from a hierarchical to a relational structure of output groups and fields.
After you configure an operation for a source and specify the request message, create the relational format from the hierarchical data to include groups and fields that you want in the output.
Select the elements in the response structure that you want to include as output fields. The Secure Agent converts the JSON response in the hierarchical structure to relational groups at run time.
The following image shows an example hierarchical response structure generated for the get_profiles operation, and the corresponding relational output fields for the response:
In the field mapping for the get_profiles operation, the hierarchical response elements on the left map to the relational output fields on the right.
You can edit the data type, precision, and scale for the groups and fields after mapping the fields.
For more information about field mapping, see Transformations.