Skip to main content
Skip table of contents

Public Klaviyo API Reference

The public API procedures may call the internal procedures which should not be used directly as they can be changed without any explicit notification in the newer versions of the connector. Internal procedures can be recognized by the internal_ prefix in their names. Public API procedures do not have such prefixes in their names.

Campaign

Summary information for the campaign
Parameter
<campaign_id> (required): Campaign Id
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

name

string

campaign_type

string

from_email

string

from_name

string

is_segmented

boolean

message_type

string

num_recipients

integer

object

string

send_time

timestamp

sent_at

timestamp

status

string

status_id

integer

status_label

string

subject

string

template_html

string

template_id

string

template_object

string

created

timestamp

updated

timestamp

Example

SQL
CREATE VIEW klaviyo_examples.example_Campaign AS 
	SELECT * 
	FROM (
		CALL klaviyo.Campaign (
			campaign_id => '01HGK1E21CTV9TK1HGN4EM8M88'
		)
	) AS x

CampaignMessageCampaign

The related campaign
Parameter
<message_id> (optional): The list id
<message_table> (optional): The table name with message data
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

Description

message_id

string

The message id

type

string

Campaign

id

string

The campaign id

name

string

The campaign name

status

string

The campaign status

archived

boolean

Whether the campaign has been archived or not

send_options_use_smart_sending

boolean

Use smart sending

send_options_ignore_unsubscribes

boolean

Ignore unsubscribes

tracking_options_is_add_utm

boolean

Whether the campaign needs UTM parameters

tracking_options_is_tracking_clicks

boolean

Whether the campaign is tracking click events

tracking_options_is_tracking_opens

boolean

Whether the campaign is tracking open events

send_strategy_method

string

Describes the shape of the options object

send_strategy_options_static_datetime

timestamp

The time to send at

send_strategy_options_static_is_local

boolean

If the campaign should be sent with local recipient timezone send or statically sent at the given time

send_strategy_options_static_send_past_recipients_immediately

boolean

Determines if we should send to local recipient timezone if the given time has passed

created_at

timestamp

The datetime when the campaign was created

scheduled_at

timestamp

The datetime when the campaign was scheduled for future sending

updated_at

timestamp

The datetime when the campaign was last updated

send_time

timestamp

The datetime when the campaign will be / was sent or None if not yet scheduled by a send_job

included_audiences

string

A list of included audiences

excluded_audiences

string

A list of excluded audiences

CampaignMessageTemplate

The related template
Parameter
<message_id> (optional): The message id
<message_table> (optional): The table name with message data
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

Description

message_id

string

The message id

type

string

Template

id

string

The ID of template

name

string

The name of the template

editor_type

string

Editor type

html

string

The rendered HTML of the template

text

string

The template plain_text

created

timestamp

The datetime when the template was created

updated

timestamp

The datetime when the template was last updated

CampaignRecipientEstimation

The estimated recipient count for a campaign
Parameter
<campaign_id> (optional): The list id
<campaign_table> (optional): The table name with campaign data
<channel_filter> (optional): Channel filter: sms or email
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

Description

campaign_id

string

The campaign id

type

string

Campaign recipient estimation

estimated_recipient_count

integer

The estimated number of unique recipients the campaign will send to

CampaignRecipientInformation

Summary information about email recipients for the campaign
Parameter
<campaign_id> (required): Campaign Id
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

customer_id

string

email

string

status

string

variation_id

string

Example

SQL
CREATE VIEW klaviyo_examples.example_CampaignRecipientInformation AS 
	SELECT * 
	FROM (
		CALL klaviyo.CampaignRecipientInformation (
			campaign_id => '01HGK1E21CTV9TK1HGN4EM8M88'
		)
	) AS x

Campaigns

Campaigns
Parameter
<channel_filter> (required): Channel filter: sms or email
<initial_date> (optional): Earliest datetime to retrieve data
<campaign_id> (optional): Campaign id
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

type

string

Campaign

id

string

The campaign id

name

string

The campaign name

status

string

The campaign status

archived

boolean

Whether the campaign has been archived or not

send_options_use_smart_sending

boolean

Use smart sending

send_options_ignore_unsubscribes

boolean

