POST /domains/{domain}/delete
Deletion is irreversible. Once processed, the domain is removed from your account and may become available for others to register. Do not call this unless you intend to give up the domain.
Parameters
text
required
The domain to delete, for example
example.com.Request
API_KEY="your-api-key"
EMAIL="[email protected]"
ENDPOINT="https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php"
TS=$(date -u +"%y-%m-%d %H")
TOKEN=$(printf '%s' "$API_KEY" \
| openssl dgst -sha256 -hmac "$EMAIL:$TS" -hex \
| sed 's/^.*= //' | tr -d '\n' | base64 -w0)
curl -s "$ENDPOINT/domains/example.com/delete" \
-H "username: $EMAIL" \
-H "token: $TOKEN" \
-X POST
<?php
$apiKey = "your-api-key";
$email = "[email protected]";
$endpoint = "https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php";
$token = base64_encode(hash_hmac("sha256", $apiKey, "{$email}:" . gmdate("y-m-d H")));
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "{$endpoint}/domains/example.com/delete");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
"username: {$email}",
"token: {$token}",
]);
echo curl_exec($curl);
curl_close($curl);
import base64, hashlib, hmac
from datetime import datetime, timezone
import requests
API_KEY = "your-api-key"
EMAIL = "[email protected]"
ENDPOINT = "https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php"
def token() -> str:
ts = datetime.now(timezone.utc).strftime("%y-%m-%d %H")
digest = hmac.new(f"{EMAIL}:{ts}".encode(), API_KEY.encode(), hashlib.sha256).hexdigest()
return base64.b64encode(digest.encode()).decode()
resp = requests.post(f"{ENDPOINT}/domains/example.com/delete",
headers={"username": EMAIL, "token": token()})
print(resp.status_code, resp.json())
import crypto from "node:crypto";
const API_KEY = "your-api-key";
const EMAIL = "[email protected]";
const ENDPOINT = "https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php";
function token() {
const ts = new Date().toISOString().slice(2, 13).replace("T", " "); // "yy-mm-dd HH" UTC
const digest = crypto.createHmac("sha256", `${EMAIL}:${ts}`).update(API_KEY).digest("hex");
return Buffer.from(digest, "utf8").toString("base64");
}
const res = await fetch(`${ENDPOINT}/domains/example.com/delete`, {
method: "POST",
headers: { username: EMAIL, token: token() },
});
console.log(res.status, await res.json());
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"fmt"
"io"
"net/http"
"time"
)
const (
apiKey = "your-api-key"
email = "[email protected]"
endpoint = "https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php"
)
func token() string {
ts := time.Now().UTC().Format("06-01-02 15") // yy-mm-dd HH
mac := hmac.New(sha256.New, []byte(email+":"+ts))
mac.Write([]byte(apiKey))
return base64.StdEncoding.EncodeToString([]byte(hex.EncodeToString(mac.Sum(nil))))
}
func main() {
req, _ := http.NewRequest("POST", endpoint+"/domains/example.com/delete", nil)
req.Header.Set("username", email)
req.Header.Set("token", token())
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
Response
On success, the API returns a success status once the deletion request is submitted. This call was not run against the sandbox because it is destructive. Expect the same success shape as other management writes:{"status":"success","message":"","success":"success"}