Skip to main content
Problem Solver I
September 29, 2023
Solved

Subscribe Profile and add custom properties using latest Klaviyo API

  • September 29, 2023
  • 18 replies
  • 2165 views

Using this endpoint:

https://developers.klaviyo.com/en/reference/subscribe_profiles

 

Is it possible to subscribe a profile to a list and also add custom properties to that profile in one request? This was possible with the previous API version but now I’m not sure.

 

My request works without adding custom properties, but when I tried adding ‘newKey’ => ‘value’ to the Profile’s object and I got this error:

newKey' is not a valid field for the resource 'profile' 

 

Thank you

    This topic has been closed for replies.
    Best answer by Kim Strauch

    Hi @acavdev and @dmiradakis,
    @zmyers’ workflow is the recommended workflow. 
     

    I stumbled upon this thread when trying to see how to add custom profiles properties when subscribing. Its not as great as the single post to create a profile and add to a list as before but with the new api you should be able to create/update a profile using 

    https://developers.klaviyo.com/en/reference/create_or_update_profile

    This will return the profile object after created and then you can subscribe using the profile id in the new endpoint 

    https://developers.klaviyo.com/en/reference/subscribe_profiles

    I included both the email and the id when subscribing and it seems to work.

     

     

    Apologize for the delay and any confusion here. Also, we recognize that this may not be the most convenient workflow. Our team is considering ways to make this common use case easier going forward.

    That’s a great callout that we can improve the Subscribe Profiles API documentation to clarify how to achieve this use case. We appreciate your feedback!

    18 replies

    Brian Turcotte
    Klaviyo Alum
    October 2, 2023

    Hi @acavdev!

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

    Best,

    Brian

    acavdevAuthor
    Problem Solver I
    October 4, 2023

    Thank you!

    acavdevAuthor
    Problem Solver I
    October 11, 2023

    Hi Brian,

     

    Did the engineering team have any feedback on this one? Thank you!

    Contributor I
    October 16, 2023

    Hey Brian, any update on this?

    We’re moving to the new API and facing this same issue of not being able to set custom properties in the same request.

    Brian Turcotte
    Klaviyo Alum
    October 19, 2023

    Hi @adil.naqvi!

    My sincere apologies for the delay here! It’s true that you can no longer add custom properties to a profile using this endpoint, which is intended only to identify and subscribe the profile to a list. 

     

    Instead, you would have to make two calls, one to subscribe and one to update the profile with the custom properties using the Update Profile endpoint.

     

    Best,

    Brian

     

    acavdevAuthor
    Problem Solver I
    October 31, 2023

    Hi Brian,

     

    Thank you. Is it possible after sending the first request to subscribe to get the Primary key/ID of the user as response from that request?

     

    Thank you

    Contributor I
    November 6, 2023

    Hi @adil.naqvi!

    My sincere apologies for the delay here! It’s true that you can no longer add custom properties to a profile using this endpoint, which is intended only to identify and subscribe the profile to a list. 

     

    Instead, you would have to make two calls, one to subscribe and one to update the profile with the custom properties using the Update Profile endpoint.

     

    Best,

    Brian

     

    Has anyone been able to get this to work?  I have tried to add properties but they dont appear or update.  I have tried using the meta object but the values appear in [] brackets as if the value is an array element - seems like the API mis-interprets the json structure - even though I followed the documentation 

    acavdevAuthor
    Problem Solver I
    December 15, 2023

    Is it possible after sending the Subscribe request , to then get the User ID of the user as response from that request?

    In order to subscribe and then update I assume I would need to have the subscribed users ID

    Thanks!

    acavdevAuthor
    Problem Solver I
    December 29, 2023

    @ur.co.uk I have not been able to get this to work still. If anyone has figured it out , please let me know!

    Contributor I
    March 27, 2024

    Can someone explain why this is so complex? I’m stuck using your identify endpoint because the new update documentaiton is terrible.