Skip to main content
Solved

Bulk Create Events fails to update profile properties if the only updates are setting values to 0

  • March 31, 2025
  • 1 reply
  • 59 views

Forum|alt.badge.img
  • Contributor I

I am using the event-bulk-create-jobs API endpoint to create events that also update profile properties.  I have found when using this endpoint that if all the properties that I’m trying to update are being set to 0, then the updates do not actually get applied to the profiles.

 

Here is an example:

{
"data": {
"type": "event-bulk-create-job",
"attributes": {
"events-bulk-create": {
"data": [{
"type": "event-bulk-create",
"attributes": {
"profile": {
"data": {
"type": "profile",
"attributes": {
"email": "notmyrealemail@gmail.com",
"properties": {"custom property": 0}
}
}
},
"events": {
"data": [{
"type": "event",
"attributes": {
"metric": {
"data": {
"type": "metric",
"attributes": {
"name": "info_update"
}
}
},
"time": "2025-03-31T17:07:29+0000",
"properties": {}
}
}]
}
}
}]
}
}
}
}

If I post that data to event-bulk-create-jobs, the “custom property” will not get set on the profile.  However, if I use 1 instead of 0 as the value to set it to, or if I include any other attributes or properties being set to nonzero values, then the update gets applied correctly.

 

This problem only occurs with the event-bulk-create-jobs endpoint.  If I use the profile-bulk-import-jobs endpoint, the profile properties get correctly updated even if all the updates involve setting values to 0.

Best answer by ross_hopkins

Hi a22,

Thanks for asking the Community!

I was interested in testing the /api/events/ endpoint to see if that too behaved in the way you’re seeing, and it does.

If creating the profile property and event in the same call is a requirement (as opposed to implementing two calls with the different endpoints), then I would suggest one of the following:

  • Placing the 0 in quotations - “0” - I just tested this and it works. Depending on where you’ll use this property elsewhere in Klaviyo would dictate if this is a solution that works
  • Implement a replacement of 0, such as null or “not set”. Again, depending on your use-case, you’ll know if this is workable

Does that help at all? If you share some context about the source of the 0 and how the data point will be used in Klaviyo, I might be able to help more.

Thanks,

Ross

1 reply

ross_hopkins
Expert Problem Solver II
Forum|alt.badge.img+14
  • 2025 Champion
  • Answer
  • April 2, 2025

Hi a22,

Thanks for asking the Community!

I was interested in testing the /api/events/ endpoint to see if that too behaved in the way you’re seeing, and it does.

If creating the profile property and event in the same call is a requirement (as opposed to implementing two calls with the different endpoints), then I would suggest one of the following:

  • Placing the 0 in quotations - “0” - I just tested this and it works. Depending on where you’ll use this property elsewhere in Klaviyo would dictate if this is a solution that works
  • Implement a replacement of 0, such as null or “not set”. Again, depending on your use-case, you’ll know if this is workable

Does that help at all? If you share some context about the source of the 0 and how the data point will be used in Klaviyo, I might be able to help more.

Thanks,

Ross