Bulk Remove Leads from Campaign
curl --request DELETE \
--url https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"phone_number": "+14155552671"
},
{
"campaign_lead_id": "VoiceCampaignLead:42"
}
]
'import requests
url = "https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk"
payload = [{ "phone_number": "+14155552671" }, { "campaign_lead_id": "VoiceCampaignLead:42" }]
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([{phone_number: '+14155552671'}, {campaign_lead_id: 'VoiceCampaignLead:42'}])
};
fetch('https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/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.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk",
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([
[
'phone_number' => '+14155552671'
],
[
'campaign_lead_id' => 'VoiceCampaignLead:42'
]
]),
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://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk"
payload := strings.NewReader("[\n {\n \"phone_number\": \"+14155552671\"\n },\n {\n \"campaign_lead_id\": \"VoiceCampaignLead:42\"\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://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"phone_number\": \"+14155552671\"\n },\n {\n \"campaign_lead_id\": \"VoiceCampaignLead:42\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk")
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 {\n \"phone_number\": \"+14155552671\"\n },\n {\n \"campaign_lead_id\": \"VoiceCampaignLead:42\"\n }\n]"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Bulk lead removal completed",
"results": [
{
"index": 0,
"phone_number": "+14155552671",
"success": true,
"message": "Lead removed successfully"
},
{
"index": 1,
"campaign_lead_id": "VoiceCampaignLead:42",
"success": false,
"message": "Lead not found with the given phone number or campaign lead id"
}
]
}{
"message": "Body must be a non-empty list"
}{
"message": "<string>"
}{
"message": "Internal server error"
}Leads (v2)
Bulk Remove Leads from Campaign
Removes multiple leads from the specified campaign in a single request. Each item is processed individually and per-lead results are returned. Each item must include either a phone_number or a campaign_lead_id. When both are provided, campaign_lead_id takes precedence.
Authentication
All requests require an Authorization header using Bearer token authentication:
Authorization: Bearer <api_key>
DELETE
/
api
/
v2
/
voice-campaigns
/
{campaign_id}
/
leads
/
remove
/
bulk
Bulk Remove Leads from Campaign
curl --request DELETE \
--url https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"phone_number": "+14155552671"
},
{
"campaign_lead_id": "VoiceCampaignLead:42"
}
]
'import requests
url = "https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk"
payload = [{ "phone_number": "+14155552671" }, { "campaign_lead_id": "VoiceCampaignLead:42" }]
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([{phone_number: '+14155552671'}, {campaign_lead_id: 'VoiceCampaignLead:42'}])
};
fetch('https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/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.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk",
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([
[
'phone_number' => '+14155552671'
],
[
'campaign_lead_id' => 'VoiceCampaignLead:42'
]
]),
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://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk"
payload := strings.NewReader("[\n {\n \"phone_number\": \"+14155552671\"\n },\n {\n \"campaign_lead_id\": \"VoiceCampaignLead:42\"\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://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"phone_number\": \"+14155552671\"\n },\n {\n \"campaign_lead_id\": \"VoiceCampaignLead:42\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/remove/bulk")
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 {\n \"phone_number\": \"+14155552671\"\n },\n {\n \"campaign_lead_id\": \"VoiceCampaignLead:42\"\n }\n]"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Bulk lead removal completed",
"results": [
{
"index": 0,
"phone_number": "+14155552671",
"success": true,
"message": "Lead removed successfully"
},
{
"index": 1,
"campaign_lead_id": "VoiceCampaignLead:42",
"success": false,
"message": "Lead not found with the given phone number or campaign lead id"
}
]
}{
"message": "Body must be a non-empty list"
}{
"message": "<string>"
}{
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the campaign. Required.
Example:
"camp_abc123"
Body
application/json
Array of lead identifiers to remove. Each object must include phone_number or campaign_lead_id.
Minimum array length:
1Example:
[
{ "phone_number": "+14155552671" },
{
"campaign_lead_id": "VoiceCampaignLead:42"
}
]
Was this page helpful?
⌘I

