Bulk Delete Contacts
curl --request POST \
--url https://api.example.com/v1/contacts/bulk-delete \
--header 'Content-Type: application/json' \
--data '
{
"contact_ids": [
{}
],
"dry_run": true
}
'import requests
url = "https://api.example.com/v1/contacts/bulk-delete"
payload = {
"contact_ids": [{}],
"dry_run": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contact_ids: [{}], dry_run: true})
};
fetch('https://api.example.com/v1/contacts/bulk-delete', 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/contacts/bulk-delete",
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([
'contact_ids' => [
[
]
],
'dry_run' => true
]),
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/contacts/bulk-delete"
payload := strings.NewReader("{\n \"contact_ids\": [\n {}\n ],\n \"dry_run\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/contacts/bulk-delete")
.header("Content-Type", "application/json")
.body("{\n \"contact_ids\": [\n {}\n ],\n \"dry_run\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/contacts/bulk-delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_ids\": [\n {}\n ],\n \"dry_run\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"deleted_count": 123,
"not_found_count": 123,
"errors": [
{}
]
}
}Bulk Operations
Bulk Delete Contacts
Delete up to 500 contacts in a single call
POST
/
v1
/
contacts
/
bulk-delete
Bulk Delete Contacts
curl --request POST \
--url https://api.example.com/v1/contacts/bulk-delete \
--header 'Content-Type: application/json' \
--data '
{
"contact_ids": [
{}
],
"dry_run": true
}
'import requests
url = "https://api.example.com/v1/contacts/bulk-delete"
payload = {
"contact_ids": [{}],
"dry_run": True
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({contact_ids: [{}], dry_run: true})
};
fetch('https://api.example.com/v1/contacts/bulk-delete', 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/contacts/bulk-delete",
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([
'contact_ids' => [
[
]
],
'dry_run' => true
]),
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/contacts/bulk-delete"
payload := strings.NewReader("{\n \"contact_ids\": [\n {}\n ],\n \"dry_run\": true\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.example.com/v1/contacts/bulk-delete")
.header("Content-Type", "application/json")
.body("{\n \"contact_ids\": [\n {}\n ],\n \"dry_run\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/contacts/bulk-delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact_ids\": [\n {}\n ],\n \"dry_run\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"deleted_count": 123,
"not_found_count": 123,
"errors": [
{}
]
}
}Request
Deletion is permanent for the contact row and its direct properties. Associated activities, notes, and tasks are preserved in the timeline but lose their contact back-reference. To merge rather than delete, usePOST /v1/contacts/merge.
Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
string
Strongly recommended. The same key returns the original result within 24 hours.
Body Parameters
array
required
Array of contact UUIDs to delete. Maximum 500.
boolean
default:"false"
When
true, the API validates input and returns counts but makes no changes.Response
object
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID. Each successful deletion emits a contact.deleted webhook event.
curl -X POST \
https://data.leadlex.com/functions/v1/api-gateway/v1/contacts/bulk-delete \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"contact_ids": [
"123e4567-e89b-12d3-a456-426614174000",
"456e7890-a1b2-34c5-d678-901234567890"
]
}'
import requests, uuid
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
ids = ["123e4567-e89b-12d3-a456-426614174000"]
r = requests.post(
f"{BASE_URL}/v1/contacts/bulk-delete",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
"Idempotency-Key": str(uuid.uuid4()),
},
json={"contact_ids": ids},
)
print(r.json()["data"])
const res = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/contacts/bulk-delete',
{
method: 'POST',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({ contact_ids: ['123e4567-e89b-12d3-a456-426614174000'] }),
}
);
const { data } = await res.json();
console.log(data);
Example Response
{
"data": {
"deleted_count": 2,
"not_found_count": 0,
"errors": []
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | validation_error | More than 500 IDs or missing contact_ids |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing write:contacts permission |
| 429 | rate_limited | Rate limit exceeded |