Skip to main content
Contributor I
Feb 28, 2023 6:26 AM UTC
Solved

Creating multiple events in one API call

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

    This topic has been closed for replies.
    Answer
    Feb 28, 2023 8:04 AM UTC

    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!

    3 replies

    Answer
    Feb 28, 2023 8:04 AM UTC

    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!

    Contributor I
    Mar 1, 2023 10:43 PM UTC

    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?

    Mar 2, 2023 8:18 AM UTC

    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 } ].