Skip to main content
Solved

Update Profiles not working

  • December 29, 2022
  • 1 reply
  • 184 views

Forum|alt.badge.img+2

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?

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.

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

1 reply

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • 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.