Bulk
Update Leads in Bulk
Send up to 100 lead updates in one request with PATCH /api/leads/bulk. Each item is handled like PATCH /api/leads and gets its own result.
PATCH
/
api
/
leads
/
bulk
Update Leads in Bulk
curl --request PATCH \
--url https://octanist.com/api/leads/bulk \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"updates": [
{
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"email": "john@example.com",
"phone": "+1234567890",
"status": "won",
"changedTo": "won",
"value": 5000,
"note": "<string>",
"lossReason": "<string>",
"set": {
"externalId": "CRM-88412",
"name": "John Doe",
"email": "new@example.com",
"phone": "+31612345678",
"custom": {
"company": "Acme Inc",
"fax": null
},
"labelId": "label_xyz"
},
"conversionEventId": "conv_won_subscription"
}
]
}
'import requests
url = "https://octanist.com/api/leads/bulk"
payload = { "updates": [
{
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"email": "john@example.com",
"phone": "+1234567890",
"status": "won",
"changedTo": "won",
"value": 5000,
"note": "<string>",
"lossReason": "<string>",
"set": {
"externalId": "CRM-88412",
"name": "John Doe",
"email": "new@example.com",
"phone": "+31612345678",
"custom": {
"company": "Acme Inc",
"fax": None
},
"labelId": "label_xyz"
},
"conversionEventId": "conv_won_subscription"
}
] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updates: [
{
id: 'lead_abc123',
externalId: 'QUOTE-2026-0042',
email: 'john@example.com',
phone: '+1234567890',
status: 'won',
changedTo: 'won',
value: 5000,
note: '<string>',
lossReason: '<string>',
set: {
externalId: 'CRM-88412',
name: 'John Doe',
email: 'new@example.com',
phone: '+31612345678',
custom: {company: 'Acme Inc', fax: null},
labelId: 'label_xyz'
},
conversionEventId: 'conv_won_subscription'
}
]
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'updates' => [
[
'id' => 'lead_abc123',
'externalId' => 'QUOTE-2026-0042',
'email' => 'john@example.com',
'phone' => '+1234567890',
'status' => 'won',
'changedTo' => 'won',
'value' => 5000,
'note' => '<string>',
'lossReason' => '<string>',
'set' => [
'externalId' => 'CRM-88412',
'name' => 'John Doe',
'email' => 'new@example.com',
'phone' => '+31612345678',
'custom' => [
'company' => 'Acme Inc',
'fax' => null
],
'labelId' => 'label_xyz'
],
'conversionEventId' => 'conv_won_subscription'
]
]
]),
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 \"updates\": [\n {\n \"id\": \"lead_abc123\",\n \"externalId\": \"QUOTE-2026-0042\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"status\": \"won\",\n \"changedTo\": \"won\",\n \"value\": 5000,\n \"note\": \"<string>\",\n \"lossReason\": \"<string>\",\n \"set\": {\n \"externalId\": \"CRM-88412\",\n \"name\": \"John Doe\",\n \"email\": \"new@example.com\",\n \"phone\": \"+31612345678\",\n \"custom\": {\n \"company\": \"Acme Inc\",\n \"fax\": null\n },\n \"labelId\": \"label_xyz\"\n },\n \"conversionEventId\": \"conv_won_subscription\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://octanist.com/api/leads/bulk")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"updates\": [\n {\n \"id\": \"lead_abc123\",\n \"externalId\": \"QUOTE-2026-0042\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"status\": \"won\",\n \"changedTo\": \"won\",\n \"value\": 5000,\n \"note\": \"<string>\",\n \"lossReason\": \"<string>\",\n \"set\": {\n \"externalId\": \"CRM-88412\",\n \"name\": \"John Doe\",\n \"email\": \"new@example.com\",\n \"phone\": \"+31612345678\",\n \"custom\": {\n \"company\": \"Acme Inc\",\n \"fax\": null\n },\n \"labelId\": \"label_xyz\"\n },\n \"conversionEventId\": \"conv_won_subscription\"\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::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updates\": [\n {\n \"id\": \"lead_abc123\",\n \"externalId\": \"QUOTE-2026-0042\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"status\": \"won\",\n \"changedTo\": \"won\",\n \"value\": 5000,\n \"note\": \"<string>\",\n \"lossReason\": \"<string>\",\n \"set\": {\n \"externalId\": \"CRM-88412\",\n \"name\": \"John Doe\",\n \"email\": \"new@example.com\",\n \"phone\": \"+31612345678\",\n \"custom\": {\n \"company\": \"Acme Inc\",\n \"fax\": null\n },\n \"labelId\": \"label_xyz\"\n },\n \"conversionEventId\": \"conv_won_subscription\"\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": {
"matched": true,
"leadId": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"leadsUpdated": 1,
"leads": [
{
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"status": "won",
"value": 5000,
"labelId": null,
"conversionEventId": null,
"locked": false
}
],
"warnings": [
"Status not changed on lead lead_abc123: it is already won. Send \"status\": \"open\" first to reopen it."
],
"message": "Lead updated successfully"
},
"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"
}
}Send up to 100 lead updates in one request. Each item takes the same body as
An empty array, more than 100 items, or a body without
PATCH /api/leads and follows the same rules: identifier matching, Multiple Match Behavior, status rules, set, conversionEventId, and pending updates for leads that are not in Octanist yet.
Items are processed one at a time, in the order you send them. Two updates for the same lead are applied one after the other, as 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. An item that matches no lead succeeds with "matched": false, as it does on PATCH /api/leads.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
updates | array | Yes | 1 to 100 update objects, each with the body of PATCH /api/leads, including at least one identifier |
updates returns 400 VALIDATION_ERROR and nothing is updated.
Example Request
curl -X PATCH \
-H "X-API-KEY: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"updates": [
{ "externalId": "QUOTE-2026-0042", "status": "won", "value": 5000 },
{ "email": "jane@example.com", "status": "lost", "lossReason": "Too expensive" },
{ "externalId": "QUOTE-2026-0099", "status": "won" }
]
}' \
"https://octanist.com/api/leads/bulk"
Example Response
{
"success": true,
"data": {
"summary": {
"total": 3,
"succeeded": 2,
"failed": 1
},
"results": [
{
"index": 0,
"success": true,
"status": 200,
"data": {
"matched": true,
"leadId": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"leadsUpdated": 1,
"leads": [
{
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"status": "won",
"value": 5000,
"labelId": null,
"conversionEventId": null,
"locked": false
}
],
"message": "Lead updated successfully"
}
},
{
"index": 1,
"success": true,
"status": 200,
"data": {
"matched": false,
"leadId": null,
"leadsUpdated": 0,
"leads": [],
"message": "No lead found matching the provided identifiers. The request was accepted and the missed attempt has been logged."
}
},
{
"index": 2,
"success": false,
"status": 400,
"error": {
"code": "VALIDATION_ERROR",
"message": "A value above 0 is required to mark a lead as won. Send a value with the update, or set one on the lead first."
}
}
]
},
"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, including items that matched no lead |
summary.failed | integer | Items that failed |
results | array | One result per item, in request order |
results[].index | integer | Position of the item in updates, starting at 0 |
results[].success | boolean | Whether the item succeeded |
results[].status | integer | HTTP status the item would get as a single PATCH /api/leads request |
results[].data | object | On success: the same data as PATCH /api/leads, including warnings when a status was not applied |
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 updates 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
Update Leads in Bulk
curl --request PATCH \
--url https://octanist.com/api/leads/bulk \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"updates": [
{
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"email": "john@example.com",
"phone": "+1234567890",
"status": "won",
"changedTo": "won",
"value": 5000,
"note": "<string>",
"lossReason": "<string>",
"set": {
"externalId": "CRM-88412",
"name": "John Doe",
"email": "new@example.com",
"phone": "+31612345678",
"custom": {
"company": "Acme Inc",
"fax": null
},
"labelId": "label_xyz"
},
"conversionEventId": "conv_won_subscription"
}
]
}
'import requests
url = "https://octanist.com/api/leads/bulk"
payload = { "updates": [
{
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"email": "john@example.com",
"phone": "+1234567890",
"status": "won",
"changedTo": "won",
"value": 5000,
"note": "<string>",
"lossReason": "<string>",
"set": {
"externalId": "CRM-88412",
"name": "John Doe",
"email": "new@example.com",
"phone": "+31612345678",
"custom": {
"company": "Acme Inc",
"fax": None
},
"labelId": "label_xyz"
},
"conversionEventId": "conv_won_subscription"
}
] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updates: [
{
id: 'lead_abc123',
externalId: 'QUOTE-2026-0042',
email: 'john@example.com',
phone: '+1234567890',
status: 'won',
changedTo: 'won',
value: 5000,
note: '<string>',
lossReason: '<string>',
set: {
externalId: 'CRM-88412',
name: 'John Doe',
email: 'new@example.com',
phone: '+31612345678',
custom: {company: 'Acme Inc', fax: null},
labelId: 'label_xyz'
},
conversionEventId: 'conv_won_subscription'
}
]
})
};
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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'updates' => [
[
'id' => 'lead_abc123',
'externalId' => 'QUOTE-2026-0042',
'email' => 'john@example.com',
'phone' => '+1234567890',
'status' => 'won',
'changedTo' => 'won',
'value' => 5000,
'note' => '<string>',
'lossReason' => '<string>',
'set' => [
'externalId' => 'CRM-88412',
'name' => 'John Doe',
'email' => 'new@example.com',
'phone' => '+31612345678',
'custom' => [
'company' => 'Acme Inc',
'fax' => null
],
'labelId' => 'label_xyz'
],
'conversionEventId' => 'conv_won_subscription'
]
]
]),
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 \"updates\": [\n {\n \"id\": \"lead_abc123\",\n \"externalId\": \"QUOTE-2026-0042\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"status\": \"won\",\n \"changedTo\": \"won\",\n \"value\": 5000,\n \"note\": \"<string>\",\n \"lossReason\": \"<string>\",\n \"set\": {\n \"externalId\": \"CRM-88412\",\n \"name\": \"John Doe\",\n \"email\": \"new@example.com\",\n \"phone\": \"+31612345678\",\n \"custom\": {\n \"company\": \"Acme Inc\",\n \"fax\": null\n },\n \"labelId\": \"label_xyz\"\n },\n \"conversionEventId\": \"conv_won_subscription\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://octanist.com/api/leads/bulk")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"updates\": [\n {\n \"id\": \"lead_abc123\",\n \"externalId\": \"QUOTE-2026-0042\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"status\": \"won\",\n \"changedTo\": \"won\",\n \"value\": 5000,\n \"note\": \"<string>\",\n \"lossReason\": \"<string>\",\n \"set\": {\n \"externalId\": \"CRM-88412\",\n \"name\": \"John Doe\",\n \"email\": \"new@example.com\",\n \"phone\": \"+31612345678\",\n \"custom\": {\n \"company\": \"Acme Inc\",\n \"fax\": null\n },\n \"labelId\": \"label_xyz\"\n },\n \"conversionEventId\": \"conv_won_subscription\"\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::Patch.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updates\": [\n {\n \"id\": \"lead_abc123\",\n \"externalId\": \"QUOTE-2026-0042\",\n \"email\": \"john@example.com\",\n \"phone\": \"+1234567890\",\n \"status\": \"won\",\n \"changedTo\": \"won\",\n \"value\": 5000,\n \"note\": \"<string>\",\n \"lossReason\": \"<string>\",\n \"set\": {\n \"externalId\": \"CRM-88412\",\n \"name\": \"John Doe\",\n \"email\": \"new@example.com\",\n \"phone\": \"+31612345678\",\n \"custom\": {\n \"company\": \"Acme Inc\",\n \"fax\": null\n },\n \"labelId\": \"label_xyz\"\n },\n \"conversionEventId\": \"conv_won_subscription\"\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": {
"matched": true,
"leadId": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"leadsUpdated": 1,
"leads": [
{
"id": "lead_abc123",
"externalId": "QUOTE-2026-0042",
"status": "won",
"value": 5000,
"labelId": null,
"conversionEventId": null,
"locked": false
}
],
"warnings": [
"Status not changed on lead lead_abc123: it is already won. Send \"status\": \"open\" first to reopen it."
],
"message": "Lead updated successfully"
},
"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"
}
}