Projects
Delete Project
Deletes a project by its ID. The project must belong to the organization. Requires an organization admin API key (ASA_ prefix). No OTP verification is required for admin API key callers.
DELETE
/
account
/
projects
/
{projectId}
curl --request DELETE \
--url https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234 \
--header 'Authorization: Bearer ASA_your-admin-api-key'
import requests
url = "https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234"
headers = {
"Authorization": "Bearer ASA_your-admin-api-key"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer ASA_your-admin-api-key'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$projectId = '60d5ec49f1b2c72d9c8b1234';
$url = "https://api.autosend.com/v1/account/projects/{$projectId}";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ASA_your-admin-api-key'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer ASA_your-admin-api-key")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class DeleteProject {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer ASA_your-admin-api-key");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
con.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer ASA_your-admin-api-key'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Project deleted successfully"
}
This endpoint requires an organization admin API key (
ASA_ prefix). Standard project API keys cannot access this endpoint.This action deletes the project and all associated resources (domains, senders, templates, campaigns, contacts). This cannot be undone.
curl --request DELETE \
--url https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234 \
--header 'Authorization: Bearer ASA_your-admin-api-key'
import requests
url = "https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234"
headers = {
"Authorization": "Bearer ASA_your-admin-api-key"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer ASA_your-admin-api-key'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$projectId = '60d5ec49f1b2c72d9c8b1234';
$url = "https://api.autosend.com/v1/account/projects/{$projectId}";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ASA_your-admin-api-key'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer ASA_your-admin-api-key")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class DeleteProject {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer ASA_your-admin-api-key");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
con.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer ASA_your-admin-api-key'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Project deleted successfully"
}
Authorizations
Organization admin API key header of the form Bearer
ASA_<key>. Standard project API keys (AS_ prefix) will receive a 403 error.Path Parameters
The unique identifier of the project to delete. The project must belong to the authenticated organization.Example:
"60d5ec49f1b2c72d9c8b1234"Response
Project deleted successfullyIndicates if the request was successfulExample:
trueConfirmation messageExample:
"Project deleted successfully"Error Responses
Returned when using a standard project API key instead of an organization admin API key.
{
"success": false,
"error":{
"message":"This endpoint requires an organization admin API key (ASA_ prefix)"
}
}
Returned when the
projectId parameter is not valid.{
"success": false,
"error": [
{
"message": "Invalid project ID"
}
]
}
Returned when the project does not exist or does not belong to the organization.
{
"success": false,
"error": {
"message": "Project not found"
}
}
Returned when attempting to delete the only remaining project in the organization.
{
"success": false,
"error": {
"message": "Cannot delete the last project in the organization. At least one project must exist.",
"code": "LAST_PROJECT_CANNOT_BE_DELETED",
"status": 400
}
}
Was this page helpful?
⌘I
curl --request DELETE \
--url https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234 \
--header 'Authorization: Bearer ASA_your-admin-api-key'
import requests
url = "https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234"
headers = {
"Authorization": "Bearer ASA_your-admin-api-key"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer ASA_your-admin-api-key'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$projectId = '60d5ec49f1b2c72d9c8b1234';
$url = "https://api.autosend.com/v1/account/projects/{$projectId}";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ASA_your-admin-api-key'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer ASA_your-admin-api-key")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
import java.net.HttpURLConnection;
import java.net.URL;
public class DeleteProject {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer ASA_your-admin-api-key");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
con.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/account/projects/60d5ec49f1b2c72d9c8b1234')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Authorization'] = 'Bearer ASA_your-admin-api-key'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Project deleted successfully"
}