Skip to main content
Contributor I
December 2, 2021
Solved

What is the best way to collect all profile details in an account through APIs?

  • December 2, 2021
  • 12 replies
  • 1325 views

Hi all,

 

I’m trying to get all profiles in an account, but I don’t see a direct API endpoint to do so. If I’ve missed it, please direct me to it. Otherwise, looking over the API documentation these are the 3 ways I can collect users:

  1.  I can collect all campaigns in an account, then get all recipients in each campaign, and then get every profile’s details. 
  2. I can all collect all lists in an account, then get all profiles in each list, and then get every profile’s details.
  3. I can collect all interactive users through event metrics since all user profile details are returned as well.

Method 1 and 2 above are quite slow since it requires a lot of iterating. I think Method 3 would miss some non-interactive profiles.

 

Has anyone found the fastest / best way to collect all profiles in an account? Thank you!

This topic has been closed for replies.
Best answer by Dov

Hi @pcm, @lauren.gastineau & @dustin,

One method to achieve this is to set up a segment with everyone in your account and then use the group memberships endpoint to return all of the members included in a list or a segment.

The segment would be defined like the following: Properties about someone > email >  contains @. Optionally, if you wish to exclude suppressed profiles from this segment, you can simply add an “AND” separator to the definition an include “is not suppressed”.



Here is the group memberships endpoint that would return all of the members included in a list or a segment:

GET https://a.klaviyo.com/api/v2/group/{LIST_ID or SEGMENT_ID}/members/all
 

You can find more on the above and a use-case of exporting Klaviyo profile data to a 3rd party data warehouse in our developer portal here. And the specific portion of our dev doc on this endpoint here.

I hope that is helpful!

12 replies

Contributor I
May 17, 2023

I want to download profile ID and email from the segment/list i have created which segment contains only . i can download by using segment_ID in below. It is working now. is that v2 version work for a while? or do we need to change to our company version like v2023-xx-xx,. If so what is the equivalent API command to get all data from the segment/List in th that version ?. 

Help will be much appreciated,. thanks

GET https://a.klaviyo.com/api/v2/group/{LIST_ID or SEGMENT_ID}/members/all

Brian Turcotte
Klaviyo Alum
May 22, 2023

Hi @Ilaya4Staples!

 

The v1-2 legacy APIs will be depreciated at the end of the year (2023), so I would suggest upgrading to the new v3 APIs at your earliest convenience. Per our API Comparison chart, the new, v3 equivalents to the endpoint you referenced would be Get List Profiles for lists and Get Segment Profiles for segments.

Thanks for using the Community!

- Brian