# Integration Specifications

{% hint style="danger" %}
**This documentation is still under construction 🚧**
{% endhint %}

{% hint style="danger" %}
**Data load speeds for Klaviyo are slow**

Klaviyo is an extremely slow endpoint and loading history can take a considerable amount of time if the data volume is high.
{% endhint %}

## Integration Overview

Our Klaviyo extractor pulls information about your Email/SMS profiles, lists, and events so that they can be analyzed alongside your order and marketing data.

## Integration Availability

This integration is available for:

* Enterprise
* Growth

## API Endpoints

This extractor is based on [this documentation](https://developers.klaviyo.com/en/reference/api_overview). The following endpoints are used by Daasity to replicate data:

* [Get Campaigns](https://developers.klaviyo.com/en/reference/get_campaigns)
* [Get Events](https://developers.klaviyo.com/en/reference/get_events)
* [Get Flows](https://developers.klaviyo.com/en/reference/get_flows)
* [Get Lists](https://developers.klaviyo.com/en/reference/get_lists)
* [Get Metrics](https://developers.klaviyo.com/en/reference/get_metrics)
* [Get Profiles](https://developers.klaviyo.com/en/reference/get_profiles)
* [Get Segments](https://developers.klaviyo.com/en/reference/get_segments)
* [Get Tags](https://developers.klaviyo.com/en/reference/get_tags)

## Klaviyo V2 Schema

The Klaviyo V2 extractor creates these tables using the endpoints and replication methods listed. The data is mapped from source API endpoint to the table based on the mapping logic outlined in each table.

* [Campaigns](#campaigns)
* [Campaign Audiences Excluded](#campaign-audiences-excluded)
* [Campaign Audiences Included](#campaign-audiences-included)
* [Campaign Messages](#campaign-messages)
* [Campaign Message Send Times](#campaign-message-send-times)
* [Events](#events)
* [Event Attribution Group IDs](#event-attribution-group-ids)
* [Event Group IDs](#event-group-ids)
* [Flows](#flows)
* [Flow Actions](#flow-actions)
* [Flow Action Messages](#flow-action-messages)
* [Lists](#lists)
* [List Profiles](#list-profiles)
* [List Tags](#list-tags)
* [Metrics](#metrics)
* [Member Lists](#member-lists)
* [Profiles](#profiles)
* [Profile Email List Suppressions](#profile-email-list-suppressions)
* [Profile Email Suppressions](#profile-email-suppressions)
* [Segments](#segments)
* [Segment Profiles](#segment-profiles)
* [Segment Tags](#segment-tags)
* [STG Member Lists](#stg-member-lists)
* [Tags](#tags)

### Campaigns

* Endpoint: [Get Campaigns](https://developers.klaviyo.com/en/v2023-09-15/reference/get_campaigns)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.campaigns`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>campaign_id</td></tr><tr><td>data[].attributes.name</td><td>name</td></tr><tr><td>data[].attributes.status</td><td>status</td></tr><tr><td>data[].attributes.archived</td><td>archived</td></tr><tr><td>data[].attributes.channel</td><td>channel</td></tr><tr><td>data[].attributes.send_options.use_smart_sending</td><td>send_options_use_smart_sending</td></tr><tr><td>data[].attributes.send_options.ignore_unsubscribes</td><td>send_options_ignore_unsubscribes</td></tr><tr><td>data[].attributes.tracking_options.is_tracking_opens</td><td>tracking_options_is_tracking_opens</td></tr><tr><td>data[].attributes.tracking_options.is_tracking_clicks</td><td>tracking_options_is_tracking_clicks</td></tr><tr><td>data[].attributes.tracking_options.is_add_utm</td><td>tracking_options_is_add_utm</td></tr><tr><td><p>data[].attributes.send_strategy.method</p><p><br></p></td><td>send_strategy_method</td></tr><tr><td>data[].attributes.send_strategy.options_static.datetime</td><td>send_strategy_options_static_datetime</td></tr><tr><td>data[].attributes.send_strategy.options_static.is_local</td><td>send_strategy_options_static_is_local</td></tr><tr><td>data[].attributes.send_strategy.options_static.send_past_recipients_immediately</td><td>send_strategy_options_static_send_past_recipients_immediately</td></tr><tr><td>data[].attributes.send_strategy.options_throttled.datetime</td><td>send_strategy_options_throttled_datetime</td></tr><tr><td>data[].attributes.send_strategy.options_throttled.throttle_percentage</td><td>send_strategy_options_throttled_throttle_percentage</td></tr><tr><td>data[].attributes.send_strategy.options_sto.date</td><td>send_strategy_options_sto_date</td></tr><tr><td>data[].attributes.created_at</td><td>created_at</td></tr><tr><td>data[].attributes.scheduled_at</td><td>scheduled_at</td></tr><tr><td>data[].attributes.updated_at</td><td>updated_at</td></tr><tr><td>data[].attributes.send_time</td><td>send_time</td></tr></tbody></table>

### Campaign Audiences Excluded

* Endpoint: [Get Campaigns](https://developers.klaviyo.com/en/v2023-09-15/reference/get_campaigns)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.campaign_audiences_excluded`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>campaign_id</td></tr><tr><td>data[].attributes.audiences.audience_type[]</td><td>audience_id</td></tr></tbody></table>

### Campaign Audiences Included

* Endpoint: [Get Campaigns](https://developers.klaviyo.com/en/v2023-09-15/reference/get_campaigns)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.campaign_audiences_included`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>campaign_id</td></tr><tr><td>data[].attributes.audiences.audience_type[]</td><td>audience_id</td></tr></tbody></table>

### Campaign Messages

* Endpoint: [Get Campaigns](https://developers.klaviyo.com/en/v2023-09-15/reference/get_campaigns)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.campaign_messages`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>included[].attributes.relationships.campaign.id</td><td>campaign_message_type</td></tr><tr><td>included[].id</td><td>campaign_message_id</td></tr><tr><td>included[].attributes.label</td><td>label</td></tr><tr><td>included[].attributes.channel</td><td>channel</td></tr><tr><td>included[].attributes.content.subject</td><td>content_subject</td></tr><tr><td>included[].attributes.content.preview_text</td><td>content_preview_text</td></tr><tr><td>included[].attributes.content.from_email </td><td>content_from_email</td></tr><tr><td>included[].attributes.content.from_label</td><td>content_from_label</td></tr><tr><td>included[].attributes.content.reply_to_email</td><td>content_reply_to_email</td></tr><tr><td>included[].attributes.content.cc_email</td><td>content_cc_email</td></tr><tr><td>included[].attributes.content.bcc_email</td><td>content_bcc_email</td></tr><tr><td>included[].attributes.render_options.shorten_links</td><td>render_options_shorten_links</td></tr><tr><td>included[].attributes.render_options.add_org_prefix</td><td>render_options_add_org_prefix</td></tr><tr><td>included[].attributes.render_options.add_info_link</td><td>render_options_add_info_link</td></tr><tr><td>included[].attributes.render_options.add_opt_out_language</td><td>render_options_add_opt_out_language</td></tr><tr><td>included[].attributes.created_at </td><td>created_at</td></tr><tr><td>included[].attributes.updated_at</td><td>updated_at</td></tr><tr><td>included[].attributes.relationships.campaign.data.type</td><td>campaign_data_type</td></tr><tr><td>included[].attributes.relationships.campaign.data.id</td><td>campaign_data_id</td></tr><tr><td>included[].attributes.relationships.template.data.type</td><td>template_data_type</td></tr><tr><td>included[].attributes.relationships.template.data.id</td><td>template_data_id</td></tr></tbody></table>

### Campaign Message Send Times

* Endpoint: [Get Campaigns](https://developers.klaviyo.com/en/v2023-09-15/reference/get_campaigns)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.campaign_message_send_times`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>included[].id</td><td>campaign_message_id</td></tr><tr><td>included[].relationships.campaign.data.id</td><td>campaign_id</td></tr><tr><td>included[].attributes.send_times[].datetime</td><td>send_time_datetime</td></tr><tr><td>included[].attributes.send_times[].is_local</td><td>send_time_is_local</td></tr></tbody></table>

### Campaign Tags

* Endpoint: [Get Campaigns](https://developers.klaviyo.com/en/v2023-09-15/reference/get_campaigns)
* Update Method: UPSERT
* Table Name: \[klaviyo\_v2.campaign\_audiences\_excluded]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>campaign_id</td></tr><tr><td>data[].relationships.tags.data[].id</td><td>tag_id</td></tr><tr><td>data[].relationships.tags.data[].type</td><td>tag_type</td></tr></tbody></table>

### Events

* Endpoint: [Get Events](https://developers.klaviyo.com/en/reference/get_events)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.events`]

<details>

<summary>❗️Not all events are pulled by our extractor</summary>

In order to speed up extraction of your events data, we only extract data for the following events:

* received email
* received sms
* bounced email
* failed to deliver sms
* clicked email
* clicked sms
* opened email
* marked email as spam
* unsubscribed
* unsubscribed from sms marketing
* subscribed to list

</details>

<details>

<summary>❗️Some columns in the events table will be NULL</summary>

Some of the event properties in this table exist for only certain types of events.&#x20;

For example, the `TO_NUMBER` property is available only for the following events: Unsubscribed from SMS Marketing, Received SMS, and Failed to Deliver SMS. Since we can't get that data for *all* event types, the `TO_NUMBER` column value will be NULL for many of your events records.

</details>

<table data-full-width="true"><thead><tr><th width="578">JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].attributes.event_properties.$attribution.$attributed_channel</td><td>ATTRIBUTION_ATTRIBUTED_CHANNEL</td></tr><tr><td>data[].attributes.event_properties.$attribution.$attributed_event_id</td><td>ATTRIBUTION_ATTRIBUTED_EVENT_ID</td></tr><tr><td>data[].attributes.event_properties.$attribution.$flow</td><td>ATTRIBUTION_FLOW</td></tr><tr><td>data[].attributes.event_properties.$attribution.$message</td><td>ATTRIBUTION_MESSAGE</td></tr><tr><td>data[].attributes.event_properties.$attribution.$send_ts</td><td>ATTRIBUTION_SEND_TS</td></tr><tr><td>data[].attributes.event_properties.$attribution.$variation</td><td>ATTRIBUTION_VARIATION</td></tr><tr><td>data[].attributes.event_properties.Bounce Type</td><td>BOUNCE_TYPE</td></tr><tr><td>data[].attributes.event_properties.Campaign Name</td><td>CAMPAIGN_NAME</td></tr><tr><td>data[].attributes.event_properties.Carrier Delivery Status</td><td>CARRIER_DELIVERY_STATUS</td></tr><tr><td>data[].attributes.event_properties.Client Canonical</td><td>CLIENT_CANONICAL</td></tr><tr><td>data[].attributes.event_properties.Client Name</td><td>CLIENT_NAME</td></tr><tr><td>data[].attributes.event_properties.Client OS</td><td>CLIENT_OS</td></tr><tr><td>data[].attributes.event_properties.Client OS Family</td><td>CLIENT_OS_FAMILY</td></tr><tr><td>data[].attributes.event_properties.Client Type</td><td>CLIENT_TYPE</td></tr><tr><td>data[].attributes.event_properties.$_cohort$message_send_cohort</td><td>COHORT_MESSAGE_SEND_COHORT</td></tr><tr><td>data[].attributes.event_properties.$_cohort$variation_send_cohort</td><td>COHORT_VARIATION_SEND_COHORT</td></tr><tr><td>data[].attributes.event_properties.Content Type</td><td>CONTENT_TYPE</td></tr><tr><td>data[].attributes.event_properties.Email Domain</td><td>EMAIL_DOMAIN</td></tr><tr><td>data[].attributes.event_properties.$ESP</td><td>ESP</td></tr><tr><td>data[].attributes.datetime</td><td>EVENT_DATETIME</td></tr><tr><td>data[].attributes.event_properties.$event_id</td><td>EVENT_ID</td></tr><tr><td>data[].attributes.event_properties.$extra.$bounce_delivery_info.action_id</td><td>EXTRA_BOUNCE_DELIVERY_INFO_ACTION_ID</td></tr><tr><td>data[].attributes.event_properties.$extra.$bounce_delivery_info.add_exclusion</td><td>EXTRA_BOUNCE_DELIVERY_INFO_ADD_EXCLUSION</td></tr><tr><td>data[].attributes.event_properties.$extra.$bounce_delivery_info.code</td><td>EXTRA_BOUNCE_DELIVERY_INFO_CODE</td></tr><tr><td>data[].attributes.event_properties.$extra.$bounce_delivery_info.ip</td><td>EXTRA_BOUNCE_DELIVERY_INFO_IP</td></tr><tr><td>data[].attributes.event_properties.$extra.$bounce_delivery_info.is_autoresponder</td><td>EXTRA_BOUNCE_DELIVERY_INFO_IS_AUTORESPONDER</td></tr><tr><td>data[].attributes.event_properties.$extra.$bounce_delivery_info.reason</td><td>EXTRA_BOUNCE_DELIVERY_INFO_REASON</td></tr><tr><td>data[].attributes.event_properties.$extra.$bounce_delivery_info.type</td><td>EXTRA_BOUNCE_DELIVERY_INFO_TYPE</td></tr><tr><td>data[].attributes.event_properties.$extra.customer_merge</td><td>EXTRA_CUSTOMER_MERGE</td></tr><tr><td>data[].attributes.event_properties.$extra.From City</td><td>EXTRA_FROM_CITY</td></tr><tr><td>data[].attributes.event_properties.$extra.From Country</td><td>EXTRA_FROM_COUNTRY</td></tr><tr><td>data[].attributes.event_properties.$extra.From State</td><td>EXTRA_FROM_STATE</td></tr><tr><td>data[].attributes.event_properties.$extra.IP Address</td><td>EXTRA_IP_ADDRESS</td></tr><tr><td>data[].attributes.event_properties.$extra.Message Body</td><td>EXTRA_MESSAGE_BODY</td></tr><tr><td>data[].attributes.event_properties.$extra.Message ID</td><td>EXTRA_MESSAGE_ID</td></tr><tr><td>data[].attributes.event_properties.$extra.$metadata.recipient_variation_id</td><td>EXTRA_METADATA_RECIPIENT_VARIATION_ID</td></tr><tr><td>data[].attributes.event_properties.Failure Source</td><td>FAILURE_SOURCE</td></tr><tr><td>data[].attributes.event_properties.Failure Type</td><td>FAILURE_TYPE</td></tr><tr><td>data[].attributes.event_properties.$flow</td><td>FLOW</td></tr><tr><td>data[].attributes.event_properties.From Number</td><td>FROM_NUMBER</td></tr><tr><td>data[].attributes.event_properties.From Phone Region</td><td>FROM_PHONE_REGION</td></tr><tr><td>data[].id </td><td>ID</td></tr><tr><td>data[].attributes.event_properties.Inbox Provider</td><td>INBOX_PROVIDER</td></tr><tr><td>data[].attributes.event_properties.$internal.send_timestamp</td><td>INTERNAL_SEND_TIMESTAMP</td></tr><tr><td>data[].attributes.event_properties.$internal.vendor</td><td>INTERNAL_VENDOR</td></tr><tr><td>data[].attributes.event_properties.$extra.$bounce_delivery_info.ip</td><td>IP</td></tr><tr><td>data[].attributes.event_properties.$klaviyo_bounce_category</td><td>KLAVIYO_BOUNCE_CATEGORY</td></tr><tr><td>data[].attributes.event_properties.List</td><td>LIST</td></tr><tr><td>data[].attributes.event_properties.machine_open</td><td>MACHINE_OPEN</td></tr><tr><td>data[].attributes.event_properties.$message</td><td>MESSAGE</td></tr><tr><td>data[].attributes.event_properties.Message Body</td><td>MESSAGE_BODY</td></tr><tr><td>data[].attributes.event_properties.Message Format</td><td>MESSAGE_FORMAT</td></tr><tr><td>data[].attributes.event_properties.$message_interaction</td><td>MESSAGE_INTERACTION</td></tr><tr><td>data[].attributes.event_properties.Message Name</td><td>MESSAGE_NAME</td></tr><tr><td>data[].attributes.event_properties.Message Type</td><td>MESSAGE_TYPE</td></tr><tr><td>data[].attributes.event_properties.Method</td><td>METHOD</td></tr><tr><td>data[].relationships.metric.data.id</td><td>METRIC_DATA_ID</td></tr><tr><td>data[].relationships.metric.data.type</td><td>METRIC_DATA_TYPE</td></tr><tr><td>data[].relationships.profile.data.id</td><td>PROFILE_DATA_ID</td></tr><tr><td>data[].relationships.profile.data.type</td><td>PROFILE_DATA_TYPE</td></tr><tr><td>data[].relationships.profile.data.id</td><td>PROFILE_EMAIL</td></tr><tr><td>data[].attributes.event_properties.Segment Count</td><td>SEGMENT_COUNT</td></tr><tr><td>data[].attributes.event_properties.Subject</td><td>SUBJECT</td></tr><tr><td>data[].attributes.timestamp</td><td>TIMESTAMP</td></tr><tr><td>data[].attributes.event_properties.To Number</td><td>TO_NUMBER</td></tr><tr><td>data[].attributes.event_properties.To Phone Region</td><td>TO_PHONE_REGION</td></tr><tr><td>data[].type</td><td>TYPE</td></tr><tr><td>data[].attributes.event_properties.URL</td><td>URL</td></tr><tr><td>data[].attributes.uuid</td><td>UUID</td></tr><tr><td>data[].attributes.event_properties.$variation</td><td>VARIATION</td></tr><tr><td>data[].attributes.event_properties.Vendor Error Code</td><td>VENDOR_ERROR_CODE</td></tr></tbody></table>

### Event Attribution Group IDs

### Event Group IDs

### Flows

* Endpoint: [Get Flows](https://developers.klaviyo.com/en/v2023-09-15/reference/get_flows)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.flows`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].attributes.name</td><td>name</td></tr><tr><td>data[].attributes.status</td><td>status</td></tr><tr><td>data[].attributes.archived</td><td>archived</td></tr><tr><td>data[].attributes.created</td><td>created</td></tr><tr><td>data[].attributes.updated</td><td>updated</td></tr><tr><td>data[].attributes.trigger_type</td><td>trigger_type</td></tr></tbody></table>

### Flow Actions

* Endpoint: [Get Flows](https://developers.klaviyo.com/en/v2023-09-15/reference/get_flows)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.flow_actions`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>flow_action_id</td></tr><tr><td>data[].relationships.flow.data.id</td><td>flow_id</td></tr><tr><td>data[].attributes.action_type</td><td>action_type</td></tr><tr><td>data[].attributes.status</td><td>status</td></tr><tr><td>data[].attributes.created</td><td>created</td></tr><tr><td>data[].attributes.updated</td><td>updated</td></tr><tr><td>data[].attributes.tracking_options.add_utm</td><td>tracking_options_add_utm</td></tr><tr><td>data[].attributes.tracking_options.utms</td><td>tracking_options_utm_params</td></tr><tr><td>data[].attributes.tracking_options.is_tracking_opens</td><td>tracking_options_is_tracking_opens</td></tr><tr><td>data[].attributes.tracking_options.is_tracking_clicks</td><td>tracking_options_is_tracking_clicks</td></tr><tr><td>data[].attributes.send_options.use_smart_tracking</td><td>send_options_use_smart_tracking</td></tr><tr><td>data[].attributes.send_options.is_transactional</td><td>send_options_is_transactional</td></tr></tbody></table>

### Flow Action Messages

* Endpoint: [Get Flows](https://developers.klaviyo.com/en/v2023-09-15/reference/get_flows)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.flow_action_messages`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>included[].id</td><td>flow_action_id</td></tr><tr><td>included[].attributes.id</td><td>flow_action_message_id</td></tr><tr><td>included[].attributes.name</td><td>name</td></tr><tr><td>included[].attributes.channel</td><td>channel</td></tr><tr><td>included[].attributes.created</td><td>created</td></tr><tr><td>included[].attributes.updated</td><td>updated</td></tr><tr><td>included[].attributes.content.subject</td><td>content_subject</td></tr><tr><td>included[].attributes.content.preview_text</td><td>content_preview_text</td></tr><tr><td>included[].attributes.content.from_email</td><td>content_from_email</td></tr><tr><td>included[].attributes.content.from_label</td><td>content_rom_label</td></tr><tr><td>included[].attributes.content.reply_to_email</td><td>content_reply_to_email</td></tr><tr><td>included[].attributes.content.cc_email</td><td>content_cc_email</td></tr></tbody></table>

### Lists

* Endpoint: [Get List Profiles](https://developers.klaviyo.com/en/v2023-09-15/reference/get_list_profiles)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.lists`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>list_id</td></tr><tr><td>data[].name</td><td>name</td></tr><tr><td>data[].created</td><td>created</td></tr><tr><td>data[].updated</td><td>updated</td></tr></tbody></table>

### List Profiles

* Endpoint: [Get List Profiles](https://developers.klaviyo.com/en/v2023-09-15/reference/get_list_profiles)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.list_profiles`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>(part of url path, not part of response)</td><td>list_id</td></tr><tr><td>data[].id</td><td>profile_id</td></tr></tbody></table>

### List Tags

* Endpoint: [Get List Profiles](https://developers.klaviyo.com/en/v2023-09-15/reference/get_list_profiles)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.list_tags`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>list_id</td></tr><tr><td>data[].relationships.tags.data</td><td>tag_id</td></tr></tbody></table>

### Member Lists

### Metrics

* Endpoint: [Get ](https://developers.klaviyo.com/en/v2023-09-15/reference/get_metrics)[Metrics](https://developers.klaviyo.com/en/v2023-09-15/reference/get_metrics)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.metrics`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>list_id</td></tr><tr><td>data[].attributes.name</td><td>tag_id</td></tr><tr><td>data[].attributes.created</td><td>created</td></tr><tr><td>data[].attributes.updated</td><td>updated</td></tr><tr><td>data[].attributes.integration.id</td><td>integration_id</td></tr><tr><td>data[].attributes.integration.name</td><td>integration_name</td></tr><tr><td>data[].attributes.integration.category</td><td>integration_category</td></tr></tbody></table>

### Profiles

* Endpoint: [Get Profiles](https://developers.klaviyo.com/en/v2023-09-15/reference/get_profiles)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.profiles`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>profile_id</td></tr><tr><td>data[].attributes.email</td><td>email</td></tr><tr><td>data[].attributes.phone_number</td><td>phone_number</td></tr><tr><td>data[].attributes.external_id</td><td>external_id</td></tr><tr><td>data[].attributes.first_name</td><td>first_name</td></tr><tr><td>data[].attributes.last_name</td><td>last_name</td></tr><tr><td>data[].attributes.organization</td><td>organization</td></tr><tr><td>data[].attributes.image</td><td>image</td></tr><tr><td>data[].attributes.created</td><td>created</td></tr><tr><td>data[].attributes.updated</td><td>updated</td></tr><tr><td>data[].attributes.last_event_date</td><td>last_event_date</td></tr><tr><td>data[].attributes.properties</td><td>properties</td></tr><tr><td>data[].attributes.location.address1</td><td>location_address1</td></tr><tr><td>data[].attributes.location.address2</td><td>location_address2</td></tr><tr><td>data[].attributes.location.city</td><td>location_city</td></tr><tr><td>data[].attributes.location.country</td><td>location_country</td></tr><tr><td>data[].attributes.location.latitude</td><td>location_latitude</td></tr><tr><td>data[].attributes.location.longitude</td><td>location_longitude</td></tr><tr><td>data[].attributes.location.region</td><td>location_region</td></tr><tr><td>data[].attributes.location.timezone</td><td>location_timezone</td></tr><tr><td>data[].attributes.location.ip</td><td>location_ip</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.consent</td><td>email_marketing_consent</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.marketing</td><td>email_marketing_timestamp</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.method</td><td>email_marketing_method</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.method_detail</td><td>email_marketing_method_detail</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.custom_method_detail</td><td>email_marketing_custom_method_detail</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.double_optin</td><td>email_marketing_double_optin</td></tr><tr><td>data[].attributes.subscriptions.sms.marketing.consent</td><td>sms_marketing_consent</td></tr><tr><td>data[].attributes.subscriptions.sms.marketing.timestamp</td><td>sms_marketing_timestamp</td></tr><tr><td>data[].attributes.subscriptions.sms.marketing.method</td><td>sms_marketing_method</td></tr><tr><td>data[].attributes.subscriptions.sms.marketing.method_detail</td><td>sms_marketing_method_detail</td></tr></tbody></table>

### Profile Email List Suppressions

* Endpoint: [Get Profiles](https://developers.klaviyo.com/en/v2023-09-15/reference/get_profiles)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.profile_email_list_suppressions`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>profile_id</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.list_suppressions[].reason</td><td>reason</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.list_suppressions[].list_id</td><td>list_id</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.list_suppressions[].timestamp</td><td>timestamp</td></tr></tbody></table>

### Profile Email Suppressions

* Endpoint: [Get Profiles](https://developers.klaviyo.com/en/v2023-09-15/reference/get_profiles)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.profile_email_suppressions`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>profile_id</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.suppressions[].reason</td><td>reason</td></tr><tr><td>data[].attributes.subscriptions.email.marketing.suppressions[].timestamp</td><td>timestamp</td></tr></tbody></table>

### Segments

* Endpoint: [Get Segments](https://developers.klaviyo.com/en/v2023-09-15/reference/get_segments)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.segments`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>segment_id</td></tr><tr><td>data[].attributes.name</td><td>name</td></tr><tr><td>data[].attributes.created</td><td>created</td></tr><tr><td>data[].attributes.updated</td><td>updated</td></tr></tbody></table>

### Segment Profiles

* Endpoint: [Get ](https://developers.klaviyo.com/en/v2023-09-15/reference/get_profiles)Segment\_Profiles
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.segment_profiles`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>(part of url path, not part of response)</td><td>segment_id</td></tr><tr><td>data[].id</td><td>profile_id</td></tr></tbody></table>

### Segment Tags

* Endpoint: [Get Segments](https://developers.klaviyo.com/en/v2023-09-15/reference/get_segments)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.segment_tags`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>segment_id</td></tr><tr><td>data[].relationships.tags.data[].id</td><td>tag_id</td></tr></tbody></table>

### STG Member Lists

### Tags

* Endpoint: [Get Tags](https://developers.klaviyo.com/en/v2023-09-15/reference/get_tags)
* Update Method: UPSERT
* Table Name: \[`klaviyo_v2.tags`]

<table data-full-width="true"><thead><tr><th>JSON Element</th><th>Database Column</th></tr></thead><tbody><tr><td>data[].id</td><td>tag_id</td></tr><tr><td>data[].attributes.name</td><td>name</td></tr></tbody></table>

## Known Limitations & API Behavior

#### Deleted Flow Behavior

When flows are deleted in Klaviyo, the API behavior creates a data synchronization issue between flow metrics and flow metadata.

**API Behavior for Deleted Flows**

When a flow is deleted in Klaviyo:

* Flow-related events and metrics continue to be returned by the Get Events and Get Metrics endpoints
* The Get Flows endpoint returns a 404 error for deleted flow IDs
* Flow IDs remain in the `events` table (specifically in `FLOW` and `ATTRIBUTION_FLOW` columns) but have no corresponding record in the `flows` table

**Impact on Table Relationships**

This creates orphaned records where:

* `events.FLOW` or `events.ATTRIBUTION_FLOW` contains flow IDs that do not exist in `flows.flow_id`
* Flow performance metrics exist without corresponding flow metadata (name, status, trigger\_type, etc.)
* Joins between events and flows tables on flow\_id will return null values for flow attributes

**Data Integration Behavior**

The Daasity extractor handles this scenario by:

* Continuing to extract flow-related events even when flow metadata returns 404
* Skipping flow metadata updates for deleted flows rather than failing the extraction
* Preserving any previously-loaded flow metadata (flows deleted after initial load will retain their last-known metadata)

{% hint style="info" %}
**Important:** This is expected behavior based on Klaviyo's API design and affects all merchants using the Klaviyo V2 integration.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.daasity.com/core-concepts/data-integrations/setup-guides/digital-integrations/klaviyo-v2/integration-specifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