Ignore unsubscribes

tracking_options_is_add_utm

boolean

Whether the campaign needs UTM parameters

tracking_options_is_tracking_clicks

boolean

Whether the campaign is tracking click events

tracking_options_is_tracking_opens

boolean

Whether the campaign is tracking open events

send_strategy_method

string

Describes the shape of the options object

send_strategy_options_static_datetime

timestamp

The time to send at

send_strategy_options_static_is_local

boolean

If the campaign should be sent with local recipient timezone send or statically sent at the given time

send_strategy_options_static_send_past_recipients_immediately

boolean

Determines if we should send to local recipient timezone if the given time has passed

options_throttled_datetime

timestamp

Throttled method: the time to send at

options_throttled_throttle_percentage

integer

Throttled method: the percentage of recipients per hour to send to

options_sto_date

date

The day to send on

created_at

timestamp

The datetime when the campaign was created

scheduled_at

timestamp

The datetime when the campaign was scheduled for future sending

updated_at

timestamp

The datetime when the campaign was last updated

send_time

timestamp

The datetime when the campaign will be / was sent or None if not yet scheduled by a send_job

included_audiences

string

A list of included audiences

excluded_audiences

string

A list of excluded audiences

Example

SQL
CREATE VIEW klaviyo_examples.example_Campaigns AS 
	SELECT * 
	FROM (
		CALL klaviyo.Campaigns (
			channel_filter => 'email',
			preview => true
	)
) AS x;;

EmailTemplates

Email template objects
Parameter
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

name

string

html

string

is_writeable

boolean

object

string

created

timestamp

updated

timestamp

Example

SQL
CREATE VIEW klaviyo_examples.example_EmailTemplates AS 
	SELECT * 
	FROM (
		CALL klaviyo.EmailTemplates (
			preview => true
		)
	) AS x

ListDetails

Information about a list
Parameter
<list_id> (required): List Id
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

folder_name

string

list_name

string

created

timestamp

updated

timestamp

Example

SQL
CREATE VIEW klaviyo_examples.example_ListDetails AS 
	SELECT * 
	FROM (
		CALL klaviyo.ListDetails (
			list_id => 'HCeNVy'
		)
	) AS x

ListExclusions

Emails and phone numbers that have been excluded from a list along with the exclusion reasons and exclusion time
Parameter
<list_id> (required): List Id
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

email

string

phone_number

string

reason

string

created

timestamp

Example

SQL
CREATE VIEW klaviyo_examples.example_ListExclusions AS 
	SELECT * 
	FROM (
		CALL klaviyo.ListExclusions (
			list_id => 'HCeNVy'
		)
	) AS x

ListGroupMemberships

Emails, phone numbers, and push tokens for profiles in a given list or segment
Parameter
<list_id> (required): List Id or Segment Id
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

email

string

Example

SQL
CREATE VIEW klaviyo_examples.example_ListGroupMemberships AS 
	SELECT * 
	FROM (
		CALL klaviyo.ListGroupMemberships (
			list_id => 'HCeNVy'
		)
	) AS x

ListMembership

Check if profiles are on a list
Parameter
<list_id> (required): List Id
<emails> (optional): CSV list of the emails corresponding to the profiles that you would like to check
<phone_numbers> (optional): CSV list of phone numbers corresponding to the profiles that you would like to check. Phone numbers must be in E.164 format
<push_tokens> (optional): CSV list of push tokens corresponding to the profiles that you would like to check
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

email

string

created

timestamp

Example

SQL
CREATE VIEW klaviyo_examples.example_ListMembership AS 
	SELECT * 
	FROM (
		CALL klaviyo.ListMembership (
			list_id => 'HCeNVy',
			emails => 'oliverdinoguida@gmail.com',
			phone_numbers => NULL,
			push_tokens => NULL
		)
	) AS x

ListProfiles

All profiles within a lists
Parameter
<list_id> (optional): The list id
<list_table> (optional): The table name with list data
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

Description

list_id

string

The list id

profile_id

string

The profile id

ListSubscriptions

