Solved

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

  • 2 December 2021
  • 12 replies
  • 1042 views

Badge +2

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!

icon

Best answer by Dov 6 January 2022, 21:54

View original

12 replies

Userlevel 7
Badge +60

Hey @lauren.gastineau 

Thank you so much for coming to the Klaviyo Community for help with your custom API integration. While Klaviyo can help with our native integrations, you should reach out to one of our Agency Partners for help with building this custom integration. I am also going to ask some of our experts internally if they have a solution that I can share with you.  Hopefully one of our partners here in the Klaviyo Community can jump in to give some advice on this!

 

Userlevel 1
Badge +2

@stephen.trumble Is there any planned solution around this? It seems commonly requested and we’d be interested as well since calling the API individually for 100,000 profiles every time we want to back everyone up into a separate database is a huge pain

Badge +1

Also adding in the urgency of this request. Outside of me calling every profile (500k+) and slamming your API for months, there’s no way to get this data. But it is clearly available in the front end - all I really want to pull is created date by ID.

@stephen.trumble or anyone else, please respond with something more nuanced than “reach out to our agency partners” - this should not be a custom integration, it’s a basic API request

Thank you

Userlevel 1
Badge +2

Started a new thread here since this is marked as “Solved” 

 

Userlevel 7
Badge +61

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!

Userlevel 1
Badge +2

@Dov This only gives us emails and phone numbers. We still have to call the individual profile endpoint for every single profile to get the other data in the profile

Userlevel 7
Badge +61

Hi @dustin,

Understood, thanks for that clarification.

That is correct, I have filed a feature request to achieve a full-profile export (including custom properties for all profiles) through the API. We do our best to keep up with incoming feature requests, and if this one in particular gets enough traction, the team will consider it for future implementation 

In the meantime, I recommend grouping the profiles into a segment (as I described above) and exporting them via a .csv file. That will allow you to select whichever custom properties you’d like to export for these profiles.

 

 

Userlevel 1
Badge +2

@Dov Yes, grouping profiles into a segment makes sense. Is there any programmatic way to trigger an export of this CSV and download it?

Otherwise to receive this functionality, we are forced to have someone perform that action manually each day or just completely bypass your public API

Userlevel 7
Badge +61

Hi @dustin,

There is no auto-download report functionality available. With that said, once you have the segment created, it will update members on its own (as segments do :)) and you can export it from there. The product team is aware of the request to update the API to include properties to help expedite things.

Badge +1

The export function does help in the short term, thank you. But yes, adding to dustin’s point, this is still an important request. 

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

Userlevel 7
Badge +36

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

Reply