Solved

Whats the correct procedure to create a profile and add to a list ID?

  • 14 September 2023
  • 4 replies
  • 270 views

Badge

Previously we were using the POST /api/v2/list/{list_id}/ subscribe endpoint which created the profile via the passed in email in Klaviyo with email: subscribed set and returned their id in the response. We were then storing this ID and if the user then wanted to add SMS we were using the PUT api/v1/person/${id}?phone_number=${phone}&api_key=${apiKey} to add their phone number.

Because the v1/v2 are now deprecated we are looking to update these endpoints. I tried using the POST /api/profile-subscription- bulk-create-jobs/ endpoint which add the email and email subscribed to Klaviyo but a status of 202 or 204 is returned with no data which I’m assuming is due to if people are doing a bulk upload? So the ID is no longer available. 

Would this now have to be done using 3 endpoints? create profile, update profile w/ email, update profile w/ phone number.

I also need to ensure that the user is set to email subscribed when being added to Klaviyo. 

 

Thanks

icon

Best answer by Brian Turcotte 5 October 2023, 20:57

View original

4 replies

Userlevel 7
Badge +36

Hi @BenC66!

 

I’m going to check on this with Engineering and I’ll update the thread ASAP!

 

Best,

Brian

Userlevel 7
Badge +36

Hi @BenC66!

My apologies for the delay here! The short answer is yes, to accomplish this, you’d first need to subscribe the profile using the email address. Then, to update the profile you would need the Profile ID, which you can retrieve by making a call to Get Profiles and filtering for a specific email. Then you’d make whatever Update Profile call you need to make from there.

 

Best,

Brian

Badge

A question about the proposed solution:

When a user subscribes they have to confirm their email address. Is it possible to use Get Profiles on a user that hasn’t confirmed their email yet?

If not, when are we supposed to update their name with Update Profile? Would we need to create a webhook to do this?

Userlevel 7
Badge +36

Hi @redwire!

Yes, if they’ve entered their email but have yet to confirm the double opt-in, the Profile is still created but just their marketing consent is not yet set, so you can still use Get Profiles.

 

Best,

Brian

Reply