Skip to content

Rescan, superseding an import session

POST
/domains/{domain}/records/import-sessions/{sessionId}/rescan
curl --request POST \
--url https://api.nsin.ir/domains/example.com/records/import-sessions/1/rescan \
--header 'Authorization: Bearer <token>'

Marks this session superseded and starts a fresh one against the same nameservers the original scan read. Requires records.edit.

Reusing the stored nameservers is the whole point: once the domain is delegated to NSIN, resolving its nameservers again finds ours, and a rescan would transfer our own still-empty zone and report that the old provider had nothing.

The old session is kept rather than rewritten, so a rescan can never race a commit already in flight, and the record of what was originally found survives.

domain
required
string

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

Example
example.com
sessionId
required
integer

Numeric id of the record import session. Sessions are resolved within the domain, so an id from another domain reads as not found.

An open session already existed and is returned unchanged.

Media type application/json

One scan-and-review cycle for a domain — the envelope every import-session endpoint returns.

object
id
integer
domain_id
integer
status

scanning — the sweep is running. ready — waiting for a commit or a discard. committing — a commit is in flight and holds the claim. auto_committed — nobody answered before auto_commit_at and the records were written anyway, rather than leaving the zone empty. superseded — replaced by a rescan.

string
Allowed values: scanning ready committing committed auto_committed discarded superseded failed
source
string
Allowed values: manual_scan domain_create zone_file
client

What started the session. An API key has nowhere to show a review screen, so adding a domain with a key still imports automatically; staged review is the panel path.

string
Allowed values: panel api
method

Which branch found the records — a full zone transfer, or a resolver sweep of common names. The first support question about a bad import is where the records came from.

string
Allowed values: axfr scan
source_ns

The nameservers this scan read. Stored because a rescan has to reuse them: once the domain is delegated to NSIN, resolving it again finds our own — still empty — zone.

Array<string>
error

Why the scan, or the last commit attempt, failed.

string
started_at
string format: date-time
finished_at

When the scan finished and the session turned ready.

string format: date-time
committed_at
string format: date-time
auto_commit_at

When an unanswered ready session commits itself. Cleared by a commit, a discard or a rescan.

string format: date-time
counts

The header line of a review screen.

object
total
integer
preselected

Rows a mode "all" commit would write.

integer
proxied
integer
warnings

Rows carrying at least one warning.

integer
records

Empty while status is scanning.

Array<object>

One record the scan found, with the verdict a reviewer needs.

object
id

Staging row id. It is not a record id — it exists only until the session is committed or discarded.

integer
name
string
type
string
Allowed values: A AAAA CNAME ANAME NS TXT MX SRV PTR CAA TLSA SSHFP URI
destination
string
ttl
integer
mx_priority
integer
proxied

Whether this row would be proxied — and, because a mode: "all" commit (the unattended auto_commit_at one included) writes exactly this flag, what happens to the row if nobody answers.

It is true for the rows the edge can carry: a proxyable type on a routable origin. It is false wherever proxying would take a service away rather than accelerate it — a mail host, the target of an in-zone MX, an underscored name (_acme-challenge, selector1._domainkey), or a label that names something that does not speak HTTP (ssh, vpn, mysql, ns1, …). Those rows carry a mail_host or non_web_service warning saying so.

An overwrite row mirrors the record it would replace: an import refreshes content and TTL and never changes an existing record’s proxy setting.

boolean
status

overwrite means the domain already holds a record with this name and type and it would be replaced. TXT is never overwrite: many TXT records share one name.

string
Allowed values: new overwrite unsupported
existing_id

The record that would be replaced. Set when status is overwrite.

integer
proxy_eligible

Whether this row could be proxied if you switched it on — a proxyable type pointing at an address the edge will accept.

boolean
preselected

Whether the row is included when you commit with mode: "all". Rows carrying an error warning arrive unticked.

boolean
warnings
Array<object>

One reviewer-facing note on a staged row. code is stable — branch on it rather than on message, which is prose and may change.

object
code
string
Allowed values: unsupported not_proxyable_type private_address points_at_nsin proxy_ineligible_origin mail_host non_web_service overwrite wildcard
severity

Only error rows arrive unticked (preselected: false) — they are the ones NSIN cannot import at all.

string
Allowed values: info warning error
message
string
reason

The first warning’s message, kept for clients written against the flat scan preview.

string
Example
{
"status": "scanning",
"source": "manual_scan",
"client": "panel",
"method": "axfr",
"records": [
{
"type": "A",
"status": "new",
"warnings": [
{
"code": "unsupported",
"severity": "info"
}
]
}
]
}

