Skip to main content
Contributor I
December 29, 2022
Solved

Update Profiles not working

  • December 29, 2022
  • 1 reply
  • 252 views

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?

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

    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.

    1 reply

    Dov
    DovAnswer
    Klaviyo Alum
    December 29, 2022

    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.

    DD