I’ve been trying to set up some custom integrations via Klaviyo’s REST API and I seem to have reached a wall. I’m trying to create new Profiles based on data from our back-end. I’ve come across two difficulties:
I seem to be unable to POST a new profile. Whenever I try via the server responds with “Method "POST" not allowed.” Then, whenever I try to create a new Profile via a PUT request it says “'The requested resource does not exist.' Is it possible to create a new Profile and not just modify an existing one?
If the above is possible, are you able to create a new Profile without assigning an ID an let Klaviyo generate one for you?
Any help would be greatly appreciated, thanks!
Best answer by remstone
Hey @jnazemi! You could do this in a couple ways but it really depends on how you’re creating the profile.
The profiles API needs a person ID to work, use the ‘identify’ API with the properties you want and that will create a profile. If you need to get the person ID you can use the call below. Its not part of the API docs but I was given this by their solutions architect.
While I am using the identity (https://apidocs.klaviyo.com/reference/track-identify#identify) to create the profile, I got the response message “1” , according the documentation it means ‘Success’ , but still I can’t see the new profile in profile page.
Beside this method, is there another way to create profile with Rest API?
The response you are receiving of “1" would indicate that the call was successfully processed. If you are not seeing this profile in your Profile’s tab of your Klaviyo account, I would recommend double checking to ensure that you are using a public API key of your Klaviyo account as opposed to the private API key for these calls.
Using a private API key would respond with a “1” but actually not processing anything offering a false positive.
You can also find more resources on utilizing Klaviyo’s Identify and Track API from the Track and Identify API Reference article.