Hi @QingZhu!
Thanks for using Klaviyo’s Developer Group and cheers on migrating to our new APIs! To fetch import errors for a specific bulk profile import job, you can call Get Bulk Profile Import Job Errors. The error message will contain a pointer containing a reference to the invalid email. Same goes for Bulk Create Events, that is, you will receive a 400 error with a pointer to the invalid email. I hope this answers your question!
Related resources:
Bulk Profile Import API
Bulk Create Events
Hi @carleygilmore
Thank you for the info! I will test my code today and intentionally add some invalid emails to see how I can get the info.
One more thing I want to mention is the example in bulk event API page is not correct. The payload in the example is a direct copy from that of the example in bulk profile API page. Would you please notify the relative part to review it?
Thank you!
Awesome! Do you mind sending me these specific examples? I’m not sure if I’m seeing exactly what examples you’re referring to. Thanks so much for letting us know, as it’s important to us that our docs are correct and as helpful as possible.
Best,
Carley
Yes, it is quoted on this page: https://developers.klaviyo.com/en/reference/bulk_create_events
Technically I am not 100% correct. The example’s “type” is correctly showing as “evetn-bulk-create”. But there are only “profile” in “attributes”, no “event”.
curl --request POST \
--url https://a.klaviyo.com/api/event-bulk-create-jobs/ \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'revision: 2024-05-15' \
--data '
{
"data": {
"type": "event-bulk-create-job",
"attributes": {
"events-bulk-create": {
"data": [
{
"type": "event-bulk-create",
"attributes": {
"profile": {
"data": {
"type": "profile",
"attributes": {
"email": "sarah.mason@klaviyo-demo.com",
"phone_number": "+15005550006",
"first_name": "Sarah",
"last_name": "Mason",
"organization": "Example Corporation",
"title": "Regional Manager",
"image": "https://images.pexels.com/photos/3760854/pexels-photo-3760854.jpeg",
"location": {
"address1": "89 E 42nd St",
"address2": "1st floor",
"city": "New York",
"country": "United States",
"latitude": "40.7128",
"longitude": "74.0060",
"region": "NY",
"zip": "10017",
"timezone": "America/New_York",
"ip": "127.0.0.1"
}
},
"meta": {
"patch_properties": {
"unset": "skus"
}
}
}
}
}
}
]
}
}
}
}
'
Hi @carleygilmore,
Sorry about the wrong info. I worked on sending bulk events data to Klaviyo (in sandbox). I have to carefully exam the info at https://developers.klaviyo.com/en/reference/bulk_create_events. And I took another look at the example and found the section containing events. Sorry I did not look careful enough to find that part and reported to you of the, what I think, wrong example. Please ignore my previous complaint about the bulk event API example problem.
Thank you!