curl --request DELETE \
--url https://your-instance.example.com/api/contacts/query-bulk-delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stageIds": [
"64b2c3d4e5f60012345678aa"
],
"pipelineType": "Contact",
"ownerFilter": "unowned",
"advancedParams": {
"createdAfter": "2026-01-01T00:00:00.000Z"
}
}
'import requests
url = "https://your-instance.example.com/api/contacts/query-bulk-delete"
payload = {
"stageIds": ["64b2c3d4e5f60012345678aa"],
"pipelineType": "Contact",
"ownerFilter": "unowned",
"advancedParams": { "createdAfter": "2026-01-01T00:00:00.000Z" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stageIds: ['64b2c3d4e5f60012345678aa'],
pipelineType: 'Contact',
ownerFilter: 'unowned',
advancedParams: {createdAfter: '2026-01-01T00:00:00.000Z'}
})
};
fetch('https://your-instance.example.com/api/contacts/query-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://your-instance.example.com/api/contacts/query-bulk-delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'stageIds' => [
'64b2c3d4e5f60012345678aa'
],
'pipelineType' => 'Contact',
'ownerFilter' => 'unowned',
'advancedParams' => [
'createdAfter' => '2026-01-01T00:00:00.000Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://your-instance.example.com/api/contacts/query-bulk-delete"
payload := strings.NewReader("{\n \"stageIds\": [\n \"64b2c3d4e5f60012345678aa\"\n ],\n \"pipelineType\": \"Contact\",\n \"ownerFilter\": \"unowned\",\n \"advancedParams\": {\n \"createdAfter\": \"2026-01-01T00:00:00.000Z\"\n }\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.delete("https://your-instance.example.com/api/contacts/query-bulk-delete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stageIds\": [\n \"64b2c3d4e5f60012345678aa\"\n ],\n \"pipelineType\": \"Contact\",\n \"ownerFilter\": \"unowned\",\n \"advancedParams\": {\n \"createdAfter\": \"2026-01-01T00:00:00.000Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/contacts/query-bulk-delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stageIds\": [\n \"64b2c3d4e5f60012345678aa\"\n ],\n \"pipelineType\": \"Contact\",\n \"ownerFilter\": \"unowned\",\n \"advancedParams\": {\n \"createdAfter\": \"2026-01-01T00:00:00.000Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"jobId": "b09c2c61-2f8f-4f02-9c1b-2f23a3a2f9c1",
"message": "Bulk delete started"
}{
"error": "Attachment not found",
"message": "Attachment not found"
}{
"error": "Attachment not found",
"message": "Attachment not found"
}Bulk-delete all matching contacts (async)
Starts a background job that cascade-deletes every contact matching the supplied filter — for each contact it also deletes the org’s conversations and messages for that contact, fires assignee notifications, emits contact_removed socket events, and writes manual-event audit entries (CONTACT_DELETE). The handler responds 202 immediately with a jobId; the caller should poll GET /api/contacts/bulk-job/{jobId} for progress. The job is registered synchronously before the response is sent so the first poll never gets a 404.
curl --request DELETE \
--url https://your-instance.example.com/api/contacts/query-bulk-delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"stageIds": [
"64b2c3d4e5f60012345678aa"
],
"pipelineType": "Contact",
"ownerFilter": "unowned",
"advancedParams": {
"createdAfter": "2026-01-01T00:00:00.000Z"
}
}
'import requests
url = "https://your-instance.example.com/api/contacts/query-bulk-delete"
payload = {
"stageIds": ["64b2c3d4e5f60012345678aa"],
"pipelineType": "Contact",
"ownerFilter": "unowned",
"advancedParams": { "createdAfter": "2026-01-01T00:00:00.000Z" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stageIds: ['64b2c3d4e5f60012345678aa'],
pipelineType: 'Contact',
ownerFilter: 'unowned',
advancedParams: {createdAfter: '2026-01-01T00:00:00.000Z'}
})
};
fetch('https://your-instance.example.com/api/contacts/query-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://your-instance.example.com/api/contacts/query-bulk-delete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'stageIds' => [
'64b2c3d4e5f60012345678aa'
],
'pipelineType' => 'Contact',
'ownerFilter' => 'unowned',
'advancedParams' => [
'createdAfter' => '2026-01-01T00:00:00.000Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://your-instance.example.com/api/contacts/query-bulk-delete"
payload := strings.NewReader("{\n \"stageIds\": [\n \"64b2c3d4e5f60012345678aa\"\n ],\n \"pipelineType\": \"Contact\",\n \"ownerFilter\": \"unowned\",\n \"advancedParams\": {\n \"createdAfter\": \"2026-01-01T00:00:00.000Z\"\n }\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.delete("https://your-instance.example.com/api/contacts/query-bulk-delete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stageIds\": [\n \"64b2c3d4e5f60012345678aa\"\n ],\n \"pipelineType\": \"Contact\",\n \"ownerFilter\": \"unowned\",\n \"advancedParams\": {\n \"createdAfter\": \"2026-01-01T00:00:00.000Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/contacts/query-bulk-delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stageIds\": [\n \"64b2c3d4e5f60012345678aa\"\n ],\n \"pipelineType\": \"Contact\",\n \"ownerFilter\": \"unowned\",\n \"advancedParams\": {\n \"createdAfter\": \"2026-01-01T00:00:00.000Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"jobId": "b09c2c61-2f8f-4f02-9c1b-2f23a3a2f9c1",
"message": "Bulk delete started"
}{
"error": "Attachment not found",
"message": "Attachment not found"
}{
"error": "Attachment not found",
"message": "Attachment not found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Shared filter shape used by query-count, query-bulk-move, query-bulk-delete, and query-bulk-export. Either supply stageIds[] OR set orgWide: true. pipelineType selects whether the operation runs against the Contact or Application collection.
One or more pipeline-stage IDs. Required unless orgWide is true.
Which collection to target. Defaults to Contact.
Contact, Application When true, ignore stageIds and run across the whole organization.
Owner-based scope (e.g. owned, unowned) — same semantics as the Contacts list view.
Optional advanced filter object (same shape as the Contacts list view).