Discard an import session
const url = 'https://api.nsin.ir/domains/example.com/records/import-sessions/1';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.nsin.ir/domains/example.com/records/import-sessions/1 \ --header 'Authorization: Bearer <token>'The “skip for now” path: the staged rows are dropped, nothing is written
to the zone, and the auto-commit is cancelled — somebody who explicitly
skipped the review must not get a surprise import hours later. Requires
records.edit.
The records themselves are untouched at the old provider; run another scan whenever you want them.
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.
Responses
Section titled “ Responses ”Discarded.
object
How many staged rows were thrown away.
Example generated
{ "discarded": true, "records_dropped": 1}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 key is read-only, your role on the domain lacks the required permission, or the domain’s plan does not include the feature.
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 session is no longer open — it has already been committed,
superseded by a rescan, or discarded. The body carries its 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"}