Delete a domain
const url = 'https://api.nsin.ir/domains/example.com';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"reason":"keep_own_dns","note":"My registrar won\'t let me change nameservers."}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.nsin.ir/domains/example.com \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "reason": "keep_own_dns", "note": "My registrar won'\''t let me change nameservers." }'Removes the domain with its records, certificates, email routing and
DNS zone, drops every member and pending invitation, and cancels its
plan (auto-renew is switched off; unused time is not refunded). The
edge stops serving it straight away. Owner only (domain.delete).
This cannot be undone from the API.
If you only want to change how the domain’s DNS is run, you don’t need
to delete it: PUT /domains/{domain} with dns_mode switches between
managed and external and keeps records, rules, certificates and
the plan.
The body is optional. When you send one, it records why the domain is being deleted.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The domain name (for example example.com) — not a numeric id.
Example
example.comRequest Body
Section titled “Request Body ”object
Why the domain is being deleted. re_add: to add it again
with different settings. keep_own_dns: the nameservers
can’t or won’t move to NSIN. external_hassle: keeping
records and SSL in sync at another DNS provider is too much
work.
Free text. Longer notes are cut to 500 characters. A note
sent without a reason is stored as other.
Example
{ "reason": "keep_own_dns", "note": "My registrar won't let me change nameservers."}Responses
Section titled “ Responses ”Deleted.
object
Example
{ "message": "deleted"}The body is JSON but can’t be read, or reason isn’t one of the listed codes. The domain is not deleted.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}The key is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "rate limit exceeded"}