Bulk delete campaign mailings
curl --request DELETE \
--url https://api.paubox.com/v1/marketing/campaign_mailings_bulk_delete \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--data '
{
"campaign_mailing_ids": [
"123e4567-e89b-12d3-a456-426614174000"
]
}
'import requests
url = "https://api.paubox.com/v1/marketing/campaign_mailings_bulk_delete"
payload = { "campaign_mailing_ids": ["123e4567-e89b-12d3-a456-426614174000"] }
headers = {
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaign_mailing_ids: ['123e4567-e89b-12d3-a456-426614174000']})
};
fetch('https://api.paubox.com/v1/marketing/campaign_mailings_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.paubox.com/v1/marketing/campaign_mailings_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([
'campaign_mailing_ids' => [
'123e4567-e89b-12d3-a456-426614174000'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <api-key>"
],
]);
$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.paubox.com/v1/marketing/campaign_mailings_bulk_delete"
payload := strings.NewReader("{\n \"campaign_mailing_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("authorization", "<api-key>")
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.paubox.com/v1/marketing/campaign_mailings_bulk_delete")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_mailing_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paubox.com/v1/marketing/campaign_mailings_bulk_delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_mailing_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Marketing · Campaigns
Bulk delete campaigns with the Marketing API
Permanently deletes the campaign mailings identified by campaign_mailing_ids. There is no single-delete endpoint; delete one mailing by passing an array of one ID.
This is irreversible. Deleting a mailing also removes its associated delivery and send records.
Omitting campaign_mailing_ids is a no-op and still returns 200 with an empty object.
Example curl command:
curl -X DELETE \
https://api.paubox.com/v1/marketing/campaign_mailings_bulk_delete \
-H 'authorization: Token token=YOUR_API_KEY' \
-H 'content-type: application/json' \
-d '{
"campaign_mailing_ids": ["123e4567-e89b-12d3-a456-426614174000"]
}'
DELETE
/
campaign_mailings_bulk_delete
Bulk delete campaign mailings
curl --request DELETE \
--url https://api.paubox.com/v1/marketing/campaign_mailings_bulk_delete \
--header 'Content-Type: application/json' \
--header 'authorization: <api-key>' \
--data '
{
"campaign_mailing_ids": [
"123e4567-e89b-12d3-a456-426614174000"
]
}
'import requests
url = "https://api.paubox.com/v1/marketing/campaign_mailings_bulk_delete"
payload = { "campaign_mailing_ids": ["123e4567-e89b-12d3-a456-426614174000"] }
headers = {
"authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaign_mailing_ids: ['123e4567-e89b-12d3-a456-426614174000']})
};
fetch('https://api.paubox.com/v1/marketing/campaign_mailings_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.paubox.com/v1/marketing/campaign_mailings_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([
'campaign_mailing_ids' => [
'123e4567-e89b-12d3-a456-426614174000'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <api-key>"
],
]);
$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.paubox.com/v1/marketing/campaign_mailings_bulk_delete"
payload := strings.NewReader("{\n \"campaign_mailing_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("authorization", "<api-key>")
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.paubox.com/v1/marketing/campaign_mailings_bulk_delete")
.header("authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_mailing_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paubox.com/v1/marketing/campaign_mailings_bulk_delete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_mailing_ids\": [\n \"123e4567-e89b-12d3-a456-426614174000\"\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Token-based authentication. Use format: "Token token=<API_KEY>" where <API_KEY> is your API key
Body
application/json
UUIDs of the campaign mailings to delete. Omit for a no-op.
Response
An empty object. The response does not report how many records were deleted.
The response is of type object.
⌘I