I’m making an interface to allow for our team and customers to manage email preferences. This interface uses the Klaviyo API, and we’ve managed to come up with a solution that works for us using custom profile properties. We can create segments based on the values of the custom properties.
I can retrieve profile data by email address or Klaviyo ID. I use the following endpoints:
- /api/v1/person/[PROFILE ID]
The problem is that the profile does not show if the person is globally excluded/suppressed.
I’d like to know if that profile is globally excluded/suppressed, but it looks like my option is to pull down the entire set of data using the /api/v1/people/exclusions endpoint. I’d have to loop through all of the results just to see if this single email address is excluded/suppressed.
Yes, I know that I can use the API to see if somebody is unsubscribed from a list, but we have multiple lists, and performing several API requests to check those lists is no more efficient than looping through the entire set of global exclusions.
So, I’m wondering how everyone else would handle this. If a person was to use a link in one of our emails and globally unsubscribe, it would be important for everyone to see that on our side, but pulling down the whole set of exclusions every time we load a local profile page seems inefficient. What should I do about this?