Campaigns
Delete campaign
Delete a campaign that never started, with its contacts and its contacts file. A campaign that has started keeps its history: cancel it instead.
DELETE
/
v2
/
campaign
/
{id}
Delete campaign
curl --request DELETE \
--url https://api.verbeo.ai/v2/campaign/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v2/campaign/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v2/campaign/{id}', 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.verbeo.ai/v2/campaign/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.verbeo.ai/v2/campaign/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.verbeo.ai/v2/campaign/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v2/campaign/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyDeletes a campaign that never started, with its contacts, its import and its contacts file. This cannot be undone.
Only a campaign that never started can go: a
And the errors every route can give.
draft (importing or not), a scheduled campaign, or one cancelled before it started. A campaign that has started keeps its calls’ history, so deleting it is refused: cancel it instead. Deleting a campaign while its contacts import stops the import.
Who may call it: any API key of the workspace; in the dashboard, an owner or admin.
Path
Request
curl -X DELETE "https://api.verbeo.ai/v2/campaign/0175091d-2c3b-4aef-8c45-dbbe24f7b3ff" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
204 No Content, with no body.
Errors
| Code | Status | When |
|---|---|---|
CONFLICT | 409 | The campaign has started: This campaign has placed calls, so it cannot be deleted. Cancel it instead. |
NOT_FOUND | 404 | Campaign not found. |
FORBIDDEN | 403 | A dashboard member below admin: Deleting a campaign requires the admin or owner role. An API key acts as the owner and never gets it. |
VALIDATION_FAILED | 422 | id is not a UUID: must be a valid uuid. |
Was this page helpful?
⌘I
Delete campaign
curl --request DELETE \
--url https://api.verbeo.ai/v2/campaign/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.verbeo.ai/v2/campaign/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.verbeo.ai/v2/campaign/{id}', 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.verbeo.ai/v2/campaign/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.verbeo.ai/v2/campaign/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.verbeo.ai/v2/campaign/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbeo.ai/v2/campaign/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body