Skip to main content
Problem Solver I
July 27, 2023
Solved

Add profiles to list failed with Invalid profile IDs: set()

  • July 27, 2023
  • 6 replies
  • 450 views
I’ve been running into an issue trying to add profiles to a list in batches of 950.  Things were working fine but I started to run into this error:
{:success=>false, :response=>{:errors=>[{:id=>"c8932474-507f-45e6-9d12-4a1a87403ae1", :status=>400, :code=>"invalid", :title=>"Invalid input.", :detail=>"Invalid profile IDs: set()", :source=>{:pointer=>"/data/"}}]}}

The endpoint is:
https://a.klaviyo.com/api/lists/{id}/relationships/profiles/

And I tried to keep my payload under 1000 so 950 per call.  I’ve been able to successfully move 20,000 profiles into a list without issue but lately I’ve been getting the error above.  Any ideas what might be happening?  I was going to drop my numbers down to try to isolate which profiles might be failing.  Would love any feedback if anyone has hit the same error.

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

    I found the issue, it’s on my end.  set() is maybe Python so you’re trying to create a list with no duplicates which made me think I probably have duplicate IDs in my list and I found 5 duplicates in the list I was trying to send.  I need to update the code on my end to de-dupe before attempting to send these. 

    6 replies

    Brian Turcotte
    Klaviyo Alum
    July 28, 2023

    Hi @Chops!

    I’m going to check on this with our Engineering team and I’ll update the thread ASAP!
     

    Best,

    Brian

    ChopsAuthorAnswer
    Problem Solver I
    July 31, 2023

    I found the issue, it’s on my end.  set() is maybe Python so you’re trying to create a list with no duplicates which made me think I probably have duplicate IDs in my list and I found 5 duplicates in the list I was trying to send.  I need to update the code on my end to de-dupe before attempting to send these. 

    Brian Turcotte
    Klaviyo Alum
    August 1, 2023

    Hi @Chops!

    Glad to hear it’s resolved and thanks for sharing your solution with the Community!

     

    - Brian

    Contributor I
    February 14, 2024

    I ran afoul of this just now. @Chops is a hero for figuring this out. @Brian Turcotte Please log a request with the engineering team to make this an actual error message, rather than what it is today. It will save customers & partners a lot of time. 

    Contributor I
    June 9, 2024

    @Brian Turcotte I think it would be worth making the error message more informative. 

    I have the same error message with the same root cause (profiles duplication):

    Invalid profile IDs: set()

    And it’s quite difficult to guess what’s wrong with the payload. 

    It would be good to mention duplicates in the error message.

    Thank you.

    Kim Strauch
    Klaviyo Employee
    Klaviyo Employee
    June 13, 2024

    @Chops and @MVysh, thank you for raising this issue! Our Engineering team is working on a fix to de-dupe the profile IDs on our end to avoid this error case.