Record a batch of events
Deliver gzip-compressed events with item-level acceptance results.
https://i.nuxie.ai/batchSend up to 1,000 events in one request. Compress the JSON body with gzip; uncompressed JSON is rejected. The compressed body must be at most 16 MiB.
Headers
Content-EncodingheaderstringrequiredMust be gzip. Set Content-Type: application/json as well.
Request body
apiKeybodystringrequiredPublishable key for the app platform. A pk_test_ key selects test data; a pk_live_ key selects live data. Copy it from Connect your app.
batchbodyobject[]requiredBetween 1 and 1,000 events. Each item uses the fields from Record an event; the top-level apiKey authenticates every item.
historical_migrationbodybooleanSet to true to sort historical events by timestamp before queueing. Leave unset for normal app traffic.
Response
statusstringrequiredsuccess, partial, or error.
acceptedintegerrequiredNumber of events accepted into the queue.
processedintegerrequiredAlias of accepted; does not mean analytics have finished updating.
failedintegerrequiredNumber of failed items.
totalintegerrequiredNumber of submitted items.
queuedbooleanrequiredWhether the response reports events queued for processing.
validationFailedintegerrequiredItems with invalid fields.
rejectedFailedintegerrequiredItems that require another endpoint or cannot enter the queue.
enqueueFailedintegerItems that could not be queued, when a queue failure occurs.
eventIdsstring[]IDs of accepted events. Omitted when no events were accepted.
errorsobject[]Failed item details, when present. Each includes index, event, and error, with lane and endpoint when relevant.
A partial result does not roll back accepted events. Check the body even when the HTTP status is 200: a batch containing only invalid events can return status: "error" with accepted: 0.
Correct invalid items before resubmitting. Retry transient failures with their original event UUIDs. If the whole request’s outcome is unknown, you can retry the batch with the same UUIDs so accepted events are deduplicated.