HTML Diff
17 added 16 removed
Original 2026-01-01
Modified 2026-03-10
1 <p><em>Solution Recipes are tutorials to achieve specific objectives in Klaviyo. They can also help you master Klaviyo, learn new third-party technologies, and come up with creative ideas. They are written mainly for developers &amp; technically-advanced users.</em></p>
1 <p><em>Solution Recipes are tutorials to achieve specific objectives in Klaviyo. They can also help you master Klaviyo, learn new third-party technologies, and come up with creative ideas. They are written mainly for developers &amp; technically-advanced users.</em></p>
2 - <p><strong><em>Note:</em></strong><em>We do our best to make sure any code and API references are accurate and current when this is published, but you might need to update code and it’s always a best practice to leverage our</em><a><em>latest API versions</em></a><em>. If you have questions, feel free to hop over to our</em><a><em>Developer Community</em></a><em>.</em></p>
2 + <p><em><strong>Note:</strong>We do our best to make sure any code and API references are accurate and current when this is published, but you might need to update code and it’s always a best practice to leverage our<a>latest API versions</a>. If you have questions, feel free to hop over to our<a>Developer Community</a>.</em></p>
3 <p>What you’ll learn</p>
3 <p>What you’ll learn</p>
4 <p>How to use webhooks to automatically suppress certain Klaviyo profiles using a segment-triggered flow and Klaviyo’s APIs.</p>
4 <p>How to use webhooks to automatically suppress certain Klaviyo profiles using a segment-triggered flow and Klaviyo’s APIs.</p>
5 <p>Why it matters</p>
5 <p>Why it matters</p>
6 <p>Some organizations sync profiles into Klaviyo that do not have marketing consent, or are otherwise not contactable and should be suppressed. For example, merchants that sell on third-party marketplaces like eBay, Walmart, or Amazon may push order data into Klaviyo, but with obfuscated email addresses that should be excluded. By creating a segment with all qualifying profiles, this type of suppression can be automated.</p>
6 <p>Some organizations sync profiles into Klaviyo that do not have marketing consent, or are otherwise not contactable and should be suppressed. For example, merchants that sell on third-party marketplaces like eBay, Walmart, or Amazon may push order data into Klaviyo, but with obfuscated email addresses that should be excluded. By creating a segment with all qualifying profiles, this type of suppression can be automated.</p>
7 <p>Level of sophistication</p>
7 <p>Level of sophistication</p>
8 <p>Moderate</p>
8 <p>Moderate</p>
9 <h2>Introduction</h2>
9 <h2>Introduction</h2>
10 - <p>Klaviyo flows has a <a>webhook flow action</a> which allow you to send customizable and dynamic HTTP POST requests with a JSON payload to a destination of your choosing within a Klaviyo flow. The most commonly discussed use cases for webhook actions involve sending data to third-party APIs or also to Klaviyo’s own APIs.</p>
10 + <p>Klaviyo flows has a<a>webhook flow action</a>which allow you to send customizable and dynamic HTTP POST requests with a JSON payload to a destination of your choosing within a Klaviyo flow. The most commonly discussed use cases for webhook actions involve sending data to third-party APIs or also to Klaviyo’s own APIs.</p>
11 <p>In this example we will use a webhook action to send a request to Klaviyo’s own APIs, however you can also build your own API endpoint too.</p>
11 <p>In this example we will use a webhook action to send a request to Klaviyo’s own APIs, however you can also build your own API endpoint too.</p>
12 <h2>Challenge</h2>
12 <h2>Challenge</h2>
13 <p>Acme Corp is a (fictional) omni-channel clothing retailer that sells direct to consumer through an online store and various online marketplaces. They have connected an ordering system to Klaviyo, meaning all their order events are successfully syncing into Klaviyo and a Klaviyo profile is being generated for every customer.</p>
13 <p>Acme Corp is a (fictional) omni-channel clothing retailer that sells direct to consumer through an online store and various online marketplaces. They have connected an ordering system to Klaviyo, meaning all their order events are successfully syncing into Klaviyo and a Klaviyo profile is being generated for every customer.</p>
14 <p>It’s working great, except for one thing: this merchant sells through various marketplaces like eBay, Walmart, and Amazon and all order records originating in these marketplaces contain email addresses that are deliberately obfuscated.</p>
14 <p>It’s working great, except for one thing: this merchant sells through various marketplaces like eBay, Walmart, and Amazon and all order records originating in these marketplaces contain email addresses that are deliberately obfuscated.</p>
15 <p><a>As eBay describes it</a>:</p>
15 <p><a>As eBay describes it</a>:</p>
16 - <blockquote>In the majority of cases, we don’t share buyers’ personal email addresses. We replace email addresses with aliases for buyers and sellers to hide personal contact information. When you communicate, your email appears like 63ae59ac280fe0fa69@members.ebay.com and is sent through our secure platform.</blockquote>Ebay<p>This can create some noisy profile data in the Klaviyo account - e.g. because an obfuscated email alias by design cant be matched up with the customers true email. Additionally, these marketplaces have policies that restrict the types of communications that are permitted, meaning it may not be appropriate to communicate with these email aliases. So, Acme Corp wants to just suppress these profiles from their Klaviyo account.</p>
16 + <blockquote>In the majority of cases, we don’t share buyers’ personal email addresses. We replace email addresses with aliases for buyers and sellers to hide personal contact information. When you communicate, your email appears like 63ae59ac280fe0fa69@members.ebay.com and is sent through our secure platform.</blockquote><p>Ebay</p>
 
