Commit a reviewed import session
const url = 'https://api.nsin.ir/domains/example.com/records/import-sessions/1/commit';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"mode":"all","records":[{"name":"example","type":"A","destination":"example","ttl":1,"mx_priority":1,"proxied":true}]}'};
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.ir/domains/example.com/records/import-sessions/1/commit \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "mode": "all", "records": [ { "name": "example", "type": "A", "destination": "example", "ttl": 1, "mx_priority": 1, "proxied": true } ] }'Writes the reviewed set into the domain’s records and into DNS. Requires
records.edit, and the session must be ready.
mode: "selected"withrecords— commits exactly what you post. This is the reviewed path: send back the rows you kept, with theproxiedflags you chose.mode: "all", an emptyrecords, or no body at all — commits the session’s own preselected rows with the proxy defaults it staged (every one of them off).
An existing record with the same name and type is overwritten. Per-row
problems come back in failed and never abort the batch.
The session is claimed before anything is written, so a second click
loses the race and gets 409 rather than importing twice. A whole-import
failure — the plan’s record limit — releases the session back to ready,
so you can upgrade and commit the same staged rows again.
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.comNumeric id of the record import session. Sessions are resolved within the domain, so an id from another domain reads as not found.
Request Body
Section titled “Request Body ”Omit the body entirely to commit the session’s own preselected rows —
that is the same as {"mode": "all"}.
object
selected commits records exactly as posted. all — or an empty
records — commits the rows the session preselected, with the proxy
defaults it staged.
The reviewed set. Rows may be dropped, and proxied may be switched
on per row, but a row must still be one the plan and the address
rules accept.
object
Responses
Section titled “ Responses ”Import outcome, plus the domain’s full record list afterwards.
object
Existing records replaced by a staged row of the same name and type.
Per-row failures. They never abort the batch — everything else was still written.
object
The domain’s full record list after the commit.
object
Record name relative to the domain. @ is the apex.
The fully-qualified name, with trailing dot.
The record’s value. For a proxied record this is the origin the
edge connects to, and the published DNS answer is the NSIN proxy IP
instead — see dns_content.
What is actually published in DNS. Equals the proxy IP for proxied records.
TTL in seconds.
Route this hostname through the NSIN edge. Only A, AAAA, CNAME
and ANAME may be proxied.
Challenge visitors before passing them to the origin.
False for records NSIN manages on your behalf.
The platform feature that owns this record, or empty for a record
you created. email_routing marks the MX, SPF and DKIM rows Email
Routing publishes; they are removed by disabling routing, never
through the record endpoints (which refuse them while locked).
Protocol the edge uses to reach the origin for a proxied record.
Default follows the request’s own scheme; Auto probes.
Origin port for proxied records. Default: 443.
Overrides the Host header (and SNI) sent to the origin.
Include this record in uptime monitoring.
ISO country code of the destination, detected by NSIN.
How long an edge node waits for the origin to start responding before returning 504, in seconds. Default 15, maximum 1800 (30 minutes). Only applies to proxied records.
Only meaningful for MX.
Free-form note.
External-DNS domains, proxied records only. Whether the name
resolves to NSIN’s edge, as last checked: ok — every address it
resolves to is ours; miss — it resolves elsewhere, only partly to
us, or not at all; error — the first lookup failed and nothing is
known yet. Absent until the first check, and always absent on a
managed-DNS domain.
How an ok record reaches NSIN: through the CNAME target
(cname), by publishing our address directly (a), or proxy —
DNS points at another CDN or proxy, but that service forwards to
NSIN and the edge is serving the host (judged from the last 24h of
request logs). A CNAME keeps working when our addresses change; an
A record does not.
What the name actually resolves to, for display.
Example
{ "records": [ { "name": "www", "original_name": "www.example.com.", "type": "A", "scheme": "Http", "timeout": 15, "edge_status": "ok", "edge_via": "cname" } ]}Nothing to commit — mode: "selected" with no usable rows, or a
session whose every row was unsupported.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "no records to import"}Missing, malformed, revoked or expired API key — or the owning account is inactive.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "invalid API key"}The domain has no active plan, so records cannot be created.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}Read-only key, insufficient role, or the import would exceed the
plan’s record limit. The session stays ready and can be committed
again after an upgrade.
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 import session, the session belongs to another domain, or the domain is not visible to this account.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "import session not found"}The domain is disabled, the session is not ready, or somebody
else — a second click, or the auto-commit — already claimed it. The
body carries the session’s current status.
object
Human-readable description of what went wrong.
The session’s status as it stands now, so a loser of the claim race can tell “already committed” from “discarded”.
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"}