Skip to main content
Contributor I
March 3, 2023
Solved

New API - Bulk creation and updates of profiles?

  • March 3, 2023
  • 15 replies
  • 1543 views

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). 

    This topic has been closed for replies.
    Best answer by Brian Turcotte

    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

    15 replies

    Brian Turcotte
    Klaviyo Alum
    March 3, 2023

    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

    Contributor II
    April 18, 2023

    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!

    Brian Turcotte
    Klaviyo Alum
    April 24, 2023

    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

    Contributor II
    April 24, 2023

    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?

    Brian Turcotte
    Klaviyo Alum
    April 26, 2023

    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

    Contributor I
    May 16, 2023

    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

    Contributor I
    July 12, 2023

    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

    Brian Turcotte
    Klaviyo Alum
    July 12, 2023

    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

    Contributor III
    September 20, 2023

    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!

    Contributor I
    October 4, 2023

    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