Skip to main content
POST
/
events
/
batch
Create a batch of events (deprecated)
curl --request POST \
  --url https://api.honeyhive.ai/events/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "events": [
    {
      "project": "<string>",
      "project_id": "<string>",
      "source": "<string>",
      "event_name": "<string>",
      "event_id": "<string>",
      "session_id": "<string>",
      "parent_id": "<string>",
      "children_ids": [
        "<string>"
      ],
      "config": {},
      "inputs": {},
      "outputs": {},
      "error": "<string>",
      "start_time": 123,
      "end_time": 123,
      "duration": 123,
      "metadata": {},
      "feedback": {},
      "metrics": {},
      "user_properties": {}
    }
  ],
  "single_session": true,
  "is_single_session": true,
  "session": {
    "session_name": "<string>",
    "start_time": 123,
    "user_properties": {},
    "metadata": {}
  },
  "session_properties": {
    "session_name": "<string>",
    "start_time": 123,
    "user_properties": {},
    "metadata": {}
  }
}
'
import requests

url = "https://api.honeyhive.ai/events/batch"

payload = {
"events": [
{
"project": "<string>",
"project_id": "<string>",
"source": "<string>",
"event_name": "<string>",
"event_id": "<string>",
"session_id": "<string>",
"parent_id": "<string>",
"children_ids": ["<string>"],
"config": {},
"inputs": {},
"outputs": {},
"error": "<string>",
"start_time": 123,
"end_time": 123,
"duration": 123,
"metadata": {},
"feedback": {},
"metrics": {},
"user_properties": {}
}
],
"single_session": True,
"is_single_session": True,
"session": {
"session_name": "<string>",
"start_time": 123,
"user_properties": {},
"metadata": {}
},
"session_properties": {
"session_name": "<string>",
"start_time": 123,
"user_properties": {},
"metadata": {}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
project: '<string>',
project_id: '<string>',
source: '<string>',
event_name: '<string>',
event_id: '<string>',
session_id: '<string>',
parent_id: '<string>',
children_ids: ['<string>'],
config: {},
inputs: {},
outputs: {},
error: '<string>',
start_time: 123,
end_time: 123,
duration: 123,
metadata: {},
feedback: {},
metrics: {},
user_properties: {}
}
],
single_session: true,
is_single_session: true,
session: {session_name: '<string>', start_time: 123, user_properties: {}, metadata: {}},
session_properties: {session_name: '<string>', start_time: 123, user_properties: {}, metadata: {}}
})
};

fetch('https://api.honeyhive.ai/events/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.honeyhive.ai/events/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([
'events' => [
[
'project' => '<string>',
'project_id' => '<string>',
'source' => '<string>',
'event_name' => '<string>',
'event_id' => '<string>',
'session_id' => '<string>',
'parent_id' => '<string>',
'children_ids' => [
'<string>'
],
'config' => [

],
'inputs' => [

],
'outputs' => [

],
'error' => '<string>',
'start_time' => 123,
'end_time' => 123,
'duration' => 123,
'metadata' => [

],
'feedback' => [

],
'metrics' => [

],
'user_properties' => [

]
]
],
'single_session' => true,
'is_single_session' => true,
'session' => [
'session_name' => '<string>',
'start_time' => 123,
'user_properties' => [

],
'metadata' => [

]
],
'session_properties' => [
'session_name' => '<string>',
'start_time' => 123,
'user_properties' => [

],
'metadata' => [

]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$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.honeyhive.ai/events/batch"

payload := strings.NewReader("{\n \"events\": [\n {\n \"project\": \"<string>\",\n \"project_id\": \"<string>\",\n \"source\": \"<string>\",\n \"event_name\": \"<string>\",\n \"event_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"children_ids\": [\n \"<string>\"\n ],\n \"config\": {},\n \"inputs\": {},\n \"outputs\": {},\n \"error\": \"<string>\",\n \"start_time\": 123,\n \"end_time\": 123,\n \"duration\": 123,\n \"metadata\": {},\n \"feedback\": {},\n \"metrics\": {},\n \"user_properties\": {}\n }\n ],\n \"single_session\": true,\n \"is_single_session\": true,\n \"session\": {\n \"session_name\": \"<string>\",\n \"start_time\": 123,\n \"user_properties\": {},\n \"metadata\": {}\n },\n \"session_properties\": {\n \"session_name\": \"<string>\",\n \"start_time\": 123,\n \"user_properties\": {},\n \"metadata\": {}\n }\n}")

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

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

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.honeyhive.ai/events/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"project\": \"<string>\",\n \"project_id\": \"<string>\",\n \"source\": \"<string>\",\n \"event_name\": \"<string>\",\n \"event_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"children_ids\": [\n \"<string>\"\n ],\n \"config\": {},\n \"inputs\": {},\n \"outputs\": {},\n \"error\": \"<string>\",\n \"start_time\": 123,\n \"end_time\": 123,\n \"duration\": 123,\n \"metadata\": {},\n \"feedback\": {},\n \"metrics\": {},\n \"user_properties\": {}\n }\n ],\n \"single_session\": true,\n \"is_single_session\": true,\n \"session\": {\n \"session_name\": \"<string>\",\n \"start_time\": 123,\n \"user_properties\": {},\n \"metadata\": {}\n },\n \"session_properties\": {\n \"session_name\": \"<string>\",\n \"start_time\": 123,\n \"user_properties\": {},\n \"metadata\": {}\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.honeyhive.ai/events/batch")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"project\": \"<string>\",\n \"project_id\": \"<string>\",\n \"source\": \"<string>\",\n \"event_name\": \"<string>\",\n \"event_id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"children_ids\": [\n \"<string>\"\n ],\n \"config\": {},\n \"inputs\": {},\n \"outputs\": {},\n \"error\": \"<string>\",\n \"start_time\": 123,\n \"end_time\": 123,\n \"duration\": 123,\n \"metadata\": {},\n \"feedback\": {},\n \"metrics\": {},\n \"user_properties\": {}\n }\n ],\n \"single_session\": true,\n \"is_single_session\": true,\n \"session\": {\n \"session_name\": \"<string>\",\n \"start_time\": 123,\n \"user_properties\": {},\n \"metadata\": {}\n },\n \"session_properties\": {\n \"session_name\": \"<string>\",\n \"start_time\": 123,\n \"user_properties\": {},\n \"metadata\": {}\n }\n}"

response = http.request(request)
puts response.read_body
{
  "event_ids": [
    "7f22137a-6911-4ed3-bc36-110f1dde6b66",
    "7f22137a-6911-4ed3-bc36-110f1dde6b67"
  ],
  "session_id": "caf77ace-3417-4da4-944d-f4a0688f3c23",
  "success": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for POST /events/batch (deprecated — use POST /v1/events/batch)

events
object[]
required

Array of events to create

single_session
boolean

If true, all events share the same session

is_single_session
boolean
deprecated

Legacy field name for single_session (backward compatibility)

session
object
deprecated

Alias for session_properties (backward compatibility)

session_properties
object

Session properties for batch event creation

Response

Events created

Response for POST /events/batch

event_ids
string[]
required
success
boolean
required
session_id
string