Remove Leads from Campaign
curl --request DELETE \
--url https://app.puffle.ai/api/campaigns/{id}/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prospect_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"all": true
}
'import requests
url = "https://app.puffle.ai/api/campaigns/{id}/leads"
payload = {
"prospect_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"all": True
}
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({prospect_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'], all: true})
};
fetch('https://app.puffle.ai/api/campaigns/{id}/leads', 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://app.puffle.ai/api/campaigns/{id}/leads",
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([
'prospect_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'all' => 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://app.puffle.ai/api/campaigns/{id}/leads"
payload := strings.NewReader("{\n \"prospect_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"all\": true\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://app.puffle.ai/api/campaigns/{id}/leads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prospect_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"all\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.puffle.ai/api/campaigns/{id}/leads")
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 \"prospect_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"all\": true\n}"
response = http.request(request)
puts response.read_body{
"deleted": 4503599627370495
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Outbound Contacts
Remove Leads from Campaign
Delete leads from a draft campaign.
DELETE
/
api
/
campaigns
/
{id}
/
leads
Remove Leads from Campaign
curl --request DELETE \
--url https://app.puffle.ai/api/campaigns/{id}/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prospect_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"all": true
}
'import requests
url = "https://app.puffle.ai/api/campaigns/{id}/leads"
payload = {
"prospect_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"all": True
}
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({prospect_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'], all: true})
};
fetch('https://app.puffle.ai/api/campaigns/{id}/leads', 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://app.puffle.ai/api/campaigns/{id}/leads",
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([
'prospect_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'all' => 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://app.puffle.ai/api/campaigns/{id}/leads"
payload := strings.NewReader("{\n \"prospect_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"all\": true\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://app.puffle.ai/api/campaigns/{id}/leads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prospect_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"all\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.puffle.ai/api/campaigns/{id}/leads")
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 \"prospect_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"all\": true\n}"
response = http.request(request)
puts response.read_body{
"deleted": 4503599627370495
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}CLI:
puffle campaign lead remove --id <id>
puffle campaign lead remove --id <id> --prospect-ids <prospect-ids> --all
Overview
Delete leads from adraft campaign. Call with { all: true } to clear the entire roster, or { prospect_ids: [...] } to cherry-pick up to 500 at a time. Campaign stats are recomputed atomically after the delete.
This operation shares the URL path
/api/campaigns/{id}/leads with other verbs. See the sibling page for related operations on the same resource.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Campaign UUID
Body
application/json
Response
Leads deleted successfully.
Required range:
0 <= x <= 9007199254740991Was this page helpful?
⌘I