Skip to content

Import records

POST
/domains/{domain}/records/import
curl --request POST \
--url https://api.nsin.ir/domains/example.com/records/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "records": [ { "name": "example", "type": "A", "destination": "example", "ttl": 1, "mx_priority": 1, "proxied": true } ] }'

Creates the supplied records, overwriting any existing record with the same name and type. Best-effort per record — the response counts what succeeded and lists what failed. Requires records.edit.

domain
required
string

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

Example
example.com
Media type application/json
object
records
required
Array<object>
object
name
required
string
type
required
string
Allowed values: A AAAA CNAME ANAME NS TXT MX SRV PTR CAA TLSA SSHFP URI
destination
required
string
ttl
integer
mx_priority
integer
proxied
boolean

Import outcome.

Media type application/json
object
created
integer
overwritten
integer
failed
Array<object>
object
name
string
type
string
error
string
Example generated
{
"created": 1,
"overwritten": 1,
"failed": [
{
"name": "example",
"type": "example",
"error": "example"
}
]
}

Malformed request body.

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 — 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 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"
}