The replacement session was created and its scan is running.

Media type application/json

One scan-and-review cycle for a domain — the envelope every import-session endpoint returns.

object
id
integer
domain_id
integer
status

scanning — the sweep is running. ready — waiting for a commit or a discard. committing — a commit is in flight and holds the claim. auto_committed — nobody answered before auto_commit_at and the records were written anyway, rather than leaving the zone empty. superseded — replaced by a rescan.

string
Allowed values: scanning ready committing committed auto_committed discarded superseded failed
source
string
Allowed values: manual_scan domain_create zone_file
client

What started the session. An API key has nowhere to show a review screen, so adding a domain with a key still imports automatically; staged review is the panel path.

string
Allowed values: panel api
method

Which branch found the records — a full zone transfer, or a resolver sweep of common names. The first support question about a bad import is where the records came from.

string
Allowed values: axfr scan
source_ns

The nameservers this scan read. Stored because a rescan has to reuse them: once the domain is delegated to NSIN, resolving it again finds our own — still empty — zone.

Array<string>
error

Why the scan, or the last commit attempt, failed.

string
started_at
string format: date-time
finished_at

When the scan finished and the session turned ready.

string format: date-time
committed_at
string format: date-time
auto_commit_at

When an unanswered ready session commits itself. Cleared by a commit, a discard or a rescan.

string format: date-time
counts

The header line of a review screen.

object
total
integer
preselected

Rows a mode "all" commit would write.

integer
proxied
integer
warnings

Rows carrying at least one warning.

integer
records

Empty while status is scanning.

Array<object>

One record the scan found, with the verdict a reviewer needs.

object
id

Staging row id. It is not a record id — it exists only until the session is committed or discarded.

integer
name
string
type
string
Allowed values: A AAAA CNAME ANAME NS TXT MX SRV PTR CAA TLSA SSHFP URI
destination
string
ttl
integer
mx_priority
integer
proxied

Whether this row would be proxied — and, because a mode: "all" commit (the unattended auto_commit_at one included) writes exactly this flag, what happens to the row if nobody answers.

It is true for the rows the edge can carry: a proxyable type on a routable origin. It is false wherever proxying would take a service away rather than accelerate it — a mail host, the target of an in-zone MX, an underscored name (_acme-challenge, selector1._domainkey), or a label that names something that does not speak HTTP (ssh, vpn, mysql, ns1, …). Those rows carry a mail_host or non_web_service warning saying so.

An overwrite row mirrors the record it would replace: an import refreshes content and TTL and never changes an existing record’s proxy setting.

boolean
status

overwrite means the domain already holds a record with this name and type and it would be replaced. TXT is never overwrite: many TXT records share one name.

string
Allowed values: new overwrite unsupported
existing_id

The record that would be replaced. Set when status is overwrite.

integer
proxy_eligible

Whether this row could be proxied if you switched it on — a proxyable type pointing at an address the edge will accept.

boolean
preselected

Whether the row is included when you commit with mode: "all". Rows carrying an error warning arrive unticked.

boolean
warnings
Array<object>

One reviewer-facing note on a staged row. code is stable — branch on it rather than on message, which is prose and may change.

object
code
string
Allowed values: unsupported not_proxyable_type private_address points_at_nsin proxy_ineligible_origin mail_host non_web_service overwrite wildcard
severity

Only error rows arrive unticked (preselected: false) — they are the ones NSIN cannot import at all.

string
Allowed values: info warning error
message
string
reason

The first warning’s message, kept for clients written against the flat scan preview.

string
Example
{
"status": "scanning",
"source": "manual_scan",
"client": "panel",
"method": "axfr",
"records": [
{
"type": "A",
"status": "new",
"warnings": [
{
"code": "unsupported",
"severity": "info"
}
]
}
]
}

Missing, malformed, revoked or expired API key — or the owning account is inactive.

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 import session, the session belongs to another domain, or the domain is not visible to this account.

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 notFound
{
"error": "import session not found"
}

The domain is disabled, or this session is being committed right now and cannot be superseded.

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 committing
{
"error": "this import is being committed"
}

A scan for this domain ran less than five minutes ago. One scan is up to roughly 1100 outbound DNS queries, so it is throttled per domain — this is separate from, and additional to, the per-key rate limit. Wait retry_after_seconds and retry.

Media type application/json
object
error
required

Human-readable description of what went wrong.

string
retry_after_seconds

Seconds left on this domain’s five-minute scan window.

integer
Examples
Example throttled
{
"error": "a scan for this domain ran a moment ago; please wait before scanning again",
"retry_after_seconds": 173
}