Skip to main content
Solved

Create and update profile via API

  • November 17, 2023
  • 4 replies
  • 225 views

federico.vitale
Problem Solver I
Forum|alt.badge.img+3

Hi! Sorry in advance for my long question.

Next February I’ll be transitioning to Klaviyo from another marketing automation tool.

My company has a custom built platform that enables our customers to purchase and manage insurance policies while logged in.

With the old tool I was able to create or update a contact with a single API, it is my understanding that Klaviyo doesn’t work this way, am I correct? The old tool basically has a single endpoint that creates a new contact if the email isn’t in the database, or updated the contact details with that email if it is.

In this case, when a new user creates an account, would I need my platform to check if it is already in Klaviyo (maybe because it subscribed to the newsletter in the past) and then decide what call to perform (create or update)? I also understand that opting the profile in would require another separate call, is this true?

Thanks for any help!

Best answer by DavidSandel

Yes, you have it all correct.

4 replies

DavidSandel
Partner - Silver
Forum|alt.badge.img+21
  • Partner - Silver
  • 157 replies
  • Answer
  • November 17, 2023

Yes, you have it all correct.


federico.vitale
Problem Solver I
Forum|alt.badge.img+3
  • Author
  • Problem Solver I
  • 12 replies
  • November 17, 2023

Thanks! I’m happy to see that I’ve managed to understand this correctly (I’m tech savvy but not an actual dev).

If I may ask: how do you handle the tracking in this case? I mean: when someone submits a form to Klaviyo the system automatically links the profile with the tracking, I guess this is not the case when you do it via API. I saw that in the POST create profile there isn’t a _kx parameter (which to my understanding is the tracking id).

Thanks!

P.S.: I’m new here, is there a form for sending feature requests?


DavidSandel
Partner - Silver
Forum|alt.badge.img+21
  • Partner - Silver
  • 157 replies
  • November 17, 2023

That’s a good question. I’ve never worried about it much because most of the contacts I add through the API are also delivered an automated email in one way or another. And as soon as they click on a link and visit the website, the tracking is automatically activated, assuming you have tracking installed.

Here’s their help doc that explains all the different types of tracking and how you can cookie your contacts:


federico.vitale
Problem Solver I
Forum|alt.badge.img+3
  • Author
  • Problem Solver I
  • 12 replies
  • November 20, 2023

Well actually yours is a far better idea! I’ll just use Klaviyo to send the welcome mail and not the platform and it should be alright (and also that kind of email is usually more likely clicked, so two birds with one stone I’d say).