Check if profiles are on a list and not suppressed
Parameter
<list_id> (required): List Id
<emails> (optional): CSV list of the emails corresponding to the profiles that you would like to check
<phone_numbers> (optional): CSV list of phone numbers corresponding to the profiles that you would like to check. Phone numbers must be in E.164 format
<push_tokens> (optional): CSV list of push tokens corresponding to the profiles that you would like to check
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

email

string

created

timestamp

Example

SQL
CREATE VIEW klaviyo_examples.example_ListSubscriptions AS 
	SELECT * 
	FROM (
		CALL klaviyo.ListSubscriptions (
			list_id => 'HCeNVy',
			emails => 'oliverdinoguida@gmail.com',
			phone_numbers => NULL,
			push_tokens => NULL
		)
	) AS x

Lists

Lists in an account
Parameter
<list_id> (optional): The list id
<initial_date> (optional): Earliest datetime to retrieve data
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

Description

list_id

string

The list id

type

string

Metric

list_name

string

The list name

created

timestamp

Creation time

updated

timestamp

Last updated time

Example

SQL
CREATE VIEW klaviyo_examples.example_Lists AS 
	SELECT * 
	FROM (
		CALL klaviyo.Lists (
			preview => true
	)
) AS x;;

MetricExport

Export event data from Klaviyo, optionally filtering and segmented on available event properties
Parameter
<metric_id> (required): Metric Id
<start_date> (optional): Beginning of timeframe to pull event data for. The default value is 1 month ago
<end_date> (optional): End of timeframe to pull event data for. The default is the current day
<measurement> (optional): Type of metric to fetch - one of 'unique', 'count', 'value', or 'sum'. Defaults to 'count'. For 'sum' a property name to operate on must be supplied as a JSON-encoded list like '"sum","ItemCount"'
<unit> (optional): Granularity to bucket data points into - one of 'day', 'week', or 'month'. Defaults to 'day'
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

date

date

start_date

date

end_date

date

unit

string

values

bigdecimal

metric_id

string

metric_integration_category

string

metric_integration_id

string

metric_integration_name

string

metric_name

string

metric_created

timestamp

metric_updated

timestamp

Example

SQL
CREATE VIEW klaviyo_examples.example_MetricExport AS 
	SELECT * 
	FROM (
		CALL klaviyo.MetricExport (
			metric_id => 'Htpnp4',
			start_date => NULL,
			end_date => NULL,
			unit => NULL,
			measurement => NULL
		)
	) AS x

Metrics

Metrics in Klaviyo
Parameter
<metric_id> (optional): Metric Id
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

Description

id

string

The Metric ID

type

string

Metric

name

string

The name of the metric

created

timestamp

Creation time

updated

timestamp

Last updated time

integration_category

string

The integration category associated with the event

integration_id

string

The integration id associated with the event

integration_name

string

The integration name associated with the event

integration_object

string

The integration object associated with the event

Example

SQL
CREATE VIEW klaviyo_examples.example_Metrics AS 
	SELECT * 
	FROM (
		CALL klaviyo.Metrics ()
) AS x;;

MetricsTimeline

Batched timeline of all events in your Klaviyo account for one specific type of metric or for all
Parameter
<metric_id> (optional): Metric Id
<start_date> (optional): When filled get data after the start_date only
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

uuid

string

statistic_id

string

datetime

timestamp

event_name

string

event_properties_browser

string

event_properties_event_id

string

event_properties_is_session_activity

boolean

event_properties_os

string

event_properties_page

string

event_properties_session_end

timestamp

object

string

person_id

string

person_first_name

string

person_last_name

string

person_email

string

person_object

string

person_created

timestamp

person_updated

timestamp

timestamp

integer

Example

SQL
CREATE VIEW klaviyo_examples.example_MetricsTimeline AS 
	SELECT * 
	FROM (
		CALL klaviyo.MetricsTimeline (
			start_date => TIMESTAMPADD (SQL_TSI_DAY, -1, CURDATE ())
		)
	) AS x

PersonAttributes

All the data attributes for a person, based on the Klaviyo Person ID
Parameter
<person_id> (required): Person Id
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

email

string

first_name

string

last_name

string

object

string

created

string

updated

string

Example

