Understand the different webhooks available in Klaviyo

Estimated 4 minute read
|
Updated Aug 22, 2024, 10:38 AM EST
You will learn 

You will learn 

Learn about the differences between webhook solutions available in Klaviyo, and when you should use each one. 

Before you begin

Before you begin

CDP webhooks and Code are part of Klaviyo CDP. CDP is not included in Klaviyo’s standard marketing application, and a CDP subscription is required to access the associated functionality. Head to our billing guide to learn more about adding this functionality to your plan or get started if you are a new customer.

What are webhooks?

What are webhooks?

Webhooks allow Klaviyo to pass information or “call” other applications, tools, and servers via HTTP requests. They can send information about an event that has happened (e.g. an order placed, a new customer subscribed, etc) or notify your external systems that the event has occurred.

Webhooks are made of a few key components:

  • Topic
    The event that causes a webhook to fire.
  • Body (or “the payload”)
    The data that the webhook sends.
  • Headers
    A place to pass additional information (such as authentication).
Flow webhooks

Flow webhooks

You can add webhooks in flows as an action that occurs when the flow reaches a certain stage or step. Once a flow reaches the webhook action, a POST request is sent with data about the event or the recipient that triggered the flow, based on how you construct the payload. 

Flow webhooks can only send based on flow-triggered events (i.e., events that can be used as a flow trigger). Additionally, flow webhooks do not support message-related events (e.g., Received email, Clicked email, Marked email as spam) as flows typically end in message receipt. 

Unsubscribed from Email Marketing can be used as a flow trigger and the topic for a flow webhook. 

Example use cases for flow webhooks

Example use cases for flow webhooks

Some example uses case where flow webhooks would be most effective include:

  • Send a message or POST request that triggers based on a subscriber being added to a segment or list.
  • Automate suppressions when a profile enters an unengaged segment. 
  • Send a personalized thank you message through a service like Whatsapp or Facebook messenger when customers purchase. 
Webhooks in Klaviyo CDP 

Webhooks in Klaviyo CDP 

Klaviyo CDP is not included in Klaviyo’s standard marketing application, and a CDP subscription is required to access the associated functionality. Head to our billing guide to learn more about adding this functionality to your plan or get started if you are a new customer.

Webhooks in Klaviyo CDP allow you to notify external systems in response to events, without depending on a series of steps leading up the webhook action. CDP webhooks do not require you to manually construct or specify the body of the webhook request. If you want to notify your external systems that an event has occurred without any custom development, webhooks in Klaviyo CDP are most effective. 

CDP webhooks also support a wider range of topics to trigger the request, and allow you to send information in response to any event that can be queried for via the Get Events API.

These include:

  • Email events (e.g., Received email, Clicked email, Marked email as spam)
  • SMS events (e.g., Sent SMS, Received SMS)
  • Push notification events (e.g., Received push, Bounced push)
  • Events from integrations ( i.e., events from first-party integrations created by Klaviyo)
  • API events (e.g., events synced through Klaviyo’s APIs)

This includes message-related events like Unsubscribed, Received email, or Clicked email that are not supported by flow webhooks.

Additionally, CDP webhooks allow you to subscribe to multiple triggers at once, unlike flow webhooks, which depend on single-trigger flows.

Destination URLs must be publicly accessible HTTP endpoints. 

Example use cases for CDP webhooks

Example use cases for CDP webhooks

  • Sync customers’ Unsubscribed events to external systems.
  • Report Received Email events to help desk software so agents can see email history to better serve customers.
  • Sync all email sends, opens, and clicks into a data warehouse that is not supported by Klaviyo's data warehouse sync.
Code 

Code 

Code is a feature included in Klaviyo CDP. It is not included in Klaviyo’s standard marketing application, and a CDP subscription is required to access the associated functionality. Head to our billing guide to learn more about adding this functionality to your plan or get started if you are a new customer.

Code leverages webhooks to enable the execution of custom functions in response to an event trigger. You can write code directly in Klaviyo’s editor, and Klaviyo manages the code execution, monitoring, and logging.

If you want to send requests to your external systems without hosting a public HTTP endpoint, you can use Code. Additionally, if you want to execute custom functions in response to an event occurring, you should use Code rather than the other webhook solutions available in Klaviyo. 

Code also supports more granularity with event triggers over webhooks in CDP. You can select individual metrics to act as the topic rather than all integration or API events.

Note that Code does not support the following events as topics: 

  • Email opened
  • Email received
Example Code use cases 

Example Code use cases 

  • Import Python JSON libraries to parse event payloads and extract something.
  • Set custom profile properties based on event metadata using Klaviyo’s APIs.
  • Import chatGPT libraries and create a custom message for each abandoned cart based on the profile and items in the cart.
Additional resources 

Additional resources 

Understand webhooks in flows
Understand webhooks in Klaviyo CDP
Getting started with Code

Was this article helpful?
Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community
Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.
Live training
Join a live session with Klaviyo experts to learn about best practices, how to set up key features, and more.
Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance
Availability varies by location and plan type