Hey all,
We have a service that’s syncing external contacts to Klaviyo. It’s currently using the legacy api endpoint:
POST /api/v2/list/{list_id}/members (documentation)
I am trying to migrate to the new API (as per this documentation) to following endpoint:
POST /api/profile-bulk-import-jobs (documentation)
The endpoint is working as expected in terms of creating/ updating profile, however it’s not adding the profiles to the desired list
Any help would be appreciated. Curl request below:
Curl request:
curl --request POST \
--url 'https://a.klaviyo.com/api/profile-bulk-import-jobs/?=' \
--header 'Authorization: Klaviyo-API-Key <apiKey>' \
--header 'Content-Type: application/json' \
--header 'User-Agent: insomnia/8.6.1' \
--header 'accept: application/json' \
--header 'revision: 2024-02-15' \
--data '{
"data": {
"type": "profile-bulk-import-job",
"attributes": {
"profiles": {
"data": [
{
"type": "profile",
"attributes": {
"email": "jane.doe@klaviyo.com",
"properties": {
"recommended_product_1": "Brown Axe"
}
}
},
{
"type": "profile",
"attributes": {
"email": "john.doe@klaviyo.com",
"properties": {
"recommended_product_1": "Black Axe"
}
}
}
]
}
}
},
"relationships": {
"lists": {
"data": [{
"type": "list",
"id": "<listId>"
}]
}
}
}
'