curl --request PATCH \
--url https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"phone_number": "+14155552671",
"first_name": "Jane",
"last_name": "Smith"
},
{
"phone_number": "+14155559999",
"do_not_call": true
}
]
'import requests
url = "https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/bulk"
payload = [
{
"phone_number": "+14155552671",
"first_name": "Jane",
"last_name": "Smith"
},
{
"phone_number": "+14155559999",
"do_not_call": True
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{phone_number: '+14155552671', first_name: 'Jane', last_name: 'Smith'},
{phone_number: '+14155559999', do_not_call: true}
])
};
fetch('https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/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/update/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([
[
'phone_number' => '+14155552671',
'first_name' => 'Jane',
'last_name' => 'Smith'
],
[
'phone_number' => '+14155559999',
'do_not_call' => true
]
]),
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/update/bulk"
payload := strings.NewReader("[\n {\n \"phone_number\": \"+14155552671\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\"\n },\n {\n \"phone_number\": \"+14155559999\",\n \"do_not_call\": true\n }\n]")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"phone_number\": \"+14155552671\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\"\n },\n {\n \"phone_number\": \"+14155559999\",\n \"do_not_call\": true\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"phone_number\": \"+14155552671\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\"\n },\n {\n \"phone_number\": \"+14155559999\",\n \"do_not_call\": true\n }\n]"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Bulk lead update completed",
"results": [
{
"index": 0,
"phone_number": "+14155552671",
"success": true,
"message": "Lead updated successfully"
},
{
"index": 1,
"phone_number": "+14155559999",
"success": false,
"message": "Lead not found"
}
]
}{
"message": "Body must be a non-empty list"
}{
"message": "<string>"
}{
"message": "Internal server error"
}Bulk Update Leads in Campaign
Updates multiple existing leads in the specified campaign in a single request. Each item is processed individually and per-lead results are returned. phone_number is required in every item to identify the lead. Only provided fields are changed.
Authentication
All requests require an Authorization header using Bearer token authentication:
Authorization: Bearer <api_key>
curl --request PATCH \
--url https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"phone_number": "+14155552671",
"first_name": "Jane",
"last_name": "Smith"
},
{
"phone_number": "+14155559999",
"do_not_call": true
}
]
'import requests
url = "https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/bulk"
payload = [
{
"phone_number": "+14155552671",
"first_name": "Jane",
"last_name": "Smith"
},
{
"phone_number": "+14155559999",
"do_not_call": True
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{phone_number: '+14155552671', first_name: 'Jane', last_name: 'Smith'},
{phone_number: '+14155559999', do_not_call: true}
])
};
fetch('https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/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/update/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([
[
'phone_number' => '+14155552671',
'first_name' => 'Jane',
'last_name' => 'Smith'
],
[
'phone_number' => '+14155559999',
'do_not_call' => true
]
]),
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/update/bulk"
payload := strings.NewReader("[\n {\n \"phone_number\": \"+14155552671\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\"\n },\n {\n \"phone_number\": \"+14155559999\",\n \"do_not_call\": true\n }\n]")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"phone_number\": \"+14155552671\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\"\n },\n {\n \"phone_number\": \"+14155559999\",\n \"do_not_call\": true\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.voiceaiwrapper.app/api/v2/voice-campaigns/{campaign_id}/leads/update/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"phone_number\": \"+14155552671\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\"\n },\n {\n \"phone_number\": \"+14155559999\",\n \"do_not_call\": true\n }\n]"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Bulk lead update completed",
"results": [
{
"index": 0,
"phone_number": "+14155552671",
"success": true,
"message": "Lead updated successfully"
},
{
"index": 1,
"phone_number": "+14155559999",
"success": false,
"message": "Lead not found"
}
]
}{
"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.
"camp_abc123"
Body
Array of lead update objects. Each object must include phone_number to identify the lead.
1Phone number of the lead to update (used as identifier). Required.
"+14155552671"
Updated first name. Optional.
"Jane"
Updated last name. Optional.
"Doe"
Updated email address. Optional.
"jane.doe@example.com"
When true, marks the lead as opted out and prevents future calls. Optional.
Allowed values: true, false.
false
Updated custom key-value fields. Optional.
{ "plan": "pro" }
When true, resets the lead's answered status and re-queues them for outbound calling. Only applies when the lead is currently marked as answered. Optional.
Allowed values: true, false.
true
[
{
"phone_number": "+14155552671",
"first_name": "Jane",
"last_name": "Smith"
},
{
"phone_number": "+14155559999",
"do_not_call": true
}
]
Was this page helpful?

