Skip to main content
Solved

409 on Profile Upsert call


KeviSunshine
Expert Problem Solver III
Forum|alt.badge.img+8

Hi All,

We’re using the new Klaviyo APIs. I am using the Create/Update Profile call, documented here.

We hit an error this morning where Klaviyo returned a 409 Conflict error for this endpoint. 

{
  "errors": [
    {
      "id": "134eb88b-10fb-4f65-84bc-6ea5fb2f1f2a",
      "status": 409,
      "code": "duplicate_profile",
      "title": "Conflict.",
      "detail": "A profile already exists with one of these identifiers.",
      "source": { "pointer": "/data/attributes" },
      "links": {},
      "meta": { "duplicate_profile_id": "{redacted}" }
    }
  ]
}

 

How is it possible to get a 409 Conflict error on an upsert operation? If the profile exists, why didn’t it get updated? Is this a bug?

 

Let me know.

Thank you,

Kevin.

Best answer by KeviSunshine

Hi @bladey,

I did get a response!

 

Marta N (Klaviyo Support)

May 14, 2024, 9:41 AM EDT

Hi Kevin,
 
Thanks for contacting Klaviyo, I hope you are well!
 
You are getting that error (A profile already exists with one of these identifiers) because there is already a profile with that phone number (but different email address
 
This is an expected behaviour for the V3 endpoints: 
 
  • The V3 API is intended to better check for duplicated identifiers for the profiles and this primarily will look for the same unique identifier.
  • The only way to successfully update this profile with the phone number already existing for another profile is to first clear (or change) the phone number from the other profile before making the call.
  • This is very well intended to avoid duplicated profiles with the same unique identifier.

 

Hope that helps!

 

Cheers,

Kevin.

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

5 replies

KeviSunshine
Expert Problem Solver III
Forum|alt.badge.img+8
  • Author
  • Expert Problem Solver III
  • 158 replies
  • May 13, 2024

I am going to ask support about this because we’re continually seeing 409 errors on the upsert endpoint.

By the way, the only identifiers we’re passing are phone_number and email; we’re not passing an ID.


  • Contributor I
  • 1 reply
  • May 29, 2024

Hey KeviSunshine,

Did you get any further information on this from support?

I’m also seeing occasional 409 errors under the same conditions.


KeviSunshine
Expert Problem Solver III
Forum|alt.badge.img+8
  • Author
  • Expert Problem Solver III
  • 158 replies
  • Answer
  • May 29, 2024

Hi @bladey,

I did get a response!

 

Marta N (Klaviyo Support)

May 14, 2024, 9:41 AM EDT

Hi Kevin,
 
Thanks for contacting Klaviyo, I hope you are well!
 
You are getting that error (A profile already exists with one of these identifiers) because there is already a profile with that phone number (but different email address
 
This is an expected behaviour for the V3 endpoints: 
 
  • The V3 API is intended to better check for duplicated identifiers for the profiles and this primarily will look for the same unique identifier.
  • The only way to successfully update this profile with the phone number already existing for another profile is to first clear (or change) the phone number from the other profile before making the call.
  • This is very well intended to avoid duplicated profiles with the same unique identifier.

 

Hope that helps!

 

Cheers,

Kevin.


Forum|alt.badge.img+1
  • Contributor I
  • 5 replies
  • February 5, 2025

Hi ​@KeviSunshine , did you manage to resolve this issue?

I noticed that we were getting 409 issues when we try to upsert profiles due to an issue with Klaviyo JS creating duplicate accounts. I’ve explained it in the post I’ve linked below and I’m curious to see if maybe you were experiencing the same issue I was and if you were able to resolve it ? 

 


KeviSunshine
Expert Problem Solver III
Forum|alt.badge.img+8
  • Author
  • Expert Problem Solver III
  • 158 replies
  • February 5, 2025

Hi ​@Joely,

The answer here is quite straightforward–with Klaviyo’s new APIs (v3), if you try to create a profile with an email and a phone number, but only one of those identifiers already exist on a profile, it will throw a 409.

So if I have a profile in Klaviyo with phone number 555-555-5555 and the email testing@example.com, and I try to upsert/create a profile with phone number 555-555-5555 and testing123@example.com, it will throw a 409 and not create a profile.

(When doing an upsert in this situation, the older version of the APIs would update the profile and change the email.)

 

Best,

Kevin,