Contacts
Delete Contact by ID
Deletes a contact by its id.
DELETE
/
contacts
/
{id}
curl --request DELETE \
--url https://api.autosend.com/v1/contacts/{id} \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.autosend.com/v1/contacts/{id}"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contacts/{id}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer <token>'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contacts/{id}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/contacts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer <token>")
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 DeleteContactById {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contacts/{id}");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer <token>");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/contacts/{id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri.path)
request['Authorization'] = 'Bearer <token>'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Contact deleted successfully"
}
curl --request DELETE \
--url https://api.autosend.com/v1/contacts/{id} \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.autosend.com/v1/contacts/{id}"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contacts/{id}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer <token>'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contacts/{id}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/contacts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer <token>")
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 DeleteContactById {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contacts/{id}");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer <token>");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/contacts/{id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri.path)
request['Authorization'] = 'Bearer <token>'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Contact deleted successfully"
}
Authorizations
Bearer authentication header of the form Bearer
<token>, where <token> is your auth token.Path Parameters
Single contact idExample:
"507f1f77bcf86cd799439011"Response
Contact deleted successfullyExample:
trueConfirmation message.Example:
"Contact deleted successfully"Error Responses
Returned when a database error occurs during deletion.
{
"success": false,
"error": {
"message": "Contact deletion failed. Please try again.",
"code": "CONTACT_DELETION_FAILED",
"status": 500
}
}
Related topics
Delete Contact by User IDDelete Contact ListDelete Contact Property by NameWas this page helpful?
⌘I
curl --request DELETE \
--url https://api.autosend.com/v1/contacts/{id} \
--header 'Authorization: Bearer <token>'
import requests
url = "https://api.autosend.com/v1/contacts/{id}"
headers = {
"Authorization": "Bearer <token>"
}
response = requests.delete(url, headers=headers)
print(response.json())
fetch('https://api.autosend.com/v1/contacts/{id}', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer <token>'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
<?php
$url = 'https://api.autosend.com/v1/contacts/{id}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer <token>'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"fmt"
"net/http"
)
func main() {
url := "https://api.autosend.com/v1/contacts/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Set("Authorization", "Bearer <token>")
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 DeleteContactById {
public static void main(String[] args) {
try {
URL url = new URL("https://api.autosend.com/v1/contacts/{id}");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Authorization", "Bearer <token>");
int status = con.getResponseCode();
System.out.println("Response Status: " + status);
} catch (Exception e) {
e.printStackTrace();
}
}
}
require 'net/http'
require 'uri'
uri = URI('https://api.autosend.com/v1/contacts/{id}')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri.path)
request['Authorization'] = 'Bearer <token>'
response = http.request(request)
puts response.body
{
"success": true,
"message": "Contact deleted successfully"
}