Klaviyo Ruby SDK
- SDK version: 4.1.0
- API revision: 2023-08-15
Helpful Resources
Design & Approach
This SDK is a thin wrapper around our API. See our API Reference for full documentation on API behavior.
Organization
This SDK is organized into the following resources:
Accounts
Campaigns
Catalogs
Data Privacy
Events
Flows
Lists
Metrics
Profiles
Segments
Tags
Templates
Installation
Build
To build the Ruby code into a gem:
gem build klaviyo-api-sdk.gemspec
Then install the gem locally:
gem install ./klaviyo-api-sdk-4.1.0.gem
Finally add this to the Gemfile:
gem 'klaviyo-api-sdk', '~> 4.1.0'
To install directly from rubygems:
gem install klaviyo-api-sdk
Usage Example
To load the gem
# Load the gem
require 'klaviyo-api-sdk'
# Setup authorization
KlaviyoAPI.configure do |config|
config.api_key['Klaviyo-API-Key'] = 'Klaviyo-API-Key your-api-key'
#config.max_retries = 5 # optional
#config.max_delay = 60 # optional
end
NOTE:
- The SDK retries on resolvable errors, namely: rate limits (common) and server errors on klaviyo (rare).
max_retry
denotes number of attempts the client will make in order to execute the request successfully.max_delay
denotes total delay (in seconds) across all attempts.
To call the get_catalog_items
operation:
opts = {
include: ['variants'],
sort: 'created',
filter: 'equals(published,false)',
fields_catalog_item: ['external_id','title']
}
begin
result = KlaviyoAPI::Catalogs.get_catalog_items(opts)
end
Error Handling
This SDK throws an ApiException
error when the server returns a non-2XX
response.
begin
result = KlaviyoAPI::Catalogs.get_catalog_items(opts)
rescue KlaviyoAPI::ApiError => e
puts "Error when calling get_catalog_items #{e}"
end
Method signatures
get
operations can be passed an optionalopts
object (e.g.get_list_profiles(opts)
).opts
describes the available options for fetching data (some operations only support a subset of these or none). i.e.opts = { include: ['variants'], # includes sort: '-created', # sorting filter: 'equals(published,false)', # filters page_cursor: 'page_cursor_example', # cursor pagination fields_catalog_item: ['external_id','title'], # sparse fieldset fields_catalog_variant: ['external_id','title'], # sparse fieldset additional_fields_profile: ['predictive_analytics'], # for endpoints that support predictive analytics such as `get_profile` }
**Note, for parameters that use square brackets such as
page[cursor]
orfields[catalog-item]
ruby will replace the square brackets[]
with_
underscores.For
create
,update
& somedelete
operations (i.e.create_catalog_item
orupdate_catalog_item
ordelete_catalog_category_relationships
) thebody
object is required in the method signature (i.e.create_catalog_item(body)
).body = { data: { type: "catalog-item", attributes: { external_id: "catalog-item-test", title: "Catalog Item Test", description: "this is a description", url: "http://catalog-item.klaviyo.com", published: true } } } KlaviyoAPI::Catalogs.create_catalog_item(body)
Optional Parameters and Json Api Features
Here we will go over
- Pagination
- Page size
- Additional Fields
- Filtering
- Sparse Fields
- Sorting
- Relationships
Quick rule
As a reminder, the optional parameters are named slightly different from how you would make the call without the SDK docs, query parameter names have variables that make bad Ruby names like
page[cursor]
are transformed to page_cursor
.
Cursor based Pagination
All the endpoints that return list of results use cursor base pagination.
Obtain the cursor value from the call you want to get the next page for, then pass it under the page_cursor
optional parameter. The page cursor looks like WzE2NDA5OTUyMDAsICIzYzRjeXdGTndadyIsIHRydWVd
.
If you were using the api directly you would pass the cursor like:
https://a.klaviyo.com/api/profiles/?page[cursor]=WzE2NTcyMTM4NjQsICIzc042NjRyeHo0ciIsIHRydWVd
The same call in the sdk the call would look like this:
opts = {
page_cursor: 'WzE2NTcyMTM4NjQsICIzc042NjRyeHo0ciIsIHRydWVd',
}
response = KlaviyoAPI::Profiles.get_profiles(opts)
You get the cursor for the next page from response[:links][:next]
returns the entire url of the next call but the sdk will accept the entire link and use only the relevant cursor.
Here is an example of getting the second next and passing in the page cursor:
opts = {
page_cursor: response[:links][:next], # previous response
}
response = KlaviyoAPI::Profiles.get_profiles(opts)
There are more page cursors than just next, check the endpoint's docs or the response type but often there is first
, last
, next
and prev
.
Page Size
Some endpoint you can get a larger or smaller page size by using the page_size
parameter.
if you were hitting the api directly this would look like
https://a.klaviyo.com/api/profiles/?page[size]=20
In the SDK this looks like:
opts = {
page_size: 20,
}
response = KlaviyoAPI::Profiles.get_profiles(opts)
Additional Fields
Additional fields are used to populate part of the response that would be null otherwise.
For the getProfile
endpoint you can pass in a request to get the predictive analytics of the profile. Using the additional_fields
parameter often will change the rate limit of the endpoint so be sure to keep an eye on your usage.
The url would look like:
https://a.klaviyo.com/api/profiles/01GDDKASAP8TKDDA2GRZDSVP4H/?additional-fields[profile]=predictive_analytics
The SDK equivalent is:
profile_id = '01GDDKASAP8TKDDA2GRZDSVP4H'
opts = {
additional_fields_profile: ["predictive_analytics"]
}
response = KlaviyoAPI::Profiles.get_profile(profile_id, opts)
# If your profile has enough information for predictive analytis it will populate
pp(response[:data][:attributes][:predictive_analytics])
Filtering
Filter by passing the filter as a string as under the optional parameter filter
.
Read more about formatting your filter strings in our developer documentation
Here is an example of a filter string for results between two date times: less-than(updated,2023-04-26T00:00:00Z),greater-than(updated,2023-04-19T00:00:00Z)
Here is a code example filter for profiles with the matching emails:
https://a.klaviyo.com/api/profiles/?filter=any(email,["[email protected]","[email protected]"]
For the sdk:
opts = {
filter: 'any(email,["[email protected]","[email protected]"])'
}
response = KlaviyoAPI::Profiles.get_profiles(opts)
Sparse Fields
If you only want a specific subset of data from a specific query you can use sparse fields to request only the specific properties. The SDK expands the optional sparse fields into their own option, where you can pass a list of the desired items to include.
To get a list of event properties the URL your would use is:
https://a.klaviyo.com/api/events/?fields[event]=event_properties
In the SDK you would use
opts = {
fields_event: ["event_properties"]
}
response = KlaviyoAPI::Events.get_events(opts)
Sorting
Your can request the results of specific endpoints to be ordered by a given parameter. The direction of the sort can swapped by adding a -
in front of the sort key.
For example datetime
will be ascending while -datetime
will be descending.
If you are unsure about the available sort fields you can always check the documentation for the endpoint you are using. For a comprehensive list that links to the documentation for each function check the Endpoints section below.
Get events sorted by oldest to newest datetime.
https://a.klaviyo.com/api/events/?sort=-datetime
and via the sdk
opts = {
sort: '-datetime'
}
response = KlaviyoAPI::Events.get_events(opts)
Includes
How to add additional information to your API response via additional-fields and the includes
parameter.
This allows you to get information about two or more objects from a single api call.
Using the includes
parameter often changes the rate limit of the endpoint so be sure to take note.
Using the URl to get profile information and the information about the lists the profile is in:
https://a.klaviyo.com/api/profiles/01GDDKASAP8TKDDA2GRZDSVP4H/?include=lists
In the sdk:
profile_id = '01GDDKASAP8TKDDA2GRZDSVP4H'
opts = {
include: ["lists"]
}
response = KlaviyoAPI::Profiles.get_profile(profile_id,opts)
# Profile information is accessed the same way with
pp(response[:data])
# Lists related to the profile with be accessible via the included array
pp(response[:included])
Note about sparse fields and relationships: you can request only specific fields of the included object as well.
profile_id = '01GDDKASAP8TKDDA2GRZDSVP4H'
opts = {
fields_list: ["name"],
include: ["lists"]
}
response = KlaviyoAPI::Profiles.get_profile(profile_id,opts)
# Profile information is accessed the same way with
pp(response[:data])
# Lists related to the profile with be accessible via the included array
pp(response[:included])
Relationships
The Klaviyo Api has a series of endpoints to expose the relationships between your different Klaviyo Items. You can read more about relationships in our documentation.
Here are some use cases and their examples:
How to get the list memberships for a profile with the given profile ID.
Via the URL:
https://a.klaviyo.com/api/profiles/01GDDKASAP8TKDDA2GRZDSVP4H/relationships/lists/
and for the SDK:
profile_id = '01GDDKASAP8TKDDA2GRZDSVP4H'
response = KlaviyoAPI::Profiles.get_profile_relationships_lists(profile_id)
For another example:
Get all campaigns associated with the given tag_id
.
the URL:
https://a.klaviyo.com/api/tags/9c8db7a0-5ab5-4e3c-9a37-a3224fd14382/relationships/campaigns/
Through the SDK:
tag_id = '9c8db7a0-5ab5-4e3c-9a37-a3224fd14382'
response = KlaviyoAPI::Tags.get_tag_relationships_campaigns(tag_id)
Combining
You can use any combination of the features outlines above in conjunction with one another.
Get events associated with a specific metric, then return just the event properties sorted by oldest to newest datetime.
https://a.klaviyo.com/api/events/?fields[event]=event_properties&filter=equals(metric_id,"URDbLg")&sort=-datetime
or
opts = {
filter: 'equals(metric_id,"URDbLg")',
fields_event: ["event_properties"]
}
response = KlaviyoAPI::Events.get_events(opts)
Comprehensive list of Operations & Parameters
NOTE:
- Organization: Resource groups and operation_ids are listed in alphabetical order, first by Resource name, then by OpenAPI Summary. Operation summaries are those listed in the right side bar of the API Reference.
- For example values / data types, as well as whether parameters are required/optional, please reference the corresponding API Reference link.
- Some args are required for the API call to succeed, the API docs above are the source of truth regarding which params are required.
Accounts
Get Account
KlaviyoAPI::Accounts.get_account(id, opts)
Get Accounts
KlaviyoAPI::Accounts.get_accounts(opts)
Campaigns
Create Campaign
KlaviyoAPI::Campaigns.create_campaign(body)
Create Campaign Clone
KlaviyoAPI::Campaigns.create_campaign_clone(body)
Assign Campaign Message Template
KlaviyoAPI::Campaigns.(body)
Create Campaign Recipient Estimation Job
KlaviyoAPI::Campaigns.create_campaign_recipient_estimation_job(body)
Create Campaign Send Job
KlaviyoAPI::Campaigns.create_campaign_send_job(body)
Delete Campaign
KlaviyoAPI::Campaigns.delete_campaign(id)
Get Campaign
KlaviyoAPI::Campaigns.get_campaign(id, opts)
Get Campaign Campaign Messages
KlaviyoAPI::Campaigns.(id, opts)
Get Campaign Message
KlaviyoAPI::Campaigns.(id, opts)
Get Campaign Message Campaign
KlaviyoAPI::Campaigns.(id, opts)
Get Campaign Message Relationships Campaign
KlaviyoAPI::Campaigns.(id)
Get Campaign Message Relationships Template
KlaviyoAPI::Campaigns.(id)
Get Campaign Message Template
KlaviyoAPI::Campaigns.(id, opts)
Get Campaign Recipient Estimation
KlaviyoAPI::Campaigns.get_campaign_recipient_estimation(id, opts)
Get Campaign Recipient Estimation Job
KlaviyoAPI::Campaigns.get_campaign_recipient_estimation_job(id, opts)
Get Campaign Relationships Campaign Messages
KlaviyoAPI::Campaigns.(id)
Get Campaign Relationships Tags
KlaviyoAPI::Campaigns.(id)
Get Campaign Send Job
KlaviyoAPI::Campaigns.get_campaign_send_job(id, opts)
Get Campaign Tags
KlaviyoAPI::Campaigns.(id, opts)
Get Campaigns
KlaviyoAPI::Campaigns.get_campaigns(filter, opts)
Update Campaign
KlaviyoAPI::Campaigns.update_campaign(id, body)
Update Campaign Message
KlaviyoAPI::Campaigns.(id, body)
Update Campaign Send Job
KlaviyoAPI::Campaigns.update_campaign_send_job(id, body)
Catalogs
Create Back In Stock Subscription
KlaviyoAPI::Catalogs.create_back_in_stock_subscription(body)
Create Catalog Category
KlaviyoAPI::Catalogs.create_catalog_category(body)
Create Catalog Category Relationships Items
KlaviyoAPI::Catalogs.create_catalog_category_relationships_items(id, body)
Create Catalog Item
KlaviyoAPI::Catalogs.create_catalog_item(body)
Create Catalog Item Relationships Categories
KlaviyoAPI::Catalogs.create_catalog_item_relationships_categories(id, body)
Create Catalog Variant
KlaviyoAPI::Catalogs.create_catalog_variant(body)
Delete Catalog Category
KlaviyoAPI::Catalogs.delete_catalog_category(id)
Delete Catalog Category Relationships Items
KlaviyoAPI::Catalogs.delete_catalog_category_relationships_items(id, body)
Delete Catalog Item
KlaviyoAPI::Catalogs.delete_catalog_item(id)
Delete Catalog Item Relationships Categories
KlaviyoAPI::Catalogs.delete_catalog_item_relationships_categories(id, body)
Delete Catalog Variant
KlaviyoAPI::Catalogs.delete_catalog_variant(id)
Get Catalog Categories
KlaviyoAPI::Catalogs.get_catalog_categories(opts)
Get Catalog Category
KlaviyoAPI::Catalogs.get_catalog_category(id, opts)
Get Catalog Category Items
KlaviyoAPI::Catalogs.get_catalog_category_items(id, opts)
Get Catalog Category Relationships Items
KlaviyoAPI::Catalogs.get_catalog_category_relationships_items(id, opts)
Get Catalog Item
KlaviyoAPI::Catalogs.get_catalog_item(id, opts)
Get Catalog Item Categories
KlaviyoAPI::Catalogs.get_catalog_item_categories(id, opts)
Get Catalog Item Relationships Categories
KlaviyoAPI::Catalogs.get_catalog_item_relationships_categories(id, opts)
Get Catalog Item Variants
KlaviyoAPI::Catalogs.get_catalog_item_variants(id, opts)
Get Catalog Items
KlaviyoAPI::Catalogs.get_catalog_items(opts)
Get Catalog Variant
KlaviyoAPI::Catalogs.get_catalog_variant(id, opts)
Get Catalog Variants
KlaviyoAPI::Catalogs.get_catalog_variants(opts)
Get Create Categories Job
KlaviyoAPI::Catalogs.get_create_categories_job(job_id, opts)
Get Create Categories Jobs
KlaviyoAPI::Catalogs.get_create_categories_jobs(opts)
Get Create Items Job
KlaviyoAPI::Catalogs.get_create_items_job(job_id, opts)
Get Create Items Jobs
KlaviyoAPI::Catalogs.get_create_items_jobs(opts)
Get Create Variants Job
KlaviyoAPI::Catalogs.get_create_variants_job(job_id, opts)
Get Create Variants Jobs
KlaviyoAPI::Catalogs.get_create_variants_jobs(opts)
Get Delete Categories Job
KlaviyoAPI::Catalogs.get_delete_categories_job(job_id, opts)
Get Delete Categories Jobs
KlaviyoAPI::Catalogs.get_delete_categories_jobs(opts)
Get Delete Items Job
KlaviyoAPI::Catalogs.get_delete_items_job(job_id, opts)
Get Delete Items Jobs
KlaviyoAPI::Catalogs.get_delete_items_jobs(opts)
Get Delete Variants Job
KlaviyoAPI::Catalogs.get_delete_variants_job(job_id, opts)
Get Delete Variants Jobs
KlaviyoAPI::Catalogs.get_delete_variants_jobs(opts)
Get Update Categories Job
KlaviyoAPI::Catalogs.get_update_categories_job(job_id, opts)
Get Update Categories Jobs
KlaviyoAPI::Catalogs.get_update_categories_jobs(opts)
Get Update Items Job
KlaviyoAPI::Catalogs.get_update_items_job(job_id, opts)
Get Update Items Jobs
KlaviyoAPI::Catalogs.get_update_items_jobs(opts)
Get Update Variants Job
KlaviyoAPI::Catalogs.get_update_variants_job(job_id, opts)
Get Update Variants Jobs
KlaviyoAPI::Catalogs.get_update_variants_jobs(opts)
Spawn Create Categories Job
KlaviyoAPI::Catalogs.spawn_create_categories_job(body)
Spawn Create Items Job
KlaviyoAPI::Catalogs.spawn_create_items_job(body)
Spawn Create Variants Job
KlaviyoAPI::Catalogs.spawn_create_variants_job(body)
Spawn Delete Categories Job
KlaviyoAPI::Catalogs.spawn_delete_categories_job(body)
Spawn Delete Items Job
KlaviyoAPI::Catalogs.spawn_delete_items_job(body)
Spawn Delete Variants Job
KlaviyoAPI::Catalogs.spawn_delete_variants_job(body)
Spawn Update Categories Job
KlaviyoAPI::Catalogs.spawn_update_categories_job(body)
Spawn Update Items Job
KlaviyoAPI::Catalogs.spawn_update_items_job(body)
Spawn Update Variants Job
KlaviyoAPI::Catalogs.spawn_update_variants_job(body)
Update Catalog Category
KlaviyoAPI::Catalogs.update_catalog_category(id, body)
Update Catalog Category Relationships Items
KlaviyoAPI::Catalogs.update_catalog_category_relationships_items(id, body)
Update Catalog Item
KlaviyoAPI::Catalogs.update_catalog_item(id, body)
Update Catalog Item Relationships Categories
KlaviyoAPI::Catalogs.update_catalog_item_relationships_categories(id, body)
Update Catalog Variant
KlaviyoAPI::Catalogs.update_catalog_variant(id, body)
Data Privacy
Request Profile Deletion
KlaviyoAPI::DataPrivacy.request_profile_deletion(body)
Events
Create Event
KlaviyoAPI::Events.create_event(body)
Get Event
KlaviyoAPI::Events.get_event(id, opts)
Get Event Metric
KlaviyoAPI::Events.get_event_metric(id, opts)
Get Event Profile
KlaviyoAPI::Events.get_event_profile(id, opts)
Get Event Relationships Metric
KlaviyoAPI::Events.get_event_relationships_metric(id)
Get Event Relationships Profile
KlaviyoAPI::Events.get_event_relationships_profile(id)
Get Events
KlaviyoAPI::Events.get_events(opts)
Flows
Get Flow
KlaviyoAPI::Flows.get_flow(id, opts)
Get Flow Action
KlaviyoAPI::Flows.get_flow_action(id, opts)
Get Flow For Flow Action
KlaviyoAPI::Flows.get_flow_action_flow(id, opts)
Get Flow Action Messages
KlaviyoAPI::Flows.(id, opts)
Get Flow Action Relationships Flow
KlaviyoAPI::Flows.get_flow_action_relationships_flow(id)
Get Flow Action Relationships Messages
KlaviyoAPI::Flows.(id, opts)
Get Flow Flow Actions
KlaviyoAPI::Flows.get_flow_flow_actions(id, opts)
Get Flow Message
KlaviyoAPI::Flows.(id, opts)
Get Flow Action For Message
KlaviyoAPI::Flows.(id, opts)
Get Flow Message Relationships Action
KlaviyoAPI::Flows.(id)
Get Flow Message Relationships Template
KlaviyoAPI::Flows.(id)
Get Flow Message Template
KlaviyoAPI::Flows.(id, opts)
Get Flow Relationships Flow Actions
KlaviyoAPI::Flows.get_flow_relationships_flow_actions(id, opts)
Get Flow Relationships Tags
KlaviyoAPI::Flows.(id)
Get Flow Tags
KlaviyoAPI::Flows.(id, opts)
Get Flows
KlaviyoAPI::Flows.get_flows(opts)
Update Flow Status
KlaviyoAPI::Flows.update_flow(id, body)
Lists
Create List
KlaviyoAPI::Lists.create_list(body)
Add Profile To List
KlaviyoAPI::Lists.create_list_relationships(id, body)
Delete List
KlaviyoAPI::Lists.delete_list(id)
Remove Profile From List
KlaviyoAPI::Lists.delete_list_relationships(id, body)
Get List
KlaviyoAPI::Lists.get_list(id, opts)
Get List Profiles
KlaviyoAPI::Lists.get_list_profiles(id, opts)
Get List Relationships Profiles
KlaviyoAPI::Lists.get_list_relationships_profiles(id, opts)
Get List Relationships Tags
KlaviyoAPI::Lists.(id)
Get List Tags
KlaviyoAPI::Lists.(id, opts)
Get Lists
KlaviyoAPI::Lists.get_lists(opts)
Update List
KlaviyoAPI::Lists.update_list(id, body)
Metrics
Get Metric
KlaviyoAPI::Metrics.get_metric(id, opts)
Get Metrics
KlaviyoAPI::Metrics.get_metrics(opts)
Query Metric Aggregates
KlaviyoAPI::Metrics.query_metric_aggregates(body)
Profiles
Create Profile
KlaviyoAPI::Profiles.create_profile(body)
Create or Update Push Token
KlaviyoAPI::Profiles.create_push_token(body)
Get Profile
KlaviyoAPI::Profiles.get_profile(id, opts)
Get Profile Lists
KlaviyoAPI::Profiles.get_profile_lists(id, opts)
Get Profile Relationships Lists
KlaviyoAPI::Profiles.get_profile_relationships_lists(id)
Get Profile Relationships Segments
KlaviyoAPI::Profiles.get_profile_relationships_segments(id)
Get Profile Segments
KlaviyoAPI::Profiles.get_profile_segments(id, opts)
Get Profiles
KlaviyoAPI::Profiles.get_profiles(opts)
Subscribe Profiles
KlaviyoAPI::Profiles.subscribe_profiles(body)
Suppress Profiles
KlaviyoAPI::Profiles.suppress_profiles(body)
Unsubscribe Profiles
KlaviyoAPI::Profiles.unsubscribe_profiles(body)
Unsuppress Profiles
KlaviyoAPI::Profiles.unsuppress_profiles(body)
Update Profile
KlaviyoAPI::Profiles.update_profile(id, body)
Segments
Get Segment
KlaviyoAPI::Segments.get_segment(id, opts)
Get Segment Profiles
KlaviyoAPI::Segments.get_segment_profiles(id, opts)
Get Segment Relationships Profiles
KlaviyoAPI::Segments.get_segment_relationships_profiles(id, opts)
Get Segment Relationships Tags
KlaviyoAPI::Segments.(id)
Get Segment Tags
KlaviyoAPI::Segments.(id, opts)
Get Segments
KlaviyoAPI::Segments.get_segments(opts)
Update Segment
KlaviyoAPI::Segments.update_segment(id, body)
Tags
Create Tag
KlaviyoAPI::Tags.create_tag(body)
Create Tag Group
KlaviyoAPI::Tags.create_tag_group(body)
Create Tag Relationships Campaigns
KlaviyoAPI::Tags.create_tag_relationships_campaigns(id, body)
Create Tag Relationships Flows
KlaviyoAPI::Tags.create_tag_relationships_flows(id, body)
Create Tag Relationships Lists
KlaviyoAPI::Tags.create_tag_relationships_lists(id, body)
Create Tag Relationships Segments
KlaviyoAPI::Tags.create_tag_relationships_segments(id, body)
Delete Tag
KlaviyoAPI::Tags.delete_tag(id)
Delete Tag Group
KlaviyoAPI::Tags.delete_tag_group(id)
Delete Tag Relationships Campaigns
KlaviyoAPI::Tags.delete_tag_relationships_campaigns(id, body)
Delete Tag Relationships Flows
KlaviyoAPI::Tags.delete_tag_relationships_flows(id, body)
Delete Tag Relationships Lists
KlaviyoAPI::Tags.delete_tag_relationships_lists(id, body)
Delete Tag Relationships Segments
KlaviyoAPI::Tags.delete_tag_relationships_segments(id, body)
Get Tag
KlaviyoAPI::Tags.get_tag(id, opts)
Get Tag Group
KlaviyoAPI::Tags.get_tag_group(id, opts)
Get Tag Group Relationships Tags
KlaviyoAPI::Tags.(id)
Get Tag Group Tags
KlaviyoAPI::Tags.(id, opts)
Get Tag Groups
KlaviyoAPI::Tags.get_tag_groups(opts)
Get Tag Relationships Campaigns
KlaviyoAPI::Tags.get_tag_relationships_campaigns(id)
Get Tag Relationships Flows
KlaviyoAPI::Tags.get_tag_relationships_flows(id)
Get Tag Relationships Lists
KlaviyoAPI::Tags.get_tag_relationships_lists(id)
Get Tag Relationships Segments
KlaviyoAPI::Tags.get_tag_relationships_segments(id)
Get Tag Relationships Tag Group
KlaviyoAPI::Tags.get_tag_relationships_tag_group(id)
Get Tag Tag Group
KlaviyoAPI::Tags.get_tag_tag_group(id, opts)
Get Tags
KlaviyoAPI::Tags.(opts)
Update Tag
KlaviyoAPI::Tags.update_tag(id, body)
Update Tag Group
KlaviyoAPI::Tags.update_tag_group(id, body)
Templates
Create Template
KlaviyoAPI::Templates.create_template(body)
Create Template Clone
KlaviyoAPI::Templates.create_template_clone(body)
Create Template Render
KlaviyoAPI::Templates.create_template_render(body)
Delete Template
KlaviyoAPI::Templates.delete_template(id)
Get Template
KlaviyoAPI::Templates.get_template(id, opts)
Get Templates
KlaviyoAPI::Templates.get_templates(opts)
Update Template
KlaviyoAPI::Templates.update_template(id, body)
Appendix
Per Request API key
response = KlaviyoAPI::Catalogs.get_catalog_items({
header_params: {
'Authorization': 'Klaviyo-API-Key your-api-key',
},
debug_auth_names: []
})