Delete a domain
Auth: Authorization: Bearer nsin_… or X-Api-Key: nsin_… — see API keys.
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.
Path parameters
- domainstringrequiredpath
The domain name (for example
example.com) — not a numeric id.
Request body
Content type: application/json
- reasonstring
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.One of:"re_add""keep_own_dns""external_hassle""site_not_working""too_expensive""moving_away""not_needed""other" - notestring
Free text. Longer notes are cut to 500 characters. A note sent without a
reasonis stored asother.
Responses
200Deleted.
Content type: application/json
- messagestring
{
"message": "deleted"
}400The body is JSON but can't be read, or reason isn't one of the listed codes. The domain is not deleted.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}401Missing, malformed, revoked or expired API key. (A valid key whose
account has been deactivated gets 403 account is inactive instead.)
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "invalid API key"
}403The key is read-only, your role on the domain lacks the required permission, or the domain's plan does not include the feature.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}404No such domain, or it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "read-only API key"
}429The key exceeded its request budget (300 requests per minute by default).
Content type: application/json
- errorstringrequired
Human-readable description of what went wrong.
{
"error": "rate limit exceeded"
}Example request
curl -X DELETE "https://api.nsin.ir/domains/example.com" \
-H "Authorization: Bearer $NSIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reason": "keep_own_dns",
"note": "My registrar won'\''t let me change nameservers."
}'