Skip to main content

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?

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