Skip to main content
Solved

Creating multiple events in one API call

  • February 28, 2023
  • 3 replies
  • 361 views

Forum|alt.badge.img+3

Can someone give me a example of using the Create Event API call to create multiple events within the same call? E.g. I’m trying to work out how to create multiple “ordered Product” calls within the same API call. What does the structure of the json data need to be? https://developers.klaviyo.com/en/reference/create_event

Best answer by gregrobson

That endpoints doesn’t appear to allow multiple events. It’s just a single object, rather than an array of objects.

Would be a nice addition if Klaviyo could make that happen!

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

Forum|alt.badge.img+2
  • Problem Solver I
  • 4 replies
  • Answer
  • February 28, 2023

That endpoints doesn’t appear to allow multiple events. It’s just a single object, rather than an array of objects.

Would be a nice addition if Klaviyo could make that happen!


Forum|alt.badge.img+3
  • Author
  • Contributor I
  • 5 replies
  • March 1, 2023
gregrobson wrote:

That endpoints doesn’t appear to allow multiple events. It’s just a single object, rather than an array of objects.

Would be a nice addition if Klaviyo could make that happen!

Thanks Greg, is it the same with all endpoints? e.g. https://developers.klaviyo.com/en/reference/create_catalog_variant you have to send each varient seperately instead of being able to send them all varients for a product in one post?


Forum|alt.badge.img+2
  • Problem Solver I
  • 4 replies
  • March 2, 2023

Yes, that is the case as the API endpoints tend to follow the pattern of as data: {“type”: “name”, “attributes”: {...}} 

If they supported arrays you would see something like data: data:[ { your }, { objects } ].