Download Klaviyo Email API
Author: f | 2025-04-24
To that end, we are considering using the Klaviyo API to send email to particular individuals on demand. Regarding the Klaviyo API functionalities connected to sending emails
Sending email from the Klaviyo API
A purchase)Additional resourcesAbout cookies in KlaviyoGetting started with Track and Identify APIs Identify API reference" data-testid="RDMD">📘InfoThis article assumes you’ve set up your site according to our Getting started with Track and Identify APIs article.We have two versions of the Track API: a front-end and a back-end version. The structures are similar, but not exactly the same, so you may opt for one over the other depending on whether you want to send an event or an event’s data source.The most important difference in functionality is that the front-end Track API call will only track a person’s actions if they are already cookied; it won’t work if they’re using an anonymous browser. The back-end version of this request uses the customer_properties dictionary to designate the profile to which this event should be tracked, using one of the following:Highly recommended: an email address ($email), or if you have SMS-only contacts, a phone number ($phone_number)A unique identifier, such as their user ID ($id)📘InfoWe highly recommend you consistently identify all individuals using only their email address ($email) or phone number ($phone_number), and do not pass $id values. For more information, see Getting started with Track and Identify APIs.The front-end version of the Track API uses the _learnq object to track customers. This object is a part of Klaviyo's main onsite tracking snippet, known as "klaviyo.js", which is automatically added during many of our integration setups. To check if the snippet is already a part of your integration, see our integration documentation.📘InfoWhen you add Klaviyo's onsite tracking snippet(s) to your site, we are only able to track the browsing activity of "known browsers" (i.e. browsers that have visited and engaged at least once before). Klaviyo will not track anonymous browsers. For more information, see our Guide to Klaviyo onsite tracking.The Track method allows you to record events and actions people take on your website. This method accepts the following inputs:An event name as a string (required)A dictionary or hash of properties associated with the event (optional)To make an API call, Klaviyo uses a special syntax that allows your API calls to work even when our script hasn't loaded on the page yet. You'll create an array where the first value is the name of the method you want to call and any subsequent values are arguments to pass to that method. This method understands different data types, so you can use numbers, booleans, dates, and lists in the request, and Klaviyo will create intelligent charts and graphs based on the data you send.For example, you can use this front-end API to track when someone completes an order, and include information on the purchase price and items in the order. If your site supports customer profiles, 🚧These endpoints are in beta and are subject to changeA beta revision header (2024-07-15.pre) is required to use these beta APIs. Klaviyo APIs in beta are not intended for use in production. See our versioning and deprecation policy for more information.Check out our general API overview to make sure you’re ready to get started with specific endpoints.🚧Note that Klaviyo Reviews is billed separately from Klaviyo email and SMS and is not included with your Klaviyo email or SMS plan.Our Reviews API allows you to query your product reviews so that you can ensure that your product experience puts customers first. For example, you may want to write a script that queries all negative reviews (1 or 2 stars) and checks if they have been addressed thoughtfully, i.e., a public reply has been sent for each negative review. Or, you may want to source quotes from 5-star product reviews for use in future email marketing. Use the Reviews API to identify areas for product improvements and provide a high-quality customer experience.Here are some example use cases supported by the Reviews API:Fetch all positive and/or negative reviews for a specific product given its catalog ID (item.id). See Querying reviews.Get all "verified" reviews, i.e., ones that have been submitted by authors who have a verified purchase. Fetch a specific review by review ID.Query negative reviews based on a rating threshold (1 or 2 stars) and check whether or not a public reply exists for each review.Query reviews based on specific content, e.g., reviews that include “arrived quickly.”A review has the following structure:id The ID of the review.attributesemail The email address of the review’s author.status The status of the review ("published","unpublished","featured","pending",or "rejected").verified Whether or not the review is verified, i.e., the review author is a true purchaser of the product .review_type The type of review, whether it includes written content with a rating ("review"), an answer to a question about the product ("question"), or a rating without written content ("rating"). created The timestamp of when the metric was created.updated The timestamp of when the metric was last updated. images Images of the product includedSending transactional emails through API, or - Klaviyo
📘InfoThis article assumes you’ve set up your site according to our Getting started with Track and Identify APIs article.We have two versions of the Track API: a front-end and a back-end version. The structures are similar, but not exactly the same, so you may opt for one over the other depending on whether you want to send an event or an event’s data source.The most important difference in functionality is that the front-end Track API call will only track a person’s actions if they are already cookied; it won’t work if they’re using an anonymous browser. The back-end version of this request uses the customer_properties dictionary to designate the profile to which this event should be tracked, using one of the following:Highly recommended: an email address ($email), or if you have SMS-only contacts, a phone number ($phone_number)A unique identifier, such as their user ID ($id)📘InfoWe highly recommend you consistently identify all individuals using only their email address ($email) or phone number ($phone_number), and do not pass $id values. For more information, see Getting started with Track and Identify APIs.Front-end tracking events (JavaScript)The front-end version of the Track API uses the _learnq object to track customers. This object is a part of Klaviyo's main onsite tracking snippet, known as "klaviyo.js", which is automatically added during many of our integration setups. To check if the snippet is already a part of your integration, see our integration documentation.📘InfoWhen you add Klaviyo's onsite tracking snippet(s) to your site, we are only able to track the browsing activity of "known browsers" (i.e. browsers that have visited and engaged at least once before). Klaviyo will not track anonymous browsers. For more information, see our Guide to Klaviyo onsite tracking.The Track method allows you to record events and actions people take on your website. This method accepts the following inputs:An event name as a string (required)A dictionary or hash of properties associated with the event (optional)To make an API call, Klaviyo uses a special syntax that allows your API calls to work even when our script hasn't loaded on the page yet. You'll create an array where the first value is the name of the method you want to call and any subsequent values are arguments to pass to that method. This method understands different data types, so you can use numbers, booleans, dates, and lists in the request, and Klaviyo will create intelligent charts and graphs based on the data you send.For example, you can use this front-end API to track when someone completes an order, and include information on the purchase price and items in the order. If your site supports customer profiles, you could also include information about when someone fills out their profile.HTML<script>var. To that end, we are considering using the Klaviyo API to send email to particular individuals on demand. Regarding the Klaviyo API functionalities connected to sending emailsHow to Create Klaviyo Emails - The Ultimate Klaviyo Email
We are in the process of transitioning over to Klaviyo, and to migrate our transactional emails we want to make an API call that sends an already formatted chunk HTML with all of the order information in it with the API call and then use that chunk of HTML in the email.When I’ve tried testing this out, it just prints all the HTML and treats it as text. I’ve been looking for a solution or a workaround. This is a temporary setup for us, later on in the year we will plan on changing how it’s set up to adhere to best practices for Klaviyo but are in the process of changing our e-commerce store right now so wanted to do this to save time and get transactional emails migrated to Klaviyo.It seems like it should be a pretty straightforward and simple thing to do, something you should be able to do in Klaviyo, but I’m having trouble finding examples of this being done successfully. Are there any official or unofficial solutions to just inserting HTML into an email that’s coming from an event property in an API call? Hi @kenny.porterfield, welcome to the community!Depending on how you’re injecting the HTML into an existing Template programmatically, you may be able to use a variable filter safe to let the interpretor know that its HTML safe content.For example, let’s assume your variable is “content” - so you might want to try this:{{ content | safe }}There’s a related discussion here that isn’t exactly what you’re trying to do, but somewhat related that might be helpful.Not sure if @Walid can clarify more here, but hope this helps and let us know if it works. Hi @retention, this seems to be the answer I was looking for, now the HTML is rendering. Thanks! Marketing, some wineries have asked for more advanced automation and segmentation abilities. We are happy to announce that Klaviyo – the leading email automation platform – is now available to be integrated with WineDirect stores. Leverage Klaviyo’s advanced email and SMS marketing automation and best-in-class segmentation tools to generate more sales on auto-pilot.WineDirects mission as "The Winery's Champion" focuses on offering the best in class tools to wineries of all sizes. This includes looking outside WineDirect and ensuring our wineries have the ability to use the tools they need and reach their goals. We are excited to partner with our friends at Best Worlds – a Certified Klaviyo Systems Integrator and Master Partner – for them to build out this additional hosted service to support WineDirect customers. This integration is a paid feature created and hosted by BestWorlds, including the $250 cost to have Kalviyo and the included set-up fee.Learn more about the WineDirect x Klaviyo integration here! May 31, 2022 | Brandon Harvie Update: Web Service Update UPDATE - June 9th, 2022: We originally planned to deploy a change to our web service APIs on June 13th. Since the email was sent out, some of our partners have discovered issues we did not foresee, and we are postponing the web service deployment. Our team is working diligently towards a fix.If you have already updated your APIs, we recommend reverting to the existing setup of web services until we have more information.If you have questions about the deployment delay, please feel free to contact edwin.lo@winedirect.com for assistance. We appreciate your patience.As part of our commitment to continuous improvement of the WineDirect platform, we are implementing some changes to our web services to ensure API calls continue to flow automatically. Any integrations that use the below endpoints will need to beSend Personal Email with latest API (v ) - Klaviyo
Information on allowed fields and query parameters.ParameterDescriptionQuery exampleincludeInclude related resources in the response, e.g., event data. Learn about the include query parameter.GET /api/reviews?include=eventsfieldsRequest for only specified event data, e.g., review content. You can also request for only specified related data. Learn more about sparse fieldsets .GET /api/reviews?fields[review]=contentGET /api/reviews?include=events&fields[event]=timestampfilterRetrieve a subset of reviews, e.g., reviews for a specific product given its catalog ID (item_id ). Learn about the filter query parameter.GET /api/reviews?filter=equals(item_id,"integration_type:::$default:::catalog_item_id")sortSort reviews, e.g., by created datetime (oldest to newest) or by rating (highest to lowest). Learn about the sort query parameter.GET /api/reviews?sort=createdGET /api/reviews?sort=-rating📘The catalog ID is a composite ID, e.g., "$shopify:::$default:::8020637942075". For custom integrations, use $custom for integration_type in the example format shown in the filter` example above.These private-key APIs are primarily intended for data analysis and export purposes. You cannot use them to directly power an onsite or in-app reviews widget. Never use a Klaviyo private key on your website or app, as it may be intercepted and used to request sensitive data from your account.Getting started with Klaviyo ReviewsUse advanced CSS to style Klaviyo Reviews widgetsKlaviyo Reviews CSS class referenceCollect email and SMS consent via API - Klaviyo
Last updated on December 7, 2022 @ 2:39 am --> If you’re a marketer, chances are you’ve heard of Canva. Canva is a user-friendly graphic design tool that helps you create beautiful visuals for your marketing campaigns. You can create custom designs from scratch or use one of their many templates to save time. Canva is a great tool for creating social media images, email headers, ads, and more. So, does Canva work with Klaviyo? The short answer is yes! Canva integrates with Klaviyo to make it easy to design beautiful visuals for your Klaviyo campaigns. With the Klaviyo + Canva integration, you can: Create campaign-specific visuals in CanvaEasily upload your designs into KlaviyoTrack the performance of your visuals in KlaviyoHow to Use Canva with Klaviyo PRO TIP: Canva and Klaviyo are not compatible. Do not use Canva with Klaviyo.Using Canva with Klaviyo is easy! Just follow these steps: Create a free account with Canva.Login or sign up to your account. Click on the “+” button in the top left corner of the screen and select “New Design”.Once you’ve selected a template, you can start customizing it to fit your brand. Add your own images, text, and branding elements.When you’re happy with your design, click on the “Share” button in the top right corner of the screen.In the “Share” menu, select “Get Link”. Copy the link provided.In another browser tab, log in (or sign up) to your Klaviyo account. In your account, navigate to the campaign builder for the campaign you want to add your Canva image to. In our example, we will be using an email campaign, but this will work for any campaign type.In the campaign builder, drag and drop an “Image” block into your campaign layout.When prompted, paste the link to your Canva image and click “Save”. Your image will be added to your campaign! You can now edit it like any other image block in Klaviyo.That’s it! Now when you send your campaign, recipients will see your beautiful Canva image.Now that you know how easy it is to use Canva with Klaviyo, why not give it a try? With Klaviyo’s powerful tracking and reporting features, you can see how well your visuals are performing and make changes accordingly. Happy designing!. To that end, we are considering using the Klaviyo API to send email to particular individuals on demand. Regarding the Klaviyo API functionalities connected to sending emails To that end, we are considering using the Klaviyo API to send email to particular individuals on demand. Regarding the Klaviyo API functionalities connected to sending emailsSet up API-based transactional emails - Klaviyo
Discount value and control the probability of that offer being won by the customer. The system generates unique Coupons automatically every time. There is no need to generate and share the same coupon with multiple users.Email Integrator: Mail Chimp and Klaviyo Interactive Magento spin and win (email subscription) pop up offers Mail Chimp Integration and Klaviyo integration. The email Ids entered in the email subscription pop up will be synced with store owner's Mail Chimp and Klaviyo accounts The email Ids synced can be later used for personalized promotions or scheduling Mail Campaigns.Design the Coupon Email to be sent Magento admin can show the coupon right there on the screen after the customer spins the wheel or it will be sent via email or admin can choose both the options. Readymade Email templates: 5 inbuilt Email Templates to send out the email with the discount code which can be further customized. Magento Exit intent popup addon allows you to test the email before you send it to the customers.Statistics View the performance of the Spin & Win Pop up by comparing the total coupons generated vs total coupons used. Filter and View the Statistics between defined dates. View the statistics by Country, by Device (Mobile or Desktop). View the details of customers, email IDs registered and corresponding Coupon Code generated.Additional Benefits: Ability to use custom CSS and Javascript. The admin can make any custom changes from the admin panel of this Newsletter popup extension. The pop-up invitations can be configured.Comments
A purchase)Additional resourcesAbout cookies in KlaviyoGetting started with Track and Identify APIs Identify API reference" data-testid="RDMD">📘InfoThis article assumes you’ve set up your site according to our Getting started with Track and Identify APIs article.We have two versions of the Track API: a front-end and a back-end version. The structures are similar, but not exactly the same, so you may opt for one over the other depending on whether you want to send an event or an event’s data source.The most important difference in functionality is that the front-end Track API call will only track a person’s actions if they are already cookied; it won’t work if they’re using an anonymous browser. The back-end version of this request uses the customer_properties dictionary to designate the profile to which this event should be tracked, using one of the following:Highly recommended: an email address ($email), or if you have SMS-only contacts, a phone number ($phone_number)A unique identifier, such as their user ID ($id)📘InfoWe highly recommend you consistently identify all individuals using only their email address ($email) or phone number ($phone_number), and do not pass $id values. For more information, see Getting started with Track and Identify APIs.The front-end version of the Track API uses the _learnq object to track customers. This object is a part of Klaviyo's main onsite tracking snippet, known as "klaviyo.js", which is automatically added during many of our integration setups. To check if the snippet is already a part of your integration, see our integration documentation.📘InfoWhen you add Klaviyo's onsite tracking snippet(s) to your site, we are only able to track the browsing activity of "known browsers" (i.e. browsers that have visited and engaged at least once before). Klaviyo will not track anonymous browsers. For more information, see our Guide to Klaviyo onsite tracking.The Track method allows you to record events and actions people take on your website. This method accepts the following inputs:An event name as a string (required)A dictionary or hash of properties associated with the event (optional)To make an API call, Klaviyo uses a special syntax that allows your API calls to work even when our script hasn't loaded on the page yet. You'll create an array where the first value is the name of the method you want to call and any subsequent values are arguments to pass to that method. This method understands different data types, so you can use numbers, booleans, dates, and lists in the request, and Klaviyo will create intelligent charts and graphs based on the data you send.For example, you can use this front-end API to track when someone completes an order, and include information on the purchase price and items in the order. If your site supports customer profiles,
2025-04-19🚧These endpoints are in beta and are subject to changeA beta revision header (2024-07-15.pre) is required to use these beta APIs. Klaviyo APIs in beta are not intended for use in production. See our versioning and deprecation policy for more information.Check out our general API overview to make sure you’re ready to get started with specific endpoints.🚧Note that Klaviyo Reviews is billed separately from Klaviyo email and SMS and is not included with your Klaviyo email or SMS plan.Our Reviews API allows you to query your product reviews so that you can ensure that your product experience puts customers first. For example, you may want to write a script that queries all negative reviews (1 or 2 stars) and checks if they have been addressed thoughtfully, i.e., a public reply has been sent for each negative review. Or, you may want to source quotes from 5-star product reviews for use in future email marketing. Use the Reviews API to identify areas for product improvements and provide a high-quality customer experience.Here are some example use cases supported by the Reviews API:Fetch all positive and/or negative reviews for a specific product given its catalog ID (item.id). See Querying reviews.Get all "verified" reviews, i.e., ones that have been submitted by authors who have a verified purchase. Fetch a specific review by review ID.Query negative reviews based on a rating threshold (1 or 2 stars) and check whether or not a public reply exists for each review.Query reviews based on specific content, e.g., reviews that include “arrived quickly.”A review has the following structure:id The ID of the review.attributesemail The email address of the review’s author.status The status of the review ("published","unpublished","featured","pending",or "rejected").verified Whether or not the review is verified, i.e., the review author is a true purchaser of the product .review_type The type of review, whether it includes written content with a rating ("review"), an answer to a question about the product ("question"), or a rating without written content ("rating"). created The timestamp of when the metric was created.updated The timestamp of when the metric was last updated. images Images of the product included
2025-04-11📘InfoThis article assumes you’ve set up your site according to our Getting started with Track and Identify APIs article.We have two versions of the Track API: a front-end and a back-end version. The structures are similar, but not exactly the same, so you may opt for one over the other depending on whether you want to send an event or an event’s data source.The most important difference in functionality is that the front-end Track API call will only track a person’s actions if they are already cookied; it won’t work if they’re using an anonymous browser. The back-end version of this request uses the customer_properties dictionary to designate the profile to which this event should be tracked, using one of the following:Highly recommended: an email address ($email), or if you have SMS-only contacts, a phone number ($phone_number)A unique identifier, such as their user ID ($id)📘InfoWe highly recommend you consistently identify all individuals using only their email address ($email) or phone number ($phone_number), and do not pass $id values. For more information, see Getting started with Track and Identify APIs.Front-end tracking events (JavaScript)The front-end version of the Track API uses the _learnq object to track customers. This object is a part of Klaviyo's main onsite tracking snippet, known as "klaviyo.js", which is automatically added during many of our integration setups. To check if the snippet is already a part of your integration, see our integration documentation.📘InfoWhen you add Klaviyo's onsite tracking snippet(s) to your site, we are only able to track the browsing activity of "known browsers" (i.e. browsers that have visited and engaged at least once before). Klaviyo will not track anonymous browsers. For more information, see our Guide to Klaviyo onsite tracking.The Track method allows you to record events and actions people take on your website. This method accepts the following inputs:An event name as a string (required)A dictionary or hash of properties associated with the event (optional)To make an API call, Klaviyo uses a special syntax that allows your API calls to work even when our script hasn't loaded on the page yet. You'll create an array where the first value is the name of the method you want to call and any subsequent values are arguments to pass to that method. This method understands different data types, so you can use numbers, booleans, dates, and lists in the request, and Klaviyo will create intelligent charts and graphs based on the data you send.For example, you can use this front-end API to track when someone completes an order, and include information on the purchase price and items in the order. If your site supports customer profiles, you could also include information about when someone fills out their profile.HTML<script>var
2025-04-03We are in the process of transitioning over to Klaviyo, and to migrate our transactional emails we want to make an API call that sends an already formatted chunk HTML with all of the order information in it with the API call and then use that chunk of HTML in the email.When I’ve tried testing this out, it just prints all the HTML and treats it as text. I’ve been looking for a solution or a workaround. This is a temporary setup for us, later on in the year we will plan on changing how it’s set up to adhere to best practices for Klaviyo but are in the process of changing our e-commerce store right now so wanted to do this to save time and get transactional emails migrated to Klaviyo.It seems like it should be a pretty straightforward and simple thing to do, something you should be able to do in Klaviyo, but I’m having trouble finding examples of this being done successfully. Are there any official or unofficial solutions to just inserting HTML into an email that’s coming from an event property in an API call? Hi @kenny.porterfield, welcome to the community!Depending on how you’re injecting the HTML into an existing Template programmatically, you may be able to use a variable filter safe to let the interpretor know that its HTML safe content.For example, let’s assume your variable is “content” - so you might want to try this:{{ content | safe }}There’s a related discussion here that isn’t exactly what you’re trying to do, but somewhat related that might be helpful.Not sure if @Walid can clarify more here, but hope this helps and let us know if it works. Hi @retention, this seems to be the answer I was looking for, now the HTML is rendering. Thanks!
2025-04-08Marketing, some wineries have asked for more advanced automation and segmentation abilities. We are happy to announce that Klaviyo – the leading email automation platform – is now available to be integrated with WineDirect stores. Leverage Klaviyo’s advanced email and SMS marketing automation and best-in-class segmentation tools to generate more sales on auto-pilot.WineDirects mission as "The Winery's Champion" focuses on offering the best in class tools to wineries of all sizes. This includes looking outside WineDirect and ensuring our wineries have the ability to use the tools they need and reach their goals. We are excited to partner with our friends at Best Worlds – a Certified Klaviyo Systems Integrator and Master Partner – for them to build out this additional hosted service to support WineDirect customers. This integration is a paid feature created and hosted by BestWorlds, including the $250 cost to have Kalviyo and the included set-up fee.Learn more about the WineDirect x Klaviyo integration here! May 31, 2022 | Brandon Harvie Update: Web Service Update UPDATE - June 9th, 2022: We originally planned to deploy a change to our web service APIs on June 13th. Since the email was sent out, some of our partners have discovered issues we did not foresee, and we are postponing the web service deployment. Our team is working diligently towards a fix.If you have already updated your APIs, we recommend reverting to the existing setup of web services until we have more information.If you have questions about the deployment delay, please feel free to contact edwin.lo@winedirect.com for assistance. We appreciate your patience.As part of our commitment to continuous improvement of the WineDirect platform, we are implementing some changes to our web services to ensure API calls continue to flow automatically. Any integrations that use the below endpoints will need to be
2025-04-18Information on allowed fields and query parameters.ParameterDescriptionQuery exampleincludeInclude related resources in the response, e.g., event data. Learn about the include query parameter.GET /api/reviews?include=eventsfieldsRequest for only specified event data, e.g., review content. You can also request for only specified related data. Learn more about sparse fieldsets .GET /api/reviews?fields[review]=contentGET /api/reviews?include=events&fields[event]=timestampfilterRetrieve a subset of reviews, e.g., reviews for a specific product given its catalog ID (item_id ). Learn about the filter query parameter.GET /api/reviews?filter=equals(item_id,"integration_type:::$default:::catalog_item_id")sortSort reviews, e.g., by created datetime (oldest to newest) or by rating (highest to lowest). Learn about the sort query parameter.GET /api/reviews?sort=createdGET /api/reviews?sort=-rating📘The catalog ID is a composite ID, e.g., "$shopify:::$default:::8020637942075". For custom integrations, use $custom for integration_type in the example format shown in the filter` example above.These private-key APIs are primarily intended for data analysis and export purposes. You cannot use them to directly power an onsite or in-app reviews widget. Never use a Klaviyo private key on your website or app, as it may be intercepted and used to request sensitive data from your account.Getting started with Klaviyo ReviewsUse advanced CSS to style Klaviyo Reviews widgetsKlaviyo Reviews CSS class reference
2025-04-24