Solved

Retrieving list unsubscribers via the lists V2 api

  • 9 December 2020
  • 4 replies
  • 1015 views

Badge +2

We are implementing an integration in a web app with Klaviyo to, amongst other things, synch unsubscribers between Klaviyo and our web app.  As part of this we need to retrieve all unsubscribers from Klaviyo to update our web app.

 

To retrieve the unsubscribers from Klaviyo we’ve been looking to make a call to the GET https://a.klaviyo.com/api/v2/list/{LIST_ID}/exclusions/all​​​​​​​ end point but I am not seeing any of the unsubscribed profiles being returned.  The profile was unsubscribed via the DELETE https://a.klaviyo.com/api/v2/list/{LIST_ID}/subscribe​​​​​​​ end point.

 

The profile history does show that it has been unsubscribed from the list but the profile does not show in the list of exclusions in Lists & Segments so I suspect the exclusions end point is the wrong one to use.  What would be the correct api end point to use to retrieve a list of all unsubscribers?

 

Any help would be appreciated, thanks.

icon

Best answer by caroline 17 December 2020, 04:28

View original

4 replies

Userlevel 4
Badge +6

Hi there, 

 

Thanks for reaching out to the Community! The GET https://a.klaviyo.com/api/v2/list/{LIST_ID}/exclusions/all end point will show all profiles that have been unsubscribed from a specific list. If the profile was not unsubscribed from the list specified in the GET request we will not pull the profile. 

 

To get a list of all unsubscribed profiles in your account I would create a segment with the following criteria: 

 

 

And then use the following endpoint to retrieve the profiles on the Unsubscribed list you create: 

GET https://a.klaviyo.com/api/v2/list/{LIST_ID}/members

Badge +2

Thanks for your response.  I can see in the profile that it was unsubscribed from the list ID that I am calling the GET https://a.klaviyo.com/api/v2/list/{LIST_ID}/exclusions/all end point with but am still seeing no records returned.  I do see in the documentation for the DELETE https://a.klaviyo.com/api/v2/list/{LIST_ID}/subscribe​​​​​​​ end point that it will unsubscribe and delete the profile from the list, would that be the reason why I don’t see this profile in the exclusions?  Is there another end point I should be using instead to only unsubscribe the profile from a list rather than delete them from the list as well?

Userlevel 5
Badge +8

Hi there,

 

The DELETE /api/v2/list/{LIST_ID}/members endpoint will unsubscribe a profile from a list, while the DELETE /api/v2/list/{LIST_ID}/subscribe endpoint will add the profile as a single-list suppression and remove the profile from the list.

Most Klaviyo accounts are configured to treat single-list suppressions as global suppressions. You can read more about this here.

As a result, if you unsubscribed a profile using the DELETE /api/v2/list/{LIST_ID}/subscribe endpoint, the profile would be treated as a global suppression. The GET exclusions/all endpoint does not return global suppressions (it returns list-specific suppressions).

You can use the GET api/v1/people/exclusions endpoint to retrieve global suppressions instead.

Hope this helps!

 

Best,

 

Caroline

Userlevel 5
Badge +8

Additionally @RED Developers, wanted to add that you might want to consider using our metrics API instead, to check for profiles that unsubscribed over a certain time period.

 

Please let me know if you have any other questions.

 

Best,

 

Caroline

Reply