SQL
CREATE VIEW klaviyo_examples.example_PersonAttributes AS 
	SELECT * 
	FROM (
		CALL klaviyo.PersonAttributes (
			person_id => 'QmWxbp'
		)
	) AS x

PersonEventTimeline

Batched timeline of all events for a person
Parameter
<person_id> (required): Person Id
<start_date> (optional): When filled get data after the start_date only
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

uuid

string

statistic_id

string

datetime

timestamp

event_name

string

event_properties_browser

string

event_properties_event_id

string

event_properties_is_session_activity

boolean

event_properties_os

string

event_properties_page

string

event_properties_session_end

timestamp

object

string

person_id

string

person_first_name

string

person_last_name

string

person_email

string

person_object

string

person_created

timestamp

person_updated

timestamp

timestamp

integer

Example

SQL
CREATE VIEW klaviyo_examples.example_PersonEventTimeline AS 
	SELECT * 
	FROM (
		CALL klaviyo.PersonEventTimeline (
			person_id => 'QmWxbp',
			start_date => TIMESTAMPADD (SQL_TSI_YEAR, -1, CURDATE ())
		)
	) AS x

PersonMetricTimeline

Person's batched timeline for one specific event type
Parameter
<person_id> (required): Person Id
<metric_id> (required): Metric Id
<start_date> (optional): When filled get data after the start_date only
<preview> (optional): Preview only, don't write into table
<target_table> (optional): Table name to save the data to
<label> (optional): Multi-tenancy label

Attribute

Type

id

string

uuid

string

statistic_id

string

datetime

timestamp

event_name

string

event_properties_browser

string

event_properties_event_id

string

event_properties_is_session_activity

boolean

event_properties_os

string

event_properties_page

string

event_properties_session_end

timestamp

object

string

person_id

string

person_first_name

string

person_last_name

string

person_email

string

person_object

string

person_created

timestamp

person_updated

timestamp

timestamp

integer

Example

SQL
CREATE VIEW klaviyo_examples.example_PersonMetricTimeline AS 
	SELECT * 
	FROM (
		CALL klaviyo.PersonMetricTimeline (
			person_id => 'QmWxbp',
			metric_id => 'Htpnp4',
			start_date => TIMESTAMPADD (SQL_TSI_YEAR, -1, CURDATE ())
		)
	) AS x

CatalogItems

Catalog Items
Parameter
<catalog_item_id> (optional): Flow id
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

type

string

The type of catalog item

id

string

The catalog item id

external_id

string

The external item id

title

string

The title of catalog item

description

string

The description of catalog item

url

string

The url of catalog item

image_full_url

string

The image full url of catalog item

image_thumbnail_url

string

The image thumbnail url of catalog item

created

timestamp

Timestamp of when a flow is created

updated

timestamp

Timestamp of when a flow is updated

published

boolean

Published

links

string

Links

SQL
Create View klaviyo_examples.example_CatalogItems
As 
	Select * From klaviyo.CatalogItems (
		preview => true
);;

Events

Events
Parameter
<initial_date> (required): Earliest datetime to retrieve data
<event_id> (optional): Event id
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

type

string

The type of event

id

string

The event id

metric_id

string

The metric id

profile_id

string

The profile id

attributes_timestamp

timestamp

Attributes timestamp

form_id

string

Form id

form_version_id

string

Form version id

form_type

string

Form type

device_type

string

Device type

page_url

string

Page url

event_id

string

$event id

attributes_datetime

timestamp

Attributes datetime

attributes_uuid

string

UUID

links

string

Links

FlowActions

Flow Actions
Parameter
<flow_id> (optional): Flow id
<flow_table> (optional): Table with id of the flows
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

flow_id

string

Flow id

type

string

The type of flow action

id

string

The flow action id

action_type

string

The action type

status

string

The status of flow action

created

timestamp

Timestamp of when a flow action is created

updated

timestamp

Timestamp of when a flow action is updated

send_options_use_smart_sending

boolean

Send option - use smart sending

send_options_is_transactional

boolean

Send option - is transactional

render_options_shorten_links

boolean

Render option - options shorten links

render_options_add_org_prefix

boolean

Render option - add org prefix

render_options_add_info_link

boolean

Render option - add info link

render_options_add_opt_out_language

boolean

Render option - add opt out language

