I cannot find any documentation or even pages with an example of how to use the create_event API endpoint. While the API lists the format of the attributes, I still cannot figure out how to correctly send the profile information.
https://developers.klaviyo.com/en/reference/create_event
I’m trying to trigger an event for an existing profile for which I have the ID. When I do this using the create_event endpoint on the API, I see the Metric Activity Feed with data for the new events I create, but they are not really associated to the actual profile I want to.
Let’s say I have a profile id “01GFPQR35A6CBGJD1FY4EH43MA”. I can see that ID on the URL for Profiles on Klaviyo, and also returned as the id field by the API on other calls, so that is actually correct.
When I do a request like this:
curl --request POST \
--url https://a.klaviyo.com/api/events/ \
--header 'Authorization: Klaviyo-API-Key XXXXXXXXXXXXXXXXXXXXX' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'revision: 2022-10-17' \
--data '
{
"data": {
"type": "event",
"attributes": {
"profile": {
"$id": "01GFPQR35A6CBGJD1FY4EH43MA"
},
"metric": {
"name": "gift-card-confirmed",
"service": "the-service"
},
"properties": {
"one": "AAA",
"two": "BBB"
},
"time": "2022-11-04",
"value": 5,
"unique_id": "once-again-5"
}
}
}
'
The event is indeed created for the given metric, but it's not really associated to that profile. Apparently it creates a new profile with a new ID. I can see that on this page, see that the ID on the URL is for a different profile and what I send as a profile ID is used as a handle.

I’m probably doing something wrong, but cannot figure out what it is.