Skip to main content
POST
/
v1
/
batch
Batch
curl --request POST \
  --url https://api-events.zixflow.com/v1/batch \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "batch": [
    {}
  ],
  "sentAt": "<string>"
}
'
import requests

url = "https://api-events.zixflow.com/v1/batch"

payload = {
"batch": [{}],
"sentAt": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({batch: [{}], sentAt: '<string>'})
};

fetch('https://api-events.zixflow.com/v1/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api-events.zixflow.com/v1/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'batch' => [
[

]
],
'sentAt' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api-events.zixflow.com/v1/batch"

payload := strings.NewReader("{\n \"batch\": [\n {}\n ],\n \"sentAt\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-events.zixflow.com/v1/batch")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"batch\": [\n {}\n ],\n \"sentAt\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api-events.zixflow.com/v1/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"batch\": [\n {}\n ],\n \"sentAt\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{}
{
  "error": "VALIDATION_FAILED",
  "details": [
    {
      "reason": "REQUIRED",
      "field": "batch",
      "message": "batch is required"
    }
  ]
}
{
  "error": "UNAUTHORIZED",
  "details": []
}

Description

Send multiple events in a single HTTP request. SDKs queue events locally and flush them as a batch. Prefer /batch over individual calls when sending many events from a server. Short alias: POST /v1/b Limits:
  • Minimum: 1 item per batch
  • Maximum: 100 items per batch
  • Items are processed concurrently
Group and Alias are not supported. Do not include type: "group" or type: "alias" in the batch.

Headers

Authorization
string
required
HTTP Basic Auth. See Events Authentication.
Content-Type
string
default:"application/json"
required
Must be application/json.

Body

batch
array
required
Array of event objects. Each item must include a type field and the fields for that event type.
sentAt
string
When the batch was sent, as ISO 8601.

Batch item type values

TypeEquivalent endpointNotes
identify/v1/identifyUses traits
track/v1/trackUses event + properties
screen/v1/screenUses name + properties
page/v1/pageUses name + properties
Each batch item shares the same fields as its corresponding individual endpoint, plus a type field. Each item may also include an optional context object.

Response

Successful requests return HTTP 200 with an empty JSON object.
{}
{
  "error": "VALIDATION_FAILED",
  "details": [
    {
      "reason": "REQUIRED",
      "field": "batch",
      "message": "batch is required"
    }
  ]
}
{
  "error": "UNAUTHORIZED",
  "details": []
}

Example request body

{
  "batch": [
    {
      "type": "identify",
      "userId": "user_12345",
      "traits": { "plan": "enterprise" }
    },
    {
      "type": "track",
      "userId": "user_12345",
      "event": "Plan Upgraded",
      "properties": { "from_plan": "pro", "to_plan": "enterprise" }
    },
    {
      "type": "screen",
      "userId": "user_12345",
      "name": "Home"
    }
  ],
  "sentAt": "2026-05-04T10:00:30.000Z"
}