Solved

New API - Bulk creation and updates of profiles?


Badge +1

It seems like the new APIs are a major step backwards in certain regards and I’m hoping that I'm just misunderstanding their usage. For instance, if I have an array containing, say, two hundred profiles that I want to insert into a list, some of which are existing profiles with updated information and some of which are new profiles, previously I could use the https://a.klaviyo.com/api/v2/list/[listid]/members endpoint, which accepts an array of profiles and would update/create the profiles and ensure they were in the referenced list.

With the new API it seems like I have cycle through the list one-by-one and use a POST call for new users, and PATCH call for existing users, even though the POST call knows which profile is being referenced as the existing ID is returned in the error message. After doing that I use the Subscribe or Add profiles endpoint to add them to the list via Klaviyo ID (as opposed to a key field like email address that we don’t have to get back from Klaviyo).

While I sort of understand splitting the profile operations from the list operations (although it’s certainly more cumbersome since we now have to transport and store data back from Klaviyo, where before we didn’t), it’s puzzling that the profile operations don’t accept arrays and that you have to use a different call based on it being a new profile or an update to an existing one - especially considering the POST operation clearly knows that the profile exists. My operation that previously could be done in 1 call (or a few, depending on the number of profiles) now needs to be done in hundreds or even thousands of calls.

Am I misunderstanding things? If not, is there a plan to at least include support for arrays in the POST or PATCH operations by the time the v2 API sunsets? I’d also suggest that POST operations be allowed to update existing profiles (could be an optional parameter). 

icon

Best answer by Brian Turcotte 26 April 2023, 17:13

View original

13 replies

Userlevel 7
Badge +36

Hi @NewGuy11!

 

Thank you for this feedback - I will certainly forward this back to our Product Team to see if there are any updates regarding the new API’s functionality. We separated the List and Profile actions in order to increase the functionality and granularity of each, but I could see how this would affect your use case. I will update the thread when I learn more.

 

Best,

Brian

Badge

Hi @Brian Turcotte,

Previously we could use the same endpoint to update properties for profiles. However, if I’m not mistaken, the same one from the current version (https://developers.klaviyo.com/en/reference/create_list_relationships) doesn’t seem to allow that anymore. Is that true?

If this is the case, does it mean I would need to use the https://a.klaviyo.com/api/v2/list/[listid]/members endpoint while it’s still not sunset? And is there a planned date for the API to be deprecated?

Thanks for answering my questions!

Userlevel 7
Badge +36

Hi @newuser2!

 

You won’t have to use the old endpoint, but you may just have to do two separate API calls - one to add the profile to a list, and one to update profile properties.

 

The v1/v2 legacy APIs are scheduled to be end-of-lifed on Jan 1, 2024, and certain functionalities were separated into different endpoints in order to maximize granularity and control.

 

I hope this helps to clarify!

 

Best,

Brian

Badge

Hi @Brian Turcotte ! Thanks for getting back to me. The main reason I wanted to use the old endpoint is because I wanted to update profiles in bulk. Would it still be possible to bulk update profile properties with your suggestion to do two separate API calls?

Userlevel 7
Badge +36

Hi @newuser2!

 

It’s definitely possible to bulk-update profiles using the Update Profile endpoint, you’d just have to loop through that call for each profile. This was actually the topic for March’s Developer Challenge, and here was our winner’s answer, if you’re interested:

 

Best,

Brian

Hi,

I just sent an email to the technical team regarding this issue, but the accepted answer here does not respond to the problem being presented. Unless I’m missing something, using the Update Profile endpoint implies doing one http call per profile (plus one if you want to check if the profile exists before), and there’s rate limiting. That’s not a bulk update of the profiles. If you have thousands of profiles to send, it takes forever.

 

Regards

1 request per profile to update a list of profiles does seem concerning. An API endpoint to bulk update profiles would be very much appreciated

Userlevel 7
Badge +36

Hi @anle1337 and @maxA!
 

A bulk profile update endpoint is definitely on our product team’s radar, so I will update the thread when more information becomes available. 

 

Best,

Brian

Userlevel 1
Badge +1

Any update regarding this? We are moving out of the old API because it’s being deprecated, and we want to export hundreds to hundreds of thousands contact via the API, using single call per profile x3 (for check if exists and then create or update and then add to list) will take forever.

 

My point of view is that when a new API version is available and the previous one is removed, functionalities should be added, or at least preserved, and not removed, unless for exceptions like very old / useless operations which does not seem to be the case here!

Hi @Brian Turcotte,

We are looking for an update regarding a bulk api for profiles as well. This is a really important feature for us.

Best,
Andrew Tay

Same here. We’re currently evaluating Brevo (Sendinblue) and many others as most Klaviyo competitors have this basic bulk-update functionality.

It would be a real pain to migrate from Klaviyo but not having this functionality is a deal breaker.

Badge +1

If this isn’t forthcoming would it be possible to at least increase rate limits on APIs that create/update profiles?

We found ourselves with this issue when we had the requirement to broadcast emails.

Essentially we used the Subscription API, as it allows bulk profile creation, but it turns out that it doesn’t allow profile custom properties.

So we found the Bulk Profile Import API in the new API version recently released and despite they suggest not to use this API for updating a small number of profiles, it actually covers the bulk profile update scope very well. This API allowed us to bulk create profiles but also passing custom properties during creation. The API also allows to subscribe the profiles to as many lists as needed (the limit should be described in the docs)

In conclusion, this API is the one we need to create or update profiles in bulk.

I hope this helps, the implementation is actually very easy and straightforward.

Reply