Delete Domain
curl --request DELETE \
--url https://api.example.com/domains/{identifier}import requests
url = "https://api.example.com/domains/{identifier}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/domains/{identifier}', 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.example.com/domains/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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.example.com/domains/{identifier}"
req, _ := http.NewRequest("DELETE", url, nil)
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.example.com/domains/{identifier}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/domains/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Domains
Delete Domain
Delete a domain
Delete Domain
curl --request DELETE \
--url https://api.example.com/domains/{identifier}import requests
url = "https://api.example.com/domains/{identifier}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://api.example.com/domains/{identifier}', 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.example.com/domains/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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.example.com/domains/{identifier}"
req, _ := http.NewRequest("DELETE", url, nil)
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.example.com/domains/{identifier}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/domains/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Description
Delete a domain from your account. You won’t be able to send from this domain after deletion.Parameters
Domain ID or name.
Response
ID of the deleted domain.
Examples
curl -X DELETE https://api.usesendly.app/v1/domains/mail.yourdomain.com \
-H "Authorization: Bearer se_your_api_key"
const result = await client.domains.delete('mail.yourdomain.com')
console.log(`Domain deleted: ${result.id}`)
import { Sendly } from '@sendlyapp/sdk'
const client = new Sendly()
await client.domains.delete('mail.yourdomain.com')
Important Notes
- ⚠️ This action cannot be undone
- You cannot send from this domain after deletion
- DNS records may remain in your provider (remove manually)
Need help? Contact support@usesendly.app
⌘I