Skip to content
nsin docs

Delete a domain

DELETE
/domains/{domain}
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.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com
Media type application/json
object
reason

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.

string
Allowed values: re_add keep_own_dns external_hassle site_not_working too_expensive moving_away not_needed other
note

Free text. Longer notes are cut to 500 characters. A note sent without a reason is stored as other.

string
<= 500 characters
Example
{
"reason": "keep_own_dns",
"note": "My registrar won't let me change nameservers."
}

Deleted.

Media type application/json
object
message
string
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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
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.)

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
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.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}