Solved

Update Profiles not working

  • 29 December 2022
  • 1 reply
  • 123 views

Badge +1

I am trying to use Update Profile API using Axios.

I am not sure what is wrong, the data is not updating.

await axios({
url: `https://a.klaviyo.com/api/profiles/${id}/`,
method: "PATCH",
headers: {
accept: "application/json",
revision: "2022-10-17",
"content-type": "application/json",
Authorization: `Klaviyo-API-Key xxxxx`,
},
body: JSON.stringify({
data: {
type: "profile",
attributes: {
properties: { "Plan Codes": "123" },
phone_number: "9876543210",
},
id: id,
},
}),
})

Under data, for the parameter id which id needs to be added?

icon

Best answer by Dov 29 December 2022, 17:41

View original

1 reply

Userlevel 7
Badge +61

Hi @iamharidasan,

Thanks for sharing this with us.

The $id field refers to the profile id. That can be found when you navigate to a profile in the URL:

You can also pull the id through the API, you’ll find the solution for that in the thread below:

I hope that’s helpful.

Reply