Delete campaign
curl --request DELETE \
--url https://app.autocalls.ai/api/user/campaign/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.autocalls.ai/api/user/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://app.autocalls.ai/api/user/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://app.autocalls.ai/api/user/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://app.autocalls.ai/api/user/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://app.autocalls.ai/api/user/campaign/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.autocalls.ai/api/user/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{
"message": "Campaign deleted successfully"
}
{
"message": "Campaign not found"
}
Campaigns
Delete campaign
Delete a specific campaign
DELETE
/
user
/
campaign
/
{id}
Delete campaign
curl --request DELETE \
--url https://app.autocalls.ai/api/user/campaign/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.autocalls.ai/api/user/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://app.autocalls.ai/api/user/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://app.autocalls.ai/api/user/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://app.autocalls.ai/api/user/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://app.autocalls.ai/api/user/campaign/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.autocalls.ai/api/user/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{
"message": "Campaign deleted successfully"
}
{
"message": "Campaign not found"
}
This endpoint allows you to delete a campaign that belongs to the authenticated user. If the campaign is currently running, it is stopped automatically before deletion.
Path Parameters
integer
required
The unique identifier of the campaign to delete
Response
string
Confirmation message indicating the campaign was deleted successfully
Error Responses
Show Error Response
Show Error Response
string
Error message when the campaign is not found or doesn’t belong to the authenticated user
{
"message": "Campaign deleted successfully"
}
{
"message": "Campaign not found"
}
Notes
- Only campaigns that belong to the authenticated user can be deleted
- Running campaigns are stopped automatically before deletion
- All leads attached to the campaign are removed
- Phone number assignments on the campaign are released
⌘I

