Bulk Update Deals
curl --request PATCH \
--url https://api.example.com/v1/deals/bulk \
--header 'Content-Type: application/json' \
--data '
{
"deal_ids": [
{}
],
"updates": {}
}
'import requests
url = "https://api.example.com/v1/deals/bulk"
payload = {
"deal_ids": [{}],
"updates": {}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({deal_ids: [{}], updates: {}})
};
fetch('https://api.example.com/v1/deals/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://api.example.com/v1/deals/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([
'deal_ids' => [
[
]
],
'updates' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/deals/bulk"
payload := strings.NewReader("{\n \"deal_ids\": [\n {}\n ],\n \"updates\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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://api.example.com/v1/deals/bulk")
.header("Content-Type", "application/json")
.body("{\n \"deal_ids\": [\n {}\n ],\n \"updates\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/deals/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"deal_ids\": [\n {}\n ],\n \"updates\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"updated": 123
}
}Deals
Bulk Update Deals
Update multiple deals with the same field values (max 100)
PATCH
/
v1
/
deals
/
bulk
Bulk Update Deals
curl --request PATCH \
--url https://api.example.com/v1/deals/bulk \
--header 'Content-Type: application/json' \
--data '
{
"deal_ids": [
{}
],
"updates": {}
}
'import requests
url = "https://api.example.com/v1/deals/bulk"
payload = {
"deal_ids": [{}],
"updates": {}
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({deal_ids: [{}], updates: {}})
};
fetch('https://api.example.com/v1/deals/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://api.example.com/v1/deals/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([
'deal_ids' => [
[
]
],
'updates' => [
]
]),
CURLOPT_HTTPHEADER => [
"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.example.com/v1/deals/bulk"
payload := strings.NewReader("{\n \"deal_ids\": [\n {}\n ],\n \"updates\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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://api.example.com/v1/deals/bulk")
.header("Content-Type", "application/json")
.body("{\n \"deal_ids\": [\n {}\n ],\n \"updates\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/deals/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"deal_ids\": [\n {}\n ],\n \"updates\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"updated": 123
}
}Request
Body Parameters
array
required
Array of deal IDs to update (max 100)
object
required
Fields to update on all specified deals. Supports:
name, stage, status, pipeline, estimated_value, priority, notes, tags, closed_date, owner_id, contact_id, deal_typeHeaders
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Response
curl -X PATCH https://data.leadlex.com/functions/v1/api-gateway/v1/deals/bulk \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"deal_ids": ["deal-001", "deal-002", "deal-003"],
"updates": { "stage": "Won", "status": "won" }
}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
headers = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
response = requests.patch(f"{BASE_URL}/v1/deals/bulk", headers=headers, json={
"deal_ids": ["deal-001", "deal-002"],
"updates": {"stage": "Won", "status": "won"}
})
print(response.json())
const response = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/deals/bulk',
{
method: 'PATCH',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json'
},
body: JSON.stringify({
deal_ids: ['deal-001', 'deal-002'],
updates: { stage: 'Won', status: 'won' }
})
}
);
const { data } = await response.json();
Example Response
{
"data": {
"updated": 3
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | Missing deal_ids or updates |
| 400 | validation_error | More than 100 deal IDs |
| 403 | insufficient_permissions | Missing deals:write permission |