links

string

Links

SQL
Create View klaviyo_examples.example_FlowActions
As 
	Select * From klaviyo.FlowActions (
		preview => true
);;

Flows

Flows
Parameter
<flow_id> (optional): Flow id
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

type

string

The type of flow

id

string

The flow id

name

string

The name of flow

status

string

The status of flow

archived

boolean

Indicates whether the flow was archived

created

timestamp

Timestamp of when a flow is created

updated

timestamp

Timestamp of when a flow is updated

trigger_type

string

The trigger type

links

string

Links

SQL
Create View klaviyo_examples.example_Flows
As 
	Select * From klaviyo.Flows (
		preview => true
);

MessagesForFlowAction

Messages for flow action
Parameter
<flow_action_id> (optional): Flow id
<flow_action_table> (optional): Table with id of the flows
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

flow_action_id

string

Flow id

type

string

The type of flow action

id

string

The flow action id

name

string

The flow action name

channel

string

The channel of flow action

content_subject

string

Subject

content_preview_text

string

Preview text

content_from_email

string

From email

content_from_name

string

From name

created

timestamp

Timestamp of when a flow action is created

updated

timestamp

Timestamp of when a flow action is updated

links

string

Links

SQL
Create View klaviyo_examples.example_MessagesForFlowAction
As 
	Select * From klaviyo.MessagesForFlowAction (
		preview => true
);;

ProfileLists

List memberships for a profile with the given profile ID
Parameter
<profile_id> (optional): Profile id
<profile_table> (optional): Table with id of the Profiles
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

type

string

The type of list

id

string

The list id

name

string

The name of list

created

timestamp

Timestamp of when a list is created

updated

timestamp

Timestamp of when a list is updated

links

string

Links

SQL
Create View klaviyo_examples.example_ProfileLists
As 
	Select * From klaviyo.ProfileLists (
		preview => true
);;

Profiles

Profiles
Parameter
<profile_id> (optional): Flow id
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

type

string

The type of profile

id

string

The profile id

email

string

Email

phone_number

string

Phone number

external_id

string

The external id

anonymous_id

string

The anonymous id

first_name

string

First name

last_name

string

Last name

organization

string

Organization

title

string

Title

image

string

Image

created

timestamp

Timestamp of when a profile is created

updated

timestamp

Timestamp of when a profile is updated

last_event_date

timestamp

Last event date

location_address1

string

Location - address1

location_address2

string

Location - address2

location_city

string

Location - city

location_country

string

Location - country

location_latitude

string

Location - latitude

location_longitude

string

Location - longitude

location_region

string

Location - region

location_zip

string

Location - zip

location_timezone

string

Location - timezone

links

string

Links

SQL
Create View klaviyo_examples.example_Profiles
As 
	Select * From klaviyo.Profiles (
		preview => true
);;

SegmentProfiles

All profiles Id within the given segment Id
Parameter
<segment_id> (optional): Segment id
<segment_table> (optional): Table with id of the segments
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

segment_id

string

The segment id

profile_id

string

The profile id

SQL
Create View klaviyo_examples.example_SegmentProfiles
As 
	Select * From klaviyo.SegmentProfiles (
		preview => true
);;

Segments

Segments
Parameter
<segment_id> (optional): Segment id
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

type

string

The type of segment

id

string

The segment id

name

string

The name of segment

created

timestamp

Timestamp of when a segment is created

updated

timestamp

Timestamp of when a segment is updated

links

string

Links

SQL
Create View klaviyo_examples.example_Segments
As 
	Select * From klaviyo.Segments (
		preview => true
);;

Templates

Templates
Parameter
<template_id> (optional): Template id
<target_table> (optional): Table name to save the data to
<preview> (optional): Preview only, don't write into table
<label> (optional): Multi-tenancy label

Attribute

Type

Description

type

string

The type of template

id

string

The template id

company_id

string

The company id

name

string

The name of template

editor_type

string

The editor type

created

timestamp

Timestamp of when a template is created

updated

timestamp

Timestamp of when a template is updated

links

string

Links

SQL
Create View klaviyo_examples.example_Templates
As 
Select * From klaviyo.Templates (
	preview => true
);;
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.