- 12 Minutes to read
- Print
- DarkLight
- PDF
Klaviyo v2024-02-15 Walkthrough
- 12 Minutes to read
- Print
- DarkLight
- PDF
Starting June 30th, 2024, Klaviyo will cease support for Klaviyo Legacy v1 and v2.
These APIs will be replaced by Klaviyo v2024-02-15 API.
Introduction
Klaviyo API v2024-02-15 API is an upgraded version of the Klaviyo integration designed to enhance data extraction and transformation capabilities for advanced analytics and marketing workflows.
This document provides a detailed description of each endpoint, including the required scopes.
Connection
To connect Klaviyo API v2024-02-15 API with your destination, follow our step-by-step tutorial.
Choose a Source connection after you've created a connection, as seen here:
Predefined Reports
Rivery provides a convenient entry point and recommended approach for accessing a range of predefined reports for your use. Each report includes a concise data description, a list of customizable fields (if applicable), and the schema mapping.
Since these reports follow a standardized format, specific fields are restricted and can only be accessed through Custom Reports.
Custom Reports
Select a specific report to pull data from the Klaviyo API v2024-02-15 API.
The following image provides an overview of the various custom reports:
Profiles
Retrieve all profiles within an account.
To access this endpoint, you need the profiles:read scope.
Profiles JSON representation:
{
"data": [
{
"type": "profile",
"id": "01GDDKASAP8TKDDA2GRZDSVP4H",
"attributes": {
"email": "sarah.mason@klaviyo-demo.com",
"phone_number": "+15005550006",
"external_id": "63f64a2b-c6bf-40c7-b81f-bed08162edbe",
"first_name": "Sarah",
"last_name": "Mason",
"organization": "Example Corporation",
"title": "Regional Manager",
"image": "https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg",
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00",
"last_event_date": "2022-11-08T00:00:00",
"location": {
"address1": "89 E 42nd St",
"address2": "1st floor",
"city": "New York",
"country": "United States",
"latitude": "string",
"longitude": "string",
"region": "NY",
"zip": "10017",
"timezone": "America/New_York",
"ip": "127.0.0.1"
},
"properties": {
"pseudonym": "Dr. Octopus"
},
"subscriptions": {
"email": {
"marketing": {
"can_receive_email_marketing": true,
"consent": "SUBSCRIBED",
"consent_timestamp": "2023-02-21T20:07:38+00:00",
"last_updated": "2023-02-21T20:07:38+00:00",
"method": "PREFERENCE_PAGE",
"method_detail": "Mydomain | Hosting, Domains, and Websites with Web.com ",
"custom_method_detail": "marketing drive",
"double_optin": "True",
"suppression": [
{
"reason": "HARD_BOUNCE",
"timestamp": "2023-02-21T20:07:38+00:00"
}
],
"list_suppressions": [
{
"list_id": "Y6nRLr",
"reason": "USER_SUPPRESSED",
"timestamp": "2023-02-21T20:07:38+00:00"
}
]
}
},
"sms": {
"marketing": {
"can_receive_sms_marketing": true,
"consent": "SUBSCRIBED",
"consent_timestamp": "2023-02-21T20:07:38+00:00",
"method": "TEXT",
"method_detail": "JOIN",
"last_updated": "2023-02-21T20:07:38+00:00"
}
}
},
"predictive_analytics": {
"historic_clv": 93.87,
"predicted_clv": 27.24,
"total_clv": 121.11,
"historic_number_of_orders": 2,
"predicted_number_of_orders": 0.54,
"average_days_between_orders": 189,
"average_order_value": 46.94,
"churn_probability": 0.89,
"expected_date_of_next_order": "2022-11-08T00:00:00"
}
},
"links": {
"self": "string"
},
"relationships": {
"lists": {
"links": {
"self": "string",
"related": "string"
}
},
"segments": {
"links": {
"self": "string",
"related": "string"
}
}
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
Profile Segments
Retrieve the segment memberships for a profile using the provided profile ID.
The required scopes for this endpoint are profiles:read, segments:read.
Profile Segments JSON Representation:
{
"data": [
{
"type": "segment",
"id": "string",
"attributes": {
"name": "Repeat Purchasers",
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00",
"is_active": true,
"is_processing": true,
"is_starred": true
},
"links": {
"self": "string"
},
"relationships": {
"profiles": {
"links": {
"self": "string",
"related": "string"
}
},
"tags": {
"links": {
"self": "string",
"related": "string"
}
}
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
Segments
Retrieve every segment within an account.
To access this endpoint, you need the segments:read scope.
Segments JSON Representation:
{
"data": [
{
"type": "segment",
"id": "string",
"attributes": {
"name": "Repeat Purchasers",
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00",
"is_active": true,
"is_processing": true,
"is_starred": true
},
"links": {
"self": "string"
},
"relationships": {
"profiles": {
"links": {
"self": "string",
"related": "string"
}
},
"tags": {
"data": [
{
"type": "tag",
"id": "string"
}
],
"links": {
"self": "string",
"related": "string"
}
}
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
},
"included": [
{
"type": "tag",
"id": "abcd1234-ef56-gh78-ij90-abcdef123456",
"attributes": {
"name": "My Tag"
},
"links": {
"self": "string"
}
}
]
}
Events
Get all events in an account
The required scope for this endpoint is events:read.
Events JSON Representation:
{
"data": [
{
"type": "event",
"id": "string",
"attributes": {
"timestamp": 0,
"event_properties": {},
"datetime": "2022-11-08T01:23:45+00:00",
"uuid": "string"
},
"links": {
"self": "string"
},
"relationships": {
"profile": {
"data": {
"type": "profile",
"id": "string"
},
"links": {
"self": "string",
"related": "string"
}
},
"metric": {
"data": {
"type": "metric",
"id": "string"
},
"links": {
"self": "string",
"related": "string"
}
},
"attributions": {
"data": [
{
"type": "attribution",
"id": "string"
}
],
"links": {
"self": "string",
"related": "string"
}
}
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
},
"included": [
{
"type": "attribution",
"id": "925e385b52fb405715f3616c337cc65c",
"relationships": {
"event": {
"data": {
"type": "event",
"id": "string"
}
},
"attributed-event": {
"data": {
"type": "event",
"id": "string"
}
},
"campaign": {
"data": {
"type": "campaign",
"id": "string"
}
},
"campaign-message": {
"data": {
"type": "campaign-message",
"id": "string"
}
},
"flow": {
"data": {
"type": "flow",
"id": "string"
}
},
"flow-message": {
"data": {
"type": "flow-message",
"id": "string"
}
},
"flow-message-variation": {
"data": {
"type": "flow-message",
"id": "string"
}
}
},
"links": {
"self": "string"
}
},
{
"type": "metric",
"id": "string",
"attributes": {
"name": "string",
"created": "string",
"updated": "string",
"integration": {}
},
"links": {
"self": "string"
}
},
{
"type": "profile",
"id": "01GDDKASAP8TKDDA2GRZDSVP4H",
"attributes": {
"email": "sarah.mason@klaviyo-demo.com",
"phone_number": "+15005550006",
"external_id": "63f64a2b-c6bf-40c7-b81f-bed08162edbe",
"first_name": "Sarah",
"last_name": "Mason",
"organization": "Example Corporation",
"title": "Regional Manager",
"image": "https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg",
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00",
"last_event_date": "2022-11-08T00:00:00",
"location": {
"address1": "89 E 42nd St",
"address2": "1st floor",
"city": "New York",
"country": "United States",
"latitude": "string",
"longitude": "string",
"region": "NY",
"zip": "10017",
"timezone": "America/New_York",
"ip": "127.0.0.1"
},
"properties": {
"pseudonym": "Dr. Octopus"
}
},
"links": {
"self": "string"
}
}
]
}
Metrics
Retrieve all metrics within an account.
The required scope for this endpoint is metrics:read.
Metrics JSON Representation:
{
"data": [
{
"type": "metric",
"id": "string",
"attributes": {
"name": "string",
"created": "string",
"updated": "string",
"integration": {}
},
"links": {
"self": "string"
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
Flows
Get all flows within an account.
The required scope for this endpoint is flows:read.
Flows JSON Representation:
{
"data": [
{
"type": "flow",
"id": "string",
"attributes": {
"name": "string",
"status": "string",
"archived": true,
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00",
"trigger_type": "Added to List"
},
"links": {
"self": "string"
},
"relationships": {
"flow-actions": {
"data": [
{
"type": "flow-action",
"id": "string"
}
],
"links": {
"self": "string",
"related": "string"
}
},
"tags": {
"data": [
{
"type": "tag",
"id": "string"
}
],
"links": {
"self": "string",
"related": "string"
}
}
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
},
"included": [
{
"type": "flow-action",
"id": "string",
"attributes": {
"action_type": "string",
"status": "string",
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00",
"settings": {},
"tracking_options": {
"add_utm": true,
"utm_params": [
{
"name": "string",
"value": "string"
}
],
"is_tracking_opens": true,
"is_tracking_clicks": true
},
"send_options": {
"use_smart_sending": true,
"is_transactional": true
},
"render_options": {
"shorten_links": true,
"add_org_prefix": true,
"add_info_link": true,
"add_opt_out_language": true
}
},
"links": {
"self": "string"
}
},
{
"type": "tag",
"id": "abcd1234-ef56-gh78-ij90-abcdef123456",
"attributes": {
"name": "My Tag"
},
"links": {
"self": "string"
}
}
]
}
Campaigns
Delivers campaigns based on specified filters, which can include some or all campaigns.
Please Note:
The Campaigns are divided into 2 distinct types:
- Email campaigns
- SMS campaigns.
The required scope for this endpoint is campaigns:read.
Email Campaigns JSON Representation:
{
"data": [
{
"type": "campaign",
"id": "string",
"attributes": {
"name": "string",
"status": "string",
"archived": true,
"audiences": {
"included": [
"Y6nRLr"
],
"excluded": [
"UTd5ui"
]
},
"send_options": {
"use_smart_sending": true
},
"tracking_options": {
"is_add_utm": true,
"utm_params": [
{
"name": "utm_medium",
"value": "campaign"
}
],
"is_tracking_clicks": true,
"is_tracking_opens": true
},
"send_strategy": {
"method": "static",
"options_static": {
"datetime": "2022-11-08T00:00:00",
"is_local": true,
"send_past_recipients_immediately": true
},
"options_throttled": {
"datetime": "2024-04-11T12:54:31.196Z",
"throttle_percentage": 0
},
"options_sto": {
"date": "2024-04-11"
}
},
"created_at": "2022-11-08T00:00:00",
"scheduled_at": "2022-11-08T00:00:00",
"updated_at": "2022-11-08T00:00:00",
"send_time": "2022-11-08T00:00:00"
},
"links": {
"self": "string"
},
"relationships": {
"campaign-messages": {
"data": [
{
"type": "campaign-message",
"id": "string"
}
],
"links": {
"self": "string",
"related": "string"
}
},
"tags": {
"data": [
{
"type": "tag",
"id": "string"
}
],
"links": {
"self": "string",
"related": "string"
}
}
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
},
"included": [
{
"type": "campaign-message",
"id": "string",
"attributes": {
"label": "string",
"channel": "string",
"content": {
"subject": "Buy our product!",
"preview_text": "My preview text",
"from_email": "store@my-company.com",
"from_label": "My Company",
"reply_to_email": "reply-to@my-company.com",
"cc_email": "cc@my-company.com",
"bcc_email": "bcc@my-company.com"
},
"send_times": [
{
"datetime": "2022-11-08T00:00:00",
"is_local": true
}
],
"render_options": {
"shorten_links": true,
"add_org_prefix": true,
"add_info_link": true,
"add_opt_out_language": false
},
"created_at": "2022-11-08T00:00:00",
"updated_at": "2022-11-08T00:00:00"
},
"links": {
"self": "string"
}
},
{
"type": "tag",
"id": "abcd1234-ef56-gh78-ij90-abcdef123456",
"attributes": {
"name": "My Tag"
},
"links": {
"self": "string"
}
}
]
}
SMS Campaigns JSON Representation:
{
"data": {
"type": "campaign",
"id": "string",
"attributes": {
"name": "string",
"status": "string",
"archived": true,
"audiences": {
"included": [
"Y6nRLr"
],
"excluded": [
"UTd5ui"
]
},
"send_options": {
"use_smart_sending": true
},
"tracking_options": {
"is_add_utm": true,
"utm_params": [
{
"name": "utm_medium",
"value": "campaign"
}
],
"is_tracking_clicks": true,
"is_tracking_opens": true
},
"send_strategy": {
"method": "static",
"options_static": {
"datetime": "2022-11-08T00:00:00",
"is_local": true,
"send_past_recipients_immediately": true
},
"options_throttled": {
"datetime": "2024-04-11T12:54:31.196Z",
"throttle_percentage": 0
},
"options_sto": {
"date": "2024-04-11"
}
},
"created_at": "2022-11-08T00:00:00",
"scheduled_at": "2022-11-08T00:00:00",
"updated_at": "2022-11-08T00:00:00",
"send_time": "2022-11-08T00:00:00"
},
"links": {
"self": "string"
},
"relationships": {
"campaign-messages": {
"links": {
"self": "string",
"related": "string"
}
},
"tags": {
"links": {
"self": "string",
"related": "string"
}
}
}
}
}
Campaign Campaign Messages
Return all messages associated with the specified campaign.
The Campaign Messages are divided into 2 distinct types:
- Email Campaigns Messages
- SMS Campaigns Messages.
The required scope for this endpoint is campaigns:read.
Email Campaigns Messages JSON Representation:
{
"data": {
"type": "campaign-message",
"id": "<string>",
"attributes": {
"label": "<string>",
"channel": "email",
"content": {
"subject": "<string>",
"preview_text": "<string>",
"from_email": "<string>",
"from_label": "<string>",
"reply_to_email": "<string>",
"cc_email": "<string>",
"bcc_email": "<string>"
},
"send_times": [
{
"datetime": "<dateTime>",
"is_local": "<boolean>"
},
{
"datetime": "<dateTime>",
"is_local": "<boolean>"
}
],
"render_options": {
"shorten_links": true,
"add_org_prefix": true,
"add_info_link": true,
"add_opt_out_language": false
},
"created_at": "<dateTime>",
"updated_at": "<dateTime>"
},
"links": {
"self": "<uri>"
},
"relationships": {
"campaign": {
"data": {
"type": "campaign",
"id": "<string>"
},
"links": {
"self": "<uri>",
"related": "<uri>"
}
},
"template": {
"data": {
"type": "template",
"id": "<string>"
},
"links": {
"self": "<uri>",
"related": "<uri>"
}
}
}
}
}
SMS Campaigns Messages JSON Representation:
{
"data": {
"type": "campaign-message",
"id": "<string>",
"attributes": {
"label": "<string>",
"channel": "sms",
"content": {
"subject": "<string>",
"preview_text": "<string>",
"from_email": "<string>",
"from_label": "<string>",
"reply_to_email": "<string>",
"cc_email": "<string>",
"bcc_email": "<string>"
},
"send_times": [
{
"datetime": "<dateTime>",
"is_local": "<boolean>"
},
{
"datetime": "<dateTime>",
"is_local": "<boolean>"
}
],
"render_options": {
"shorten_links": true,
"add_org_prefix": true,
"add_info_link": true,
"add_opt_out_language": false
},
"created_at": "<dateTime>",
"updated_at": "<dateTime>"
},
"links": {
"self": "<uri>"
},
"relationships": {
"campaign": {
"data": {
"type": "campaign",
"id": "<string>"
},
"links": {
"self": "<uri>",
"related": "<uri>"
}
},
"template": {
"data": {
"type": "template",
"id": "<string>"
},
"links": {
"self": "<uri>",
"related": "<uri>"
}
}
}
}
}
Campaign Recipient
Get the estimated recipient count for a campaign with the provided campaign ID.
The required scope for this endpoint is campaigns:read.
Campaign Recipient JSON Representation:
{
"data": {
"type": "campaign-recipient-estimation",
"id": "string",
"attributes": {
"estimated_recipient_count": 0
},
"links": {
"self": "string"
}
}
}
Templates
Retrieve all templates within an account.
The required scope for this endpoint is templates:read.
Templates JSON Representation:
{
"data": [
{
"type": "template",
"id": "string",
"attributes": {
"name": "string",
"editor_type": "string",
"html": "string",
"text": "string",
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00"
},
"links": {
"self": "string"
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
Lists
Retrieve all lists within an account.
Apply filters to request a specific subset of lists. Lists can be filtered based on their id, name, created, and updated fields.
The required scope for this endpoint is lists:read.
Lists JSON Representation:
{
"data": [
{
"type": "list",
"id": "Y6nRLr",
"attributes": {
"name": "Newsletter",
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00",
"opt_in_process": "double_opt_in"
},
"links": {
"self": "string"
},
"relationships": {
"profiles": {
"links": {
"self": "string",
"related": "string"
}
},
"tags": {
"data": [
{
"type": "tag",
"id": "string"
}
],
"links": {
"self": "string",
"related": "string"
}
}
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
},
"included": [
{
"type": "tag",
"id": "abcd1234-ef56-gh78-ij90-abcdef123456",
"attributes": {
"name": "My Tag"
},
"links": {
"self": "string"
}
}
]
}
List Profiles
Get all profiles within a list with the given list ID.
The required scope for this endpoint is lists:read, profiles:read.
Report JSON Representation:
{
"data": [
{
"type": "profile",
"id": "01GDDKASAP8TKDDA2GRZDSVP4H",
"attributes": {
"email": "sarah.mason@klaviyo-demo.com",
"phone_number": "+15005550006",
"external_id": "63f64a2b-c6bf-40c7-b81f-bed08162edbe",
"first_name": "Sarah",
"last_name": "Mason",
"organization": "Example Corporation",
"title": "Regional Manager",
"image": "https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg",
"created": "2022-11-08T00:00:00",
"updated": "2022-11-08T00:00:00",
"last_event_date": "2022-11-08T00:00:00",
"location": {
"address1": "89 E 42nd St",
"address2": "1st floor",
"city": "New York",
"country": "United States",
"latitude": "string",
"longitude": "string",
"region": "NY",
"zip": "10017",
"timezone": "America/New_York",
"ip": "127.0.0.1"
},
"properties": {
"pseudonym": "Dr. Octopus"
},
"joined_group_at": "2022-11-08T00:00:00",
"subscriptions": {
"email": {
"marketing": {
"can_receive_email_marketing": true,
"consent": "SUBSCRIBED",
"consent_timestamp": "2023-02-21T20:07:38+00:00",
"last_updated": "2023-02-21T20:07:38+00:00",
"method": "PREFERENCE_PAGE",
"method_detail": "Mydomain | Hosting, Domains, and Websites with Web.com ",
"custom_method_detail": "marketing drive",
"double_optin": "True",
"suppression": [
{
"reason": "HARD_BOUNCE",
"timestamp": "2023-02-21T20:07:38+00:00"
}
],
"list_suppressions": [
{
"list_id": "Y6nRLr",
"reason": "USER_SUPPRESSED",
"timestamp": "2023-02-21T20:07:38+00:00"
}
]
}
},
"sms": {
"marketing": {
"can_receive_sms_marketing": true,
"consent": "SUBSCRIBED",
"consent_timestamp": "2023-02-21T20:07:38+00:00",
"method": "TEXT",
"method_detail": "JOIN",
"last_updated": "2023-02-21T20:07:38+00:00"
}
}
},
"predictive_analytics": {
"historic_clv": 93.87,
"predicted_clv": 27.24,
"total_clv": 121.11,
"historic_number_of_orders": 2,
"predicted_number_of_orders": 0.54,
"average_days_between_orders": 189,
"average_order_value": 46.94,
"churn_probability": 0.89,
"expected_date_of_next_order": "2022-11-08T00:00:00"
}
},
"links": {
"self": "string"
},
"relationships": {
"lists": {
"links": {
"self": "string",
"related": "string"
}
},
"segments": {
"links": {
"self": "string",
"related": "string"
}
}
}
}
],
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
After selecting the required report, you can specify the fields to be included in your schema mapping:
Extract Method
When using the Extract Method, you have the option to retrieve all data, without any time restrictions, by selecting 'All' or or 'Incremental' to have greater control over data retrieval based on dates.
Here's an example:
- Start Date is mandatory.
- Data can be retrieved for the date range specified between the start and end dates.
- If you leave the end date blank, the data will be pulled at the current time of the river's run.
- Dates timezone: UTC time.
- The Start Date won't be advanced if a River run is unsuccessful.
If you don't want this default setting, click More Options and check the box to advance the start date even if the River run is unsuccessful (Not recommended).
- Use the Last Days Back For Each Run option to gather data from a specified number of days prior to the selected start date.
When the data you're fetching is large, especially if you're reaching size or timeout constraints, "Split your chunks by" is an option that may be used to split the data by chunks.
Additional Note
Custom reports mapping extracts data from the API using a code-generated schema from sample data, which may miss some fields or inaccurately represent data types. We've addressed variable field types by casting them as Strings.
Predefined reports ensure a consistent structure by loading nested record fields as JSON.