Batch Track Events
curl --request POST \
--url https://pub-api.conversion.ai/api/v2/events/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"events": [
{
"email": "jane@example.com",
"event": "log_in",
"data": {
"device": "mobile",
"location": "US"
},
"timestamp": "2026-03-31T14:30:00Z"
},
{
"userId": "user_12345",
"event": "plan_upgraded",
"data": {
"plan": "pro"
},
"timestamp": "2026-03-31T14:30:00Z"
}
]
}
'import requests
url = "https://pub-api.conversion.ai/api/v2/events/batch"
payload = { "events": [
{
"email": "jane@example.com",
"event": "log_in",
"data": {
"device": "mobile",
"location": "US"
},
"timestamp": "2026-03-31T14:30:00Z"
},
{
"userId": "user_12345",
"event": "plan_upgraded",
"data": { "plan": "pro" },
"timestamp": "2026-03-31T14:30:00Z"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
email: 'jane@example.com',
event: 'log_in',
data: {device: 'mobile', location: 'US'},
timestamp: '2026-03-31T14:30:00Z'
},
{
userId: 'user_12345',
event: 'plan_upgraded',
data: {plan: 'pro'},
timestamp: '2026-03-31T14:30:00Z'
}
]
})
};
fetch('https://pub-api.conversion.ai/api/v2/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://pub-api.conversion.ai/api/v2/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' => [
[
'email' => 'jane@example.com',
'event' => 'log_in',
'data' => [
'device' => 'mobile',
'location' => 'US'
],
'timestamp' => '2026-03-31T14:30:00Z'
],
[
'userId' => 'user_12345',
'event' => 'plan_upgraded',
'data' => [
'plan' => 'pro'
],
'timestamp' => '2026-03-31T14:30:00Z'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://pub-api.conversion.ai/api/v2/events/batch"
payload := strings.NewReader("{\n \"events\": [\n {\n \"email\": \"jane@example.com\",\n \"event\": \"log_in\",\n \"data\": {\n \"device\": \"mobile\",\n \"location\": \"US\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n },\n {\n \"userId\": \"user_12345\",\n \"event\": \"plan_upgraded\",\n \"data\": {\n \"plan\": \"pro\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://pub-api.conversion.ai/api/v2/events/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"email\": \"jane@example.com\",\n \"event\": \"log_in\",\n \"data\": {\n \"device\": \"mobile\",\n \"location\": \"US\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n },\n {\n \"userId\": \"user_12345\",\n \"event\": \"plan_upgraded\",\n \"data\": {\n \"plan\": \"pro\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pub-api.conversion.ai/api/v2/events/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"email\": \"jane@example.com\",\n \"event\": \"log_in\",\n \"data\": {\n \"device\": \"mobile\",\n \"location\": \"US\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n },\n {\n \"userId\": \"user_12345\",\n \"event\": \"plan_upgraded\",\n \"data\": {\n \"plan\": \"pro\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"processed": 2,
"tracked": 2,
"failed": 0,
"results": [
{
"success": true,
"cnvEventId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"cnvContactId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
{
"success": true,
"cnvEventId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"cnvContactId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
]
}
}Events
Batch Track Events
Record up to 200 custom events in a single request. Each event is processed independently. This endpoint does not create contacts, each contact must already exist.
The response includes summary counts and a per-event error list for any failures. Partial failures do not cause the entire request to fail.
POST
/
v2
/
events
/
batch
Batch Track Events
curl --request POST \
--url https://pub-api.conversion.ai/api/v2/events/batch \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"events": [
{
"email": "jane@example.com",
"event": "log_in",
"data": {
"device": "mobile",
"location": "US"
},
"timestamp": "2026-03-31T14:30:00Z"
},
{
"userId": "user_12345",
"event": "plan_upgraded",
"data": {
"plan": "pro"
},
"timestamp": "2026-03-31T14:30:00Z"
}
]
}
'import requests
url = "https://pub-api.conversion.ai/api/v2/events/batch"
payload = { "events": [
{
"email": "jane@example.com",
"event": "log_in",
"data": {
"device": "mobile",
"location": "US"
},
"timestamp": "2026-03-31T14:30:00Z"
},
{
"userId": "user_12345",
"event": "plan_upgraded",
"data": { "plan": "pro" },
"timestamp": "2026-03-31T14:30:00Z"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
email: 'jane@example.com',
event: 'log_in',
data: {device: 'mobile', location: 'US'},
timestamp: '2026-03-31T14:30:00Z'
},
{
userId: 'user_12345',
event: 'plan_upgraded',
data: {plan: 'pro'},
timestamp: '2026-03-31T14:30:00Z'
}
]
})
};
fetch('https://pub-api.conversion.ai/api/v2/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://pub-api.conversion.ai/api/v2/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' => [
[
'email' => 'jane@example.com',
'event' => 'log_in',
'data' => [
'device' => 'mobile',
'location' => 'US'
],
'timestamp' => '2026-03-31T14:30:00Z'
],
[
'userId' => 'user_12345',
'event' => 'plan_upgraded',
'data' => [
'plan' => 'pro'
],
'timestamp' => '2026-03-31T14:30:00Z'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://pub-api.conversion.ai/api/v2/events/batch"
payload := strings.NewReader("{\n \"events\": [\n {\n \"email\": \"jane@example.com\",\n \"event\": \"log_in\",\n \"data\": {\n \"device\": \"mobile\",\n \"location\": \"US\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n },\n {\n \"userId\": \"user_12345\",\n \"event\": \"plan_upgraded\",\n \"data\": {\n \"plan\": \"pro\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://pub-api.conversion.ai/api/v2/events/batch")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"events\": [\n {\n \"email\": \"jane@example.com\",\n \"event\": \"log_in\",\n \"data\": {\n \"device\": \"mobile\",\n \"location\": \"US\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n },\n {\n \"userId\": \"user_12345\",\n \"event\": \"plan_upgraded\",\n \"data\": {\n \"plan\": \"pro\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pub-api.conversion.ai/api/v2/events/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"events\": [\n {\n \"email\": \"jane@example.com\",\n \"event\": \"log_in\",\n \"data\": {\n \"device\": \"mobile\",\n \"location\": \"US\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n },\n {\n \"userId\": \"user_12345\",\n \"event\": \"plan_upgraded\",\n \"data\": {\n \"plan\": \"pro\"\n },\n \"timestamp\": \"2026-03-31T14:30:00Z\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"processed": 2,
"tracked": 2,
"failed": 0,
"results": [
{
"success": true,
"cnvEventId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"cnvContactId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
{
"success": true,
"cnvEventId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"cnvContactId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
]
}
}Authorizations
Your Conversion API key. Found in Settings > Integrations in the dashboard. Format: sk_live_<key_id>_<secret>.
Body
application/json
An array of event objects to track.
Required array length:
1 - 200 elementsShow child attributes
Show child attributes
Response
Batch processed. Check errors for individual failures.
Show child attributes
Show child attributes
Was this page helpful?
⌘I