Skip to main content
Solved

Trouble posting profiles into a list through API

  • 19 March 2024
  • 5 replies
  • 217 views

Forum|alt.badge.img

Hi,

 

I’m using Postman to create a profile into a list but the response i got is:

{"errors":[{"id":"9778a9b2-1de2-41c2-921c-01b9e531b57e","status":400,"code":"invalid","title":"Invalid input.","detail":"Invalid profile IDs: {'Test-4'}","source":{"pointer":"/data/"}}]}

I succeed to create a list and to get the profiles in a list so the credentials are good.

Can anyone help me please ?

Here is my body request:

{"data": [{"type": "profile","id": "Test-4"}]}

 

Thanks !

Arnaud

Best answer by carleygilmore

Hi Arnaud!

I would check out our Bulk Profile Import API for this functionality. With Spawn Bulk Profile Import Job, you can create profiles and add them to a list at the same time. The API performs an upsert, so it will update matching profiles if they already exist in your account or create them if no matching profiles are found. You can also add these profiles to a list in the same payload. 


Best,

 

Carley

View original
Did this topic or the replies in the thread help you find an answer to your question?

5 replies

carleygilmore
Klaviyo Employee
Forum|alt.badge.img+2
  • Klaviyo Employee
  • 6 replies
  • March 19, 2024

Hey Arnaud!

Thanks for using Community! If you’re using Add Profile to List, here’s my sample request URL, where YcYtDK is the list ID:

 

POST /api/lists/YcYtDK/relationships/profiles/

 

And an example request payload with my profile ID:
 

{

"data": [

{

"type": "profile",

"id": "01HQP5PHTE5T81DCTES644ZKD0"

}

]

}

 

I would make sure that:

  • The correct list ID is a path param and matches the list ID for the list you’d like to add the profile to.
  • The ID you provide in the request payload matches a profile ID.

You can check in your Klaviyo account for the list/profile IDs by clicking on the list/profile in your account and checking the URL. For example: https://www.klaviyo.com/list/YcYtDK.

Hope this helps!

Carley


Forum|alt.badge.img
  • Author
  • Contributor I
  • 2 replies
  • March 19, 2024

Ok, that means i need to create the profile first and then add it to a list ?

I cannot do both at the same time ?

 


carleygilmore
Klaviyo Employee
Forum|alt.badge.img+2
  • Klaviyo Employee
  • 6 replies
  • Answer
  • March 20, 2024

Hi Arnaud!

I would check out our Bulk Profile Import API for this functionality. With Spawn Bulk Profile Import Job, you can create profiles and add them to a list at the same time. The API performs an upsert, so it will update matching profiles if they already exist in your account or create them if no matching profiles are found. You can also add these profiles to a list in the same payload. 


Best,

 

Carley


Forum|alt.badge.img
  • Author
  • Contributor I
  • 2 replies
  • March 20, 2024

Hi Carley,

 

Thanks a lot, it’s working with the Bulk import !!

 

Have a great day.

 

Arnaud


Forum|alt.badge.img+3
  • Contributor II
  • 4 replies
  • February 3, 2025

Hi, I’m not a developer… How / where do I start to figure out where the code goes for Bulk editor? My API stopped working 1/31.. :(