Batch Events
POST https://api.oursprivacy.com/api/v1/batch is the public batch companion to POST /track.
Use POST /track when you are sending one event at a time. Use POST /batch when you need fewer network round-trips for server-side backfills, replays, or high-volume event sends.
Availability posture: /batch is designed mainly for replay, backfill, and other higher-volume sends, so it may have different operational characteristics than single-event POST /track.
When you send a batch, review the response results array row by row.
200means every row was accepted, andresultswill contain one successful entry per input row.207means some rows succeeded and some did not. Retry only the rows whereresults[index].successisfalse, after fixing validation issues or isolating the rows that hit queue transport errors.400,401,413, and415are request-level failures. No rows were accepted, so fix the request and resend it.500means the request hit a transient failure before any row was confirmed accepted, or every accepted row failed queue transport. Ifresultsis present, retry only those failed rows using the samedistinctIdvalues. Ifresultsis absent, retry the full request with the samedistinctIdvalues.
Request Body
application/json
A token plus an array of /track-compatible events.
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.oursprivacy.com/api/v1/batch" \ -H "Content-Type: application/json" \ -d '{ "token": "string", "events": [ { "event": "string", "distinctId": "string" } ] }'{
"success": true,
"accepted": 0,
"failed": 0,
"results": [
{
"index": 0,
"success": true
}
]
}{
"success": true,
"accepted": 0,
"failed": 0,
"results": [
{
"index": 0,
"success": true
}
]
}{
"success": false,
"error": "string"
}{
"success": false,
"error": "string"
}{
"success": false,
"error": "string",
"limit": 0
}{
"success": false,
"error": "string"
}{
"success": false,
"error": "string",
"retryable": true,
"results": [
{
"index": 0,
"success": false,
"code": "invalid_event",
"message": "string"
}
]
}How is this guide?

