Add a domain
const url = 'https://api.nsin.cloud/domains/';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example.com","dns_mode":"managed"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.nsin.cloud/domains/ \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example.com", "dns_mode": "managed" }'Registers a domain on your account.
dns_mode: managed(default) — NSIN hosts the zone. The domain starts inpendinguntil its nameservers point at the NSIN set returned byGET /domains/ns-sets, then flips toactiveautomatically.dns_mode: external— you keep DNS elsewhere. The domain starts inunverifiedand you prove ownership with the TXT record from theverificationblock, then callPOST /domains/{domain}/verify.
Existing records are scanned and imported in the background for managed domains.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
The domain to add, without scheme or trailing dot.
Responses
Section titled “ Responses ”Domain created.
object
pending— managed domain waiting for its nameservers to point at NSIN.unverified— external-DNS domain waiting for its TXT verification record.active— serving.moved— delegation has left NSIN; the domain keeps serving during a grace window.disabled— not serving; re-enable withPOST /domains/{domain}/enable.banned— administratively blocked.
managed — NSIN hosts the DNS zone. external — you host DNS
elsewhere and prove ownership with a TXT record.
Id of the owning user.
Per-domain cap on disk (L2) cache size, in GB.
How long a disk-cache entry may live, in days. Maximum 7.
Largest response body NSIN will buffer and cache, in MB. Bigger responses stream straight from origin and are never cached. The selectable ceiling depends on the domain’s plan.
While set and in the future, the edge bypasses cache reads and writes for this domain. Absent when developer mode is off.
When the background nameserver checker will next look at this domain.
Last user-triggered nameserver check; these are limited to one per hour.
Send X-Content-Type-Options: nosniff. Off by default — it can break
an origin that mislabels asset MIME types.
Send Referrer-Policy: strict-origin-when-cross-origin.
Strip origin fingerprint headers from responses.
Serve a Markdown rendering of eligible HTML pages to clients sending
Accept: text/markdown. Requires an active plan.
Notify the owner when a subdomain suffers a sustained origin outage.
Per-minute origin-error percentage that counts as “down”.
Minutes the domain must stay down before an incident opens.
Minimum origin-eligible requests in the window — the traffic floor below which no incident opens.
Minimum populated one-minute buckets required in the window.
Consecutive clear minutes before an incident resolves.
Paused for billing. The edge refuses the domain’s TLS handshake, so visitors get a connection error. Clears automatically once the wallet is no longer negative.
The TXT record to publish to prove ownership of an external-DNS domain.
object
Name to create the TXT record at.
Exact TXT value to publish.
The canonical (first) accepted nameserver set.
Every accepted nameserver set. The delegation must match exactly one set in full — sets cannot be mixed.
The nameservers currently observed in the parent zone.
Your role on a domain. owner is implicit for the domain’s creator and
for global admins; the other three are grantable via sharing.
How often the background checker re-checks the delegation.
Example
{ "name": "example.com", "status": "pending", "dns_mode": "managed", "cache_cap_mb": 128, "verification": { "type": "TXT" }, "my_role": "owner", "my_permissions": [ "domain.view" ]}Invalid or unsupported domain name.
The error shape used by every endpoint. error is always present. code
is present only on the failures that have one — do not require it, and do
not parse error to recover it.
object
Human-readable description of what went wrong.
Stable machine-readable reason. Present on some failures only; the
wording of error may change, this will not.
account_suspended—403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.domain_disabled—409, not403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.managed_by_reseller—403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.invite_email_mismatch—403fromPOST /invites/{token}/accept. The invitation was addressed to a different email; the body also carriesinvited_email, masked.
A panel session — not an API key — can additionally see
session_check_failed on a 503, which means the session could not
be verified, not that it is invalid. Retry it; do not discard the
token.
Example
{ "error": "read-only API key"}Missing, malformed, revoked or expired API key, or a key whose owning
user row is gone. A key whose owning account has merely been deactivated
is not this: that is 403 with code: account_suspended, because the
credential itself is intact and re-issuing it changes nothing.
The error shape used by every endpoint. error is always present. code
is present only on the failures that have one — do not require it, and do
not parse error to recover it.
object
Human-readable description of what went wrong.
Stable machine-readable reason. Present on some failures only; the
wording of error may change, this will not.
account_suspended—403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.domain_disabled—409, not403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.managed_by_reseller—403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.invite_email_mismatch—403fromPOST /invites/{token}/accept. The invitation was addressed to a different email; the body also carriesinvited_email, masked.
A panel session — not an API key — can additionally see
session_check_failed on a 503, which means the session could not
be verified, not that it is invalid. Retry it; do not discard the
token.
Examples
{ "error": "invalid API key"}The key is read-only and this endpoint is a write. Read-only keys may
only issue GET, HEAD and OPTIONS.
The error shape used by every endpoint. error is always present. code
is present only on the failures that have one — do not require it, and do
not parse error to recover it.
object
Human-readable description of what went wrong.
Stable machine-readable reason. Present on some failures only; the
wording of error may change, this will not.
account_suspended—403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.domain_disabled—409, not403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.managed_by_reseller—403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.invite_email_mismatch—403fromPOST /invites/{token}/accept. The invitation was addressed to a different email; the body also carriesinvited_email, masked.
A panel session — not an API key — can additionally see
session_check_failed on a 503, which means the session could not
be verified, not that it is invalid. Retry it; do not discard the
token.
Examples
{ "error": "read-only API key"}The domain already exists on this or another account.
The error shape used by every endpoint. error is always present. code
is present only on the failures that have one — do not require it, and do
not parse error to recover it.
object
Human-readable description of what went wrong.
Stable machine-readable reason. Present on some failures only; the
wording of error may change, this will not.
account_suspended—403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.domain_disabled—409, not403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.managed_by_reseller—403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.invite_email_mismatch—403fromPOST /invites/{token}/accept. The invitation was addressed to a different email; the body also carriesinvited_email, masked.
A panel session — not an API key — can additionally see
session_check_failed on a 503, which means the session could not
be verified, not that it is invalid. Retry it; do not discard the
token.
Example
{ "error": "read-only API key"}The key exceeded its request budget (300 requests per minute by default).
The error shape used by every endpoint. error is always present. code
is present only on the failures that have one — do not require it, and do
not parse error to recover it.
object
Human-readable description of what went wrong.
Stable machine-readable reason. Present on some failures only; the
wording of error may change, this will not.
account_suspended—403. The account behind the credential has been switched off, by an admin or by its provider. Every authenticated route answers this, so treat it as terminal rather than retrying.domain_disabled—409, not403. You have every right to the operation; the domain is simply switched off and is not being served, so its configuration cannot change. It stays readable, and writes work again once it is enabled.managed_by_reseller—403. The account is a reseller’s client and this surface belongs to its provider. See If your account is managed by a reseller.invite_email_mismatch—403fromPOST /invites/{token}/accept. The invitation was addressed to a different email; the body also carriesinvited_email, masked.
A panel session — not an API key — can additionally see
session_check_failed on a 503, which means the session could not
be verified, not that it is invalid. Retry it; do not discard the
token.
Examples
{ "error": "rate limit exceeded"}