Bulk
Create Leads in Bulk
Create up to 100 leads in one request with POST /api/leads/bulk. Each item is handled like POST /api/leads and gets its own result.
POST
/
api
/
leads
/
bulk
Create Leads in Bulk
curl --request POST \
--url https://octanist.com/api/leads/bulk \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"leads": [
{
"externalId": "QUOTE-2026-0042",
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"custom": "<string>",
"note": "<string>",
"value": 2500,
"labelId": "label_xyz",
"sessionId": "550e8400-e29b-41d4-a716-446655440000",
"website": "https://example.com",
"path": "/contact",
"gclid": "<string>",
"dclid": "<string>",
"wbraid": "<string>",
"gbraid": "<string>",
"fbc": "<string>",
"fbp": "<string>",
"ga4cid": "<string>",
"ga4sid": "<string>",
"li_fat_id": "<string>",
"msclkid": "<string>",
"ttclid": "<string>",
"twclid": "<string>",
"rdt_cid": "<string>",
"sccid": "<string>",
"epik": "<string>",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "<string>",
"ad_storage": false,
"ad_user_data": false,
"ad_personalization": false,
"analytics_storage": false
}
]
}
'import requests
url = "https://octanist.com/api/leads/bulk"
payload = { "leads": [
{
"externalId": "QUOTE-2026-0042",
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"custom": "<string>",
"note": "<string>",
"value": 2500,
"labelId": "label_xyz",
"sessionId": "550e8400-e29b-41d4-a716-446655440000",
"website": "https://example.com",
"path": "/contact",
"gclid": "<string>",
"dclid": "<string>",
"wbraid": "<string>",
"gbraid": "<string>",
"fbc": "<string>",
"fbp": "<string>",
"ga4cid": "<string>",
"ga4sid": "<string>",
"li_fat_id": "<string>",
"msclkid": "<string>",
"ttclid": "<string>",
"twclid": "<string>",
"rdt_cid": "<string>",
"sccid": "<string>",
"epik": "<string>",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "<string>",
"ad_storage": False,
"ad_user_data": False,
"ad_personalization": False,
"analytics_storage": False
}
] }
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({
leads: [
{
externalId: 'QUOTE-2026-0042',
name: 'John Doe',
email: 'john@example.com',
phone: '+1234567890',
custom: '<string>',
note: '<string>',
value: 2500,
labelId: 'label_xyz',
sessionId: '550e8400-e29b-41d4-a716-446655440000',
website: 'https://example.com',
path: '/contact',
gclid: '<string>',
dclid: '<string>',
wbraid: '<string>',
gbraid: '<string>',
fbc: '<string>',
fbp: '<string>',
ga4cid: '<string>',
ga4sid: '<string>',
li_fat_id: '<string>',
msclkid: '<string>',
ttclid: '<string>',
twclid: '<string>',
rdt_cid: '<string>',
sccid: '<string>',
epik: '<string>',
utm_source: 'google',
utm_medium: 'cpc',
utm_campaign: '<string>',
ad_storage: false,
ad_user_data: false,
ad_personalization: false,
analytics_storage: false
}
]
})
};
fetch('https://octanist.com/api/leads/bulk', 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://octanist.com/api/leads/bulk",
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([
'leads' => [
[
'externalId' => 'QUOTE-2026-0042',
'name' => 'John Doe',
'email' => 'john@example.com',
'phone' => '+1234567890',
'custom' => '<string>',
'note' => '<string>',
'value' => 2500,
'labelId' => 'label_xyz',
'sessionId' => '550e8400-e29b-41d4-a716-446655440000',
'website' => 'https://example.com',
'path' => '/contact',
'gclid' => '<string>',
'dclid' => '<string>',
'wbraid' => '<string>',
'gbraid' => '<string>',
'fbc' => '<string>',
'fbp' => '<string>',
'ga4cid' => '<string>',
'ga4sid' => '<string>',
'li_fat_id' => '<string>',
'msclkid' => '<string>',
'ttclid' => '<string>',
'twclid' => '<string>',
'rdt_cid' => '<string>',
'sccid' => '<string>',
'epik' => '<string>',
'utm_source' => 'google',
'utm_medium' => 'cpc',
'utm_campaign' => '<string>',
'ad_storage' => false,
'ad_user_data' => false,
'ad_personalization' => false,
'analytics_storage' => false
]
]
]),
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://octanist.com/api/leads/bulk"
payload := strings.NewReader("{\n \"leads\": [\n {\n \"externalId\": \"QUOTE-2026-0042\",\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"custom\": \"<string>\",\n \"note\": \"<string>\",\n \"value\": 2500,\n \"labelId\": \"label_xyz\",\n \"sessionId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"website\": \"https://example.com\",\n \"path\": \"/contact\",\n \"gclid\": \"<string>\",\n \"dclid\": \"<string>\",\n \"wbraid\": \"<string>\",\n \"gbraid\": \"<string>\",\n \"fbc\": \"<string>\",\n \"fbp\": \"<string>\",\n \"ga4cid\": \"<string>\",\n \"ga4sid\": \"<string>\",\n \"li_fat_id\": \"<string>\",\n \"msclkid\": \"<string>\",\n \"ttclid\": \"<string>\",\n \"twclid\": \"<string>\",\n \"rdt_cid\": \"<string>\",\n \"sccid\": \"<string>\",\n \"epik\": \"<string>\",\n \"utm_source\": \"google\",\n \"utm_medium\": \"cpc\",\n \"utm_campaign\": \"<string>\",\n \"ad_storage\": false,\n \"ad_user_data\": false,\n \"ad_personalization\": false,\n \"analytics_storage\": false\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://octanist.com/api/leads/bulk")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"leads\": [\n {\n \"externalId\": \"QUOTE-2026-0042\",\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"custom\": \"<string>\",\n \"note\": \"<string>\",\n \"value\": 2500,\n \"labelId\": \"label_xyz\",\n \"sessionId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"website\": \"https://example.com\",\n \"path\": \"/contact\",\n \"gclid\": \"<string>\",\n \"dclid\": \"<string>\",\n \"wbraid\": \"<string>\",\n \"gbraid\": \"<string>\",\n \"fbc\": \"<string>\",\n \"fbp\": \"<string>\",\n \"ga4cid\": \"<string>\",\n \"ga4sid\": \"<string>\",\n \"li_fat_id\": \"<string>\",\n \"msclkid\": \"<string>\",\n \"ttclid\": \"<string>\",\n \"twclid\": \"<string>\",\n \"rdt_cid\": \"<string>\",\n \"sccid\": \"<string>\",\n \"epik\": \"<string>\",\n \"utm_source\": \"google\",\n \"utm_medium\": \"cpc\",\n \"utm_campaign\": \"<string>\",\n \"ad_storage\": false,\n \"ad_user_data\": false,\n \"ad_personalization\": false,\n \"analytics_storage\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octanist.com/api/leads/bulk")
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 \"leads\": [\n {\n \"externalId\": \"QUOTE-2026-0042\",\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"custom\": \"<string>\",\n \"note\": \"<string>\",\n \"value\": 2500,\n \"labelId\": \"label_xyz\",\n \"sessionId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"website\": \"https://example.com\",\n \"path\": \"/contact\",\n \"gclid\": \"<string>\",\n \"dclid\": \"<string>\",\n \"wbraid\": \"<string>\",\n \"gbraid\": \"<string>\",\n \"fbc\": \"<string>\",\n \"fbp\": \"<string>\",\n \"ga4cid\": \"<string>\",\n \"ga4sid\": \"<string>\",\n \"li_fat_id\": \"<string>\",\n \"msclkid\": \"<string>\",\n \"ttclid\": \"<string>\",\n \"twclid\": \"<string>\",\n \"rdt_cid\": \"<string>\",\n \"sccid\": \"<string>\",\n \"epik\": \"<string>\",\n \"utm_source\": \"google\",\n \"utm_medium\": \"cpc\",\n \"utm_campaign\": \"<string>\",\n \"ad_storage\": false,\n \"ad_user_data\": false,\n \"ad_personalization\": false,\n \"analytics_storage\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"summary": {
"total": 3,
"succeeded": 2,
"failed": 1
},
"results": [
{
"index": 0,
"success": true,
"status": 200,
"data": {
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"created": true,
"locked": false,
"message": "Lead added"
},
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}
]
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}Create up to 100 leads in one request. Each item takes the same body as
An empty array, more than 100 items, or a body without
POST /api/leads and follows the same rules: validation, lead filtering, external ID idempotency, duplicate handling and plan limits.
Items are processed one at a time, in the order you send them. A later item sees the leads created by earlier items, as it would with separate requests. One item failing does not stop the others.
The response is 200 OK with a summary and one result per item, also when some or all items failed. Check success on each result.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
leads | array | Yes | 1 to 100 lead objects, each with the body of POST /api/leads |
leads returns 400 VALIDATION_ERROR and nothing is created.
Example Request
curl -X POST \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"leads": [
{
"externalId": "QUOTE-2026-0042",
"name": "John Doe",
"email": "john@example.com",
"value": 2500
},
{
"externalId": "QUOTE-2026-0043",
"name": "Jane Roe",
"phone": "+31612345678"
},
{
"note": "No contact details"
}
]
}' \
"https://octanist.com/api/leads/bulk"
Example Response
{
"success": true,
"data": {
"summary": {
"total": 3,
"succeeded": 2,
"failed": 1
},
"results": [
{
"index": 0,
"success": true,
"status": 201,
"data": {
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"created": true,
"locked": false,
"message": "Lead added"
}
},
{
"index": 1,
"success": true,
"status": 200,
"data": {
"id": "lead_def456",
"externalId": "QUOTE-2026-0043",
"created": false,
"locked": false,
"message": "Existing lead returned"
}
},
{
"index": 2,
"success": false,
"status": 400,
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required field (externalId, email, name, phone or custom)"
}
}
]
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
summary.total | integer | Number of items in the request |
summary.succeeded | integer | Items that succeeded |
summary.failed | integer | Items that failed |
results | array | One result per item, in request order |
results[].index | integer | Position of the item in leads, starting at 0 |
results[].success | boolean | Whether the item succeeded |
results[].status | integer | HTTP status the item would get as a single POST /api/leads request: 201 created, 200 existing lead, or an error status |
results[].data | object | On success: the same data as POST /api/leads |
results[].error | object | On failure: code, message and, for validation errors, details |
Error Responses
These errors apply to the whole request. Errors of single items are inresults.
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid JSON, or leads is missing, empty or longer than 100 items |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | FORBIDDEN | A read-only API key, or the organization is a read-only demo |
| 500 | INTERNAL_ERROR | Server error |
⌘I
Create Leads in Bulk
curl --request POST \
--url https://octanist.com/api/leads/bulk \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"leads": [
{
"externalId": "QUOTE-2026-0042",
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"custom": "<string>",
"note": "<string>",
"value": 2500,
"labelId": "label_xyz",
"sessionId": "550e8400-e29b-41d4-a716-446655440000",
"website": "https://example.com",
"path": "/contact",
"gclid": "<string>",
"dclid": "<string>",
"wbraid": "<string>",
"gbraid": "<string>",
"fbc": "<string>",
"fbp": "<string>",
"ga4cid": "<string>",
"ga4sid": "<string>",
"li_fat_id": "<string>",
"msclkid": "<string>",
"ttclid": "<string>",
"twclid": "<string>",
"rdt_cid": "<string>",
"sccid": "<string>",
"epik": "<string>",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "<string>",
"ad_storage": false,
"ad_user_data": false,
"ad_personalization": false,
"analytics_storage": false
}
]
}
'import requests
url = "https://octanist.com/api/leads/bulk"
payload = { "leads": [
{
"externalId": "QUOTE-2026-0042",
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"custom": "<string>",
"note": "<string>",
"value": 2500,
"labelId": "label_xyz",
"sessionId": "550e8400-e29b-41d4-a716-446655440000",
"website": "https://example.com",
"path": "/contact",
"gclid": "<string>",
"dclid": "<string>",
"wbraid": "<string>",
"gbraid": "<string>",
"fbc": "<string>",
"fbp": "<string>",
"ga4cid": "<string>",
"ga4sid": "<string>",
"li_fat_id": "<string>",
"msclkid": "<string>",
"ttclid": "<string>",
"twclid": "<string>",
"rdt_cid": "<string>",
"sccid": "<string>",
"epik": "<string>",
"utm_source": "google",
"utm_medium": "cpc",
"utm_campaign": "<string>",
"ad_storage": False,
"ad_user_data": False,
"ad_personalization": False,
"analytics_storage": False
}
] }
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({
leads: [
{
externalId: 'QUOTE-2026-0042',
name: 'John Doe',
email: 'john@example.com',
phone: '+1234567890',
custom: '<string>',
note: '<string>',
value: 2500,
labelId: 'label_xyz',
sessionId: '550e8400-e29b-41d4-a716-446655440000',
website: 'https://example.com',
path: '/contact',
gclid: '<string>',
dclid: '<string>',
wbraid: '<string>',
gbraid: '<string>',
fbc: '<string>',
fbp: '<string>',
ga4cid: '<string>',
ga4sid: '<string>',
li_fat_id: '<string>',
msclkid: '<string>',
ttclid: '<string>',
twclid: '<string>',
rdt_cid: '<string>',
sccid: '<string>',
epik: '<string>',
utm_source: 'google',
utm_medium: 'cpc',
utm_campaign: '<string>',
ad_storage: false,
ad_user_data: false,
ad_personalization: false,
analytics_storage: false
}
]
})
};
fetch('https://octanist.com/api/leads/bulk', 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://octanist.com/api/leads/bulk",
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([
'leads' => [
[
'externalId' => 'QUOTE-2026-0042',
'name' => 'John Doe',
'email' => 'john@example.com',
'phone' => '+1234567890',
'custom' => '<string>',
'note' => '<string>',
'value' => 2500,
'labelId' => 'label_xyz',
'sessionId' => '550e8400-e29b-41d4-a716-446655440000',
'website' => 'https://example.com',
'path' => '/contact',
'gclid' => '<string>',
'dclid' => '<string>',
'wbraid' => '<string>',
'gbraid' => '<string>',
'fbc' => '<string>',
'fbp' => '<string>',
'ga4cid' => '<string>',
'ga4sid' => '<string>',
'li_fat_id' => '<string>',
'msclkid' => '<string>',
'ttclid' => '<string>',
'twclid' => '<string>',
'rdt_cid' => '<string>',
'sccid' => '<string>',
'epik' => '<string>',
'utm_source' => 'google',
'utm_medium' => 'cpc',
'utm_campaign' => '<string>',
'ad_storage' => false,
'ad_user_data' => false,
'ad_personalization' => false,
'analytics_storage' => false
]
]
]),
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://octanist.com/api/leads/bulk"
payload := strings.NewReader("{\n \"leads\": [\n {\n \"externalId\": \"QUOTE-2026-0042\",\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"custom\": \"<string>\",\n \"note\": \"<string>\",\n \"value\": 2500,\n \"labelId\": \"label_xyz\",\n \"sessionId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"website\": \"https://example.com\",\n \"path\": \"/contact\",\n \"gclid\": \"<string>\",\n \"dclid\": \"<string>\",\n \"wbraid\": \"<string>\",\n \"gbraid\": \"<string>\",\n \"fbc\": \"<string>\",\n \"fbp\": \"<string>\",\n \"ga4cid\": \"<string>\",\n \"ga4sid\": \"<string>\",\n \"li_fat_id\": \"<string>\",\n \"msclkid\": \"<string>\",\n \"ttclid\": \"<string>\",\n \"twclid\": \"<string>\",\n \"rdt_cid\": \"<string>\",\n \"sccid\": \"<string>\",\n \"epik\": \"<string>\",\n \"utm_source\": \"google\",\n \"utm_medium\": \"cpc\",\n \"utm_campaign\": \"<string>\",\n \"ad_storage\": false,\n \"ad_user_data\": false,\n \"ad_personalization\": false,\n \"analytics_storage\": false\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://octanist.com/api/leads/bulk")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"leads\": [\n {\n \"externalId\": \"QUOTE-2026-0042\",\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"custom\": \"<string>\",\n \"note\": \"<string>\",\n \"value\": 2500,\n \"labelId\": \"label_xyz\",\n \"sessionId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"website\": \"https://example.com\",\n \"path\": \"/contact\",\n \"gclid\": \"<string>\",\n \"dclid\": \"<string>\",\n \"wbraid\": \"<string>\",\n \"gbraid\": \"<string>\",\n \"fbc\": \"<string>\",\n \"fbp\": \"<string>\",\n \"ga4cid\": \"<string>\",\n \"ga4sid\": \"<string>\",\n \"li_fat_id\": \"<string>\",\n \"msclkid\": \"<string>\",\n \"ttclid\": \"<string>\",\n \"twclid\": \"<string>\",\n \"rdt_cid\": \"<string>\",\n \"sccid\": \"<string>\",\n \"epik\": \"<string>\",\n \"utm_source\": \"google\",\n \"utm_medium\": \"cpc\",\n \"utm_campaign\": \"<string>\",\n \"ad_storage\": false,\n \"ad_user_data\": false,\n \"ad_personalization\": false,\n \"analytics_storage\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://octanist.com/api/leads/bulk")
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 \"leads\": [\n {\n \"externalId\": \"QUOTE-2026-0042\",\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"custom\": \"<string>\",\n \"note\": \"<string>\",\n \"value\": 2500,\n \"labelId\": \"label_xyz\",\n \"sessionId\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"website\": \"https://example.com\",\n \"path\": \"/contact\",\n \"gclid\": \"<string>\",\n \"dclid\": \"<string>\",\n \"wbraid\": \"<string>\",\n \"gbraid\": \"<string>\",\n \"fbc\": \"<string>\",\n \"fbp\": \"<string>\",\n \"ga4cid\": \"<string>\",\n \"ga4sid\": \"<string>\",\n \"li_fat_id\": \"<string>\",\n \"msclkid\": \"<string>\",\n \"ttclid\": \"<string>\",\n \"twclid\": \"<string>\",\n \"rdt_cid\": \"<string>\",\n \"sccid\": \"<string>\",\n \"epik\": \"<string>\",\n \"utm_source\": \"google\",\n \"utm_medium\": \"cpc\",\n \"utm_campaign\": \"<string>\",\n \"ad_storage\": false,\n \"ad_user_data\": false,\n \"ad_personalization\": false,\n \"analytics_storage\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"summary": {
"total": 3,
"succeeded": 2,
"failed": 1
},
"results": [
{
"index": 0,
"success": true,
"status": 200,
"data": {
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"created": true,
"locked": false,
"message": "Lead added"
},
"error": {
"code": "VALIDATION_ERROR",
"message": "<string>",
"details": {}
}
}
]
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Human readable error message",
"details": {}
},
"meta": {
"requestId": "req_a1b2c3d4e5f6",
"timestamp": "2026-03-10T12:00:00.000Z"
}
}