Skip to main content
Contributor I
April 1, 2024
Solved

Create Event API does not work as expected since revision v2023-07-15

  • April 1, 2024
  • 12 replies
  • 591 views

Currently, I am using API revision v2023-06-15, and everything works fine for me in this revision.

However, I want to upgrade my service to use the latest stable revision (v2024-02-15), but it seems it does not work as expected.

The functionality of the APIs (Client and API) to create new events in Klaviyo within revision v2023-06-15 is particularly advantageous. In this version, a single request can achieve the following actions:

  • Create or update a profile based on External ID, Email, and/or Phone Number.
  • Create an event and link it with the respective profile.

However, it's worth noting that with the newer API revisions, despite the request returning a successful status code 202 Accepted, the event and profile are not created or updated as expected.

 

Example using revision v2023-06-15 (working):

curl --request POST \
--url https://a.klaviyo.com/api/events/ \
--header 'Accept: application/json' \
--header 'Authorization: Klaviyo-API-Key XXXXXXXXXX' \
--header 'Content-Type: application/json' \
--header 'revision: 2023-06-15' \
--data '{
"data": {
"type": "event",
"attributes": {
"metric": {
"name": "Custom Event Name"
},
"properties": {
"custom": "Custom Event Property",
"value_currency": "USD"
},
"value": 10,
"profile": {
"$email": "email@example.com",
"$id": "ExternalProfileID",
"$first_name": "John",
"$last_name": "Doe",
"any": "Custom Profile Property"
}
}
}
}'

 

Example using the latest revision v2024-02-15 (not working):

curl --request POST \
--url https://a.klaviyo.com/api/events/ \
--header 'Accept: application/json' \
--header 'Authorization: Klaviyo-API-Key XXXXXXXXXX' \
--header 'Content-Type: application/json' \
--header 'revision: 2024-02-15' \
--data '{
"data": {
"type": "event",
"attributes": {
"metric": {
"data": {
"type": "metric",
"attributes": {
"name": "Custom Event Name"
}
}
},
"properties": {
"custom": "Custom Event Property"
},
"value": 10,
"value_currency": "USD",
"profile": {
"data": {
"type": "profile",
"attributes": {
"email": "email@example.com",
"external_id": "ExternalProfileID",
"first_name": "John",
"last_name": "Doe",
"properties": {
"any": "Custom Profile Property"
}
}
}
}
}
}
}'

API documentation:

Am I doing something wrong with the new API revisions or misunderstanding about its concepts and usages?

Please help!

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

@devtek thanks for checking. Sorry again for the trouble.

100%. We’ll look into removing the email filter. In the interim, we will update our API docs to add some troubleshooting tips for events not showing up, exactly as you’re suggesting. I’ll update this post once we’ve updated the docs!

12 replies

Contributor I
July 25, 2024

Hello I am actually encountering this issue with regular emails as well. Im getting a 202 back from creating the event but when you view the profiles there’s no event for them

Contributor I
July 25, 2024

@tadpole1998 can you confirm the API-Version you’re using and provide the payload you’re sending (omitting any confidential data, but please provide the domain on any emails included, if possible)