17 + <p>This can create some noisy profile data in the Klaviyo account - e.g. because an obfuscated email alias by design can’t be matched up with the customer’s true email. Additionally, these marketplaces have policies that restrict the types of communications that are permitted, meaning it may not be appropriate to communicate with these email aliases. So, Acme Corp wants to just suppress these profiles from their Klaviyo account.</p>
17 <p>There are a couple potential ways to achieve this:</p>
18 <p>There are a couple potential ways to achieve this:</p>
18 <ol><li>Acme Corp could alter the integration with their eCommerce backend to avoid syncing these orders into Klaviyo in the first place, but would miss out on important revenue reporting</li>
19 <ol><li>Acme Corp could alter the integration with their eCommerce backend to avoid syncing these orders into Klaviyo in the first place, but would miss out on important revenue reporting</li>
19 <li>Acme Corp could upload suppressions into Klaviyo manually via CSV files, but that doesn’t scale</li>
20 <li>Acme Corp could upload suppressions into Klaviyo manually via CSV files, but that doesn’t scale</li>
20 </ol><p>By using webhooks, Acme Corp can achieve a fully automated solution.</p>
21 </ol><p>By using webhooks, Acme Corp can achieve a fully automated solution.</p>
21 <h2>Ingredients</h2>
22 <h2>Ingredients</h2>
22 <ul><li>1 Klaviyo segment defining profiles to suppress</li>
23 <ul><li>1 Klaviyo segment defining profiles to suppress</li>
23 <li>1 Klaviyo Flow containing a webhook action</li>
24 <li>1 Klaviyo Flow containing a webhook action</li>
24 <li>1 Klaviyo API endpoint</li>
25 <li>1 Klaviyo API endpoint</li>
25 </ul><h2>Instructions</h2>
26 </ul><h2>Instructions</h2>
26 <h3>Step 1: Create a segment in Klaviyo</h3>
27 <h3>Step 1: Create a segment in Klaviyo</h3>
27 - <p>The first step is to <a>create a segment</a> in Klaviyo containing profiles that we want to suppress. In this example, we’re going to include any profiles where the email address contains a text string that we only see from aliases originating from Amazon, Walmart, and eBay.</p>
28 + <p>The first step is to<a>create a segment</a>in Klaviyo containing profiles that we want to suppress. In this example, we’re going to include any profiles where the email address contains a text string that we only see from aliases originating from Amazon, Walmart, and eBay.</p>
28 <h3>Step 2: Create a flow triggered on segment membership</h3>
29 <h3>Step 2: Create a flow triggered on segment membership</h3>
29 - <p>Next, we’re going to create a flow in Klaviyo that is triggered on segment membership. This means that when someone first enters the segment, they will automatically enter the flow. Keep in mind that, by design, <a>Profiles may only enter a segment-triggered flow once</a>.</p>
30 + <p>Next, we’re going to create a flow in Klaviyo that is triggered on segment membership. This means that when someone first enters the segment, they will automatically enter the flow. Keep in mind that, by design,<a>Profiles may only enter a segment-triggered flow once</a>.</p>
30 - <p>It is pretty easy to set up. Just click into Flows and then <strong>Create From Scratch</strong>. Then select the segment you just defined as the trigger.</p>
31 + <p>It is pretty easy to set up. Just click into Flows and then<strong>Create From Scratch</strong>. Then select the segment you just defined as the trigger.</p>
31 <h3>Step 3: Choose your Klaviyo API endpoint for suppression or deletion</h3>
32 <h3>Step 3: Choose your Klaviyo API endpoint for suppression or deletion</h3>
32 - <p>You can choose to either <strong>Suppress</strong> a profile, or <strong>Delete</strong> a profile from your Klaviyo account.</p>
33 + <p>You can choose to either<strong>Suppress</strong>a profile, or<strong>Delete</strong>a profile from your Klaviyo account.</p>
33 - <p><strong>Suppressing a profile </strong>means the profile can no longer receive messages <em>except </em>for transactional messages. The profile will remain in your Klaviyo account but will be marked as suppressed. Events will still be recorded on this profile, which can be useful to have as the profile may subscribe in the future.</p>
34 + <p><strong>Suppressing a profile</strong>means the profile can no longer receive messages<em>except</em>for transactional messages. The profile will remain in your Klaviyo account but will be marked as suppressed. Events will still be recorded on this profile, which can be useful to have as the profile may subscribe in the future.</p>
34 - <p><strong>Deleting a profile </strong>means the profile is completely removed from your Klaviyo account, along with any event history and cannot be restored.</p>
35 + <p><strong>Deleting a profile</strong>means the profile is completely removed from your Klaviyo account, along with any event history and cannot be restored.</p>
35 <h3>Step 4: Setup the webhook with the relevant Klaviyo API endpoint</h3>
36 <h3>Step 4: Setup the webhook with the relevant Klaviyo API endpoint</h3>
36 - <p><strong><a>Suppressing a profile</a></strong></p>
37 + <p><a><strong>Suppressing a profile</strong></a></p>
37 - <p>Configure the webhook as below. You will need to enter your <a>private key</a> in the <em>[YOUR-PRIVATE-API-KEY] </em>section</p>
38 + <p>Configure the webhook as below. You will need to enter your<a>private key</a>in the<em>[YOUR-PRIVATE-API-KEY]</em>section</p>
38 URL: https://a.klaviyo.com/api/profile-suppression-bulk-create-jobs/ Header 1 = accept: application/json Header 2 = content-type: application/json Header 3 = revision: 2024-07-15 Header 4 = Authorization: Klaviyo-API-Key [your-private-api-key] JSON BODY { "data": { "type": "profile-suppression-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "{{person.email}}" } } ] } } } }<p>It should look like this when you have configured it</p>
39 URL: https://a.klaviyo.com/api/profile-suppression-bulk-create-jobs/ Header 1 = accept: application/json Header 2 = content-type: application/json Header 3 = revision: 2024-07-15 Header 4 = Authorization: Klaviyo-API-Key [your-private-api-key] JSON BODY { "data": { "type": "profile-suppression-bulk-create-job", "attributes": { "profiles": { "data": [ { "type": "profile", "attributes": { "email": "{{person.email}}" } } ] } } } }<p>It should look like this when you have configured it</p>
39 - <p><strong><a>Deleting a profile</a></strong></p>
40 + <p><a><strong>Deleting a profile</strong></a></p>
40 - <p>Configure the webhook as below. You will need to enter your <a>private key</a> in the <em>[YOUR-PRIVATE-API-KEY] </em>section</p>
41 + <p>Configure the webhook as below. You will need to enter your<a>private key</a>in the<em>[YOUR-PRIVATE-API-KEY]</em>section</p>
41 URL: https://a.klaviyo.com/api/data-privacy-deletion-jobs/ Header 1 = accept: application/json Header 2 = content-type: application/json Header 3 = revision: 2024-07-15 Header 4 = Authorization: Klaviyo-API-Key [your-private-api-key] JSON BODY { "data": { "type": "data-privacy-deletion-job", "attributes": { "profile": { "data": { "type": "profile", "attributes": { "email": "{{person.email}}" } } } } } }<p>It should look like this when you have configured it</p>
42 URL: https://a.klaviyo.com/api/data-privacy-deletion-jobs/ Header 1 = accept: application/json Header 2 = content-type: application/json Header 3 = revision: 2024-07-15 Header 4 = Authorization: Klaviyo-API-Key [your-private-api-key] JSON BODY { "data": { "type": "data-privacy-deletion-job", "attributes": { "profile": { "data": { "type": "profile", "attributes": { "email": "{{person.email}}" } } } } } }<p>It should look like this when you have configured it</p>
42 <h3>Step 5: Test and set the flow live</h3>
43 <h3>Step 5: Test and set the flow live</h3>
43 <p>Once you have your webhook configured, you can preview and test the webhook works by clicking the “Preview Webhook” button</p>
44 <p>Once you have your webhook configured, you can preview and test the webhook works by clicking the “Preview Webhook” button</p>
44 <p>Verify an email address has populated from your segment and click “Send Test Request”</p>
45 <p>Verify an email address has populated from your segment and click “Send Test Request”</p>
45 <p>If everythings works then you will get a green success bar</p>
46 <p>If everythings works then you will get a green success bar</p>
46 <p>Verify the profile is now suppressed/deleted and then you can set your flow live!</p>
47 <p>Verify the profile is now suppressed/deleted and then you can set your flow live!</p>
47 - <p>After you’ve confirmed that everything works well, you can set the webhook action to “live” and optionally, you can <a>back-populate the flow</a> to process any existing segment members. From this point, any time a profile originates in Klaviyo that qualifies into the segment, it will be automatically suppressed.</p>
48 + <p>After you’ve confirmed that everything works well, you can set the webhook action to “live” and optionally, you can<a>back-populate the flow</a>to process any existing segment members. From this point, any time a profile originates in Klaviyo that qualifies into the segment, it will be automatically suppressed.</p>
48 <h2>Impact</h2>
49 <h2>Impact</h2>
49 - <p>In this Solution Recipe, we look at using the Klaviyo <a>flow webhook action</a> to send profile data triggered on segment membership to a custom API endpoint which then sends data back to Klaviyo. This illustrates a few useful patterns that can be extended to cover much more advanced use cases, such as sending webhooks to a custom API and round-tripping data back into Klaviyo after transforming it. Sending webhooks enables wide-ranging functionality, and can greatly enhance what’s possible with Klaviyo.</p>
50 + <p>In this Solution Recipe, we look at using the Klaviyo<a>flow webhook action</a>to send profile data triggered on segment membership to a custom API endpoint which then sends data back to Klaviyo. This illustrates a few useful patterns that can be extended to cover much more advanced use cases, such as sending webhooks to a custom API and round-tripping data back into Klaviyo after transforming it. Sending webhooks enables wide-ranging functionality, and can greatly enhance what’s possible with Klaviyo.</p>
50 <h2>Learn more!</h2>
51 <h2>Learn more!</h2>
51 - <p>If you’re interested in learning more about Klaviyo’s developer experience and capabilities, please visit <a>developers.klaviyo.com</a>!</p>
52 + <p>If you’re interested in learning more about Klaviyo’s developer experience and capabilities, please visit<a>developers.klaviyo.com</a>!</p>
52  
53