Fire custom webhook when user unsubscribes?

  • 4 February 2022
  • 9 replies

Badge +1

How do I add a custom webhook endpoint for Klaviyo to call when a user unsubscribes for a list? Does this exists? It’s a must have feature of an email provider. If this isnt available how else can I keep subscription statuses synced with my application database?


Best answer by Taylor Tarpley 4 February 2022, 19:17

View original

9 replies

Userlevel 7
Badge +59

Hi @sylvie


Welcome to the Community! Happy to help out with this! 


Yes, you can use achieve what you’re looking to do by using the  GET api/v1/people/exclusions endpoint to retrieve global suppressions. You will then know who is unsubscribed and anyone who’s not included in that call would be subscribed. I would recommend checking out this very helpful topic posted by a peer in the Community about the same topic! 


Thanks for your participation in the Community!


Userlevel 1
Badge +2

This is a solution but requires a regular cron job and a fair amount of processing on our own servers to iterate through the returned data, executing an unsubscribe action on each result.

Please could I raise a feature request for a more traditional webhook solution that just calls a URL when someone either a) unsubscribes or b) subscribes? That way I will know that my own systems are *always* in sync with Klaviyo.

It’s important because people who are subscribed to our mailing list get a reduced shipping rate and some other benefits when they purchase. If they’ve subbed via klaviyo and then order before a sync has occurred, we’ll end up billing them wrongly.


I would echo @dartacus - I’m really surprised this isn’t a thing, don’t really want to have to hit that end point continually.

Has there been any progress on this feature request @Taylor Tarpley?

Thanks, Stuart.

Userlevel 7
Badge +30

Hi @dartacus, @1stevengrant and @Stuart Heggie!

We do now have webhook functionality that can be triggered when someone subscribes, but at this time, webhooks are limited to events that can trigger a flow - so unsubscribes are not eligible:


However, our Product team is aware of this feature request, so I’ll update the thread if anything changes in the future.




@Brian Turcotte thanks for clarifying, that is extremely disappointing. Can you please provide some indication to the priority of this feature request?

thanks Stuart!

Userlevel 7
Badge +30

Hi @Stuart Heggie


I don’t have an exact timeline for this feature, but I can assure you that the team is actively evaluating this functionality, and I have forwarded your feedback to supplement the request!





Just started using Klaviyo and kind of shocked this is not implemented yet. This is crucial, as you always need to keep various lists in different external databases in synch with Klaviyo. Please implement this. Going to hold off on sending emails thru Klaviyo until this is implemented as otherwise it will become a massive pain to keep lists in synch across various databases. Every major email providers offers this type of webhook, btw.

I managed to figure this out through some trial and error, but it is possible to have a webhook fire on unsubscribes.

  1. Make a new Segment, and add these rules:
  2. Create a new Flow, based on the Segment you just made. The idea is that when a user clicks unsubscribe, OR if you unsubscribe (or suppress) them, they will then ‘join’ this segment which can fire your webhook.



Make sure you make the flow “Live” because the “Manual” option won’t work for triggers that rely on list/segment entry. Also, I found that the segment took between about 5 and 15 minutes to actually get updated when the user unsubscribes, so the webhook doesn’t fire til they are in the segment, but it did fire and my webservice did catch and process it so proof of concept works!


I don’t know if this is something new but hope that helps everyone!