cURL
curl -X DELETE "https://api.sendpost.io/api/v1/subaccount/domain/<domain_id>" \
-H "accept: application/json" \
-H "X-SubAccount-ApiKey: <subaccount_api_key>"
import requests
url = "https://api.sendpost.io/api/v1/subaccount/domain/<domain_id>"
headers = {
"accept": "application/json",
"X-SubAccount-ApiKey": "<subaccount_api_key>"
}
response = requests.delete(url, headers=headers)
print(response.json())
const options = {method: 'DELETE', headers: {'X-SubAccount-ApiKey': '<api-key>'}};
fetch('https://api.sendpost.io/api/v1/subaccount/domain/{domain_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.sendpost.io/api/v1/subaccount/domain/{domain_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 => [
"X-SubAccount-ApiKey: <api-key>"
],
]);
$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.sendpost.io/api/v1/subaccount/domain/{domain_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-SubAccount-ApiKey", "<api-key>")
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.sendpost.io/api/v1/subaccount/domain/{domain_id}")
.header("X-SubAccount-ApiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpost.io/api/v1/subaccount/domain/{domain_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-SubAccount-ApiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 123,
"message": "<string>"
}Domain
Delete Domain
Delete a specific domain using its id.
DELETE
/
subaccount
/
domain
/
{domain_id}
cURL
curl -X DELETE "https://api.sendpost.io/api/v1/subaccount/domain/<domain_id>" \
-H "accept: application/json" \
-H "X-SubAccount-ApiKey: <subaccount_api_key>"
import requests
url = "https://api.sendpost.io/api/v1/subaccount/domain/<domain_id>"
headers = {
"accept": "application/json",
"X-SubAccount-ApiKey": "<subaccount_api_key>"
}
response = requests.delete(url, headers=headers)
print(response.json())
const options = {method: 'DELETE', headers: {'X-SubAccount-ApiKey': '<api-key>'}};
fetch('https://api.sendpost.io/api/v1/subaccount/domain/{domain_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.sendpost.io/api/v1/subaccount/domain/{domain_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 => [
"X-SubAccount-ApiKey: <api-key>"
],
]);
$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.sendpost.io/api/v1/subaccount/domain/{domain_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("X-SubAccount-ApiKey", "<api-key>")
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.sendpost.io/api/v1/subaccount/domain/{domain_id}")
.header("X-SubAccount-ApiKey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpost.io/api/v1/subaccount/domain/{domain_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["X-SubAccount-ApiKey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": 123,
"message": "<string>"
}Authorizations
This api key can be used only for sub account level operations
Path Parameters
The unique ID of the domain to delete.
Was this page helpful?
⌘I