I am new to Klaviyo and so far I have found some of the Klaviyo documentation confusing around creating and sending metrics/events.
Note: I only wish to use server-side APIs, not client-side.
According to this article on Transactional emails I can use the open API to set up a custom metric:-
“If you want to use a metric to trigger the flow that isn't synced through your ecommerce integration, you will need to create a new custom metric. Klaviyo has an open API that you can leverage to set this up. For example, a password reset email would need a corresponding "Password Reset" event, which would need to be configured as a custom metric.”
I then tried to use a request like this to create a metric/event using the server-side APi - https://developers.klaviyo.com/en/reference/create_event
I got a 202 Accepted but the custom metric never showed up in my Account and the event never showed up in the history of the profile I included as part of the request.
What I am trying to do is set up a flow for sending Password reset emails which are triggered by events. I was reading this article and reviewed the sample event included - https://developers.klaviyo.com/en/v1-2/docs/guide-to-setting-up-api-based-transactional-events#reset-password
I tried using a request like the sample
{
"token": "PUBLIC_API_KEY",
"event": "Reset Password",
"customer_properties": {
"$email": "john.smith@test.com"
},
"properties": {
"$event_id": "1234",
"PasswordResetLink": "https://www.website.com/reset/1234567890987654321"
},
"time": 1387302423
}
but got the following response:-
{
"errors":
{
"id": "e0fd89e4-1fb7-4bc8-acbb-639b36cfadcf",
"status": 400,
"code": "invalid",
"title": "Invalid input.",
"detail": "An object with data is required",
"source": {
"pointer": "/data"
},
"meta": {}
}
]
}
Can anyone kindly explain to me how I can create a custom metric/event in my Klaviyo account such that I can send password reset events as demonstrated here - https://developers.klaviyo.com/en/v1-2/docs/guide-to-setting-up-api-based-transactional-events#reset-password
The terminology is also confusing. I assumed a metric is the event type eg. “Password Reset” and the events are the actual instances of messages that use this metric to trigger a flow. The very first sentence of this Klaviyo article however states that “Events, also referred to as metrics, record…..” - are they the same, are they different, confusing for the newcomer.