Skip to content

Create a DNS record

POST
/domains/{domain}/records/
curl --request POST \
--url https://api.nsin.ir/domains/example.com/records/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "type": "A", "destination": "example", "mx_priority": 1, "proxied": false, "captcha": false, "scheme": "Http", "port": 443, "host_header": "example", "monitor": true, "dest_country": "example", "timeout": 15, "comment": "example" }'

Creates one record and publishes it to the DNS zone.

Setting proxied: true routes the hostname through the NSIN edge: the published DNS answer becomes the NSIN proxy IP and destination becomes the origin the edge connects to. Only A, AAAA, CNAME and ANAME can be proxied. 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
name
required

Name relative to the domain. Use @ for the apex.

string
type
required
string
Allowed values: A AAAA CNAME ANAME NS TXT MX SRV PTR CAA TLSA SSHFP URI
destination
required

IP address, hostname or text content.

string
mx_priority
integer
<= 65535
proxied
boolean
captcha
boolean
scheme

Protocol the edge uses to reach the origin for a proxied record. Default follows the request’s own scheme; Auto probes.

string
Allowed values: Http Https Auto Default
port
integer
default: 443
host_header
string
monitor
boolean
dest_country
string
timeout
integer
default: 15
comment
string
<= 1024 characters

Record created.

Media type application/json
object
id
integer
name

Record name relative to the domain. @ is the apex.

string
original_name

The fully-qualified name, with trailing dot.

string
type
string
Allowed values: A AAAA CNAME ANAME NS TXT MX SRV PTR CAA TLSA SSHFP URI
destination

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.

string
dns_content

What is actually published in DNS. Equals the proxy IP for proxied records.

string
ttl

TTL in seconds.

integer
proxied

Route this hostname through the NSIN edge. Only A, AAAA, CNAME and ANAME may be proxied.

boolean
captcha

Challenge visitors before passing them to the origin.

boolean
editable

False for records NSIN manages on your behalf.

boolean
user_id
integer
domain_id
integer
scheme

Protocol the edge uses to reach the origin for a proxied record. Default follows the request’s own scheme; Auto probes.

string
Allowed values: Http Https Auto Default
port

Origin port for proxied records. Default: 443.

integer
host_header

Overrides the Host header (and SNI) sent to the origin.

string
monitor

Include this record in uptime monitoring.

boolean
dest_country

ISO country code of the destination, detected by NSIN.

string
timeout

Upstream timeout in seconds. Default: 15.

integer
mx_priority

Only meaningful for MX.

integer
<= 65535
comment

Free-form note.

string
<= 1024 characters
created_at
string format: date-time
updated_at
string format: date-time
Example
{
"name": "www",
"original_name": "www.example.com.",
"type": "A",
"scheme": "Http"
}

Invalid record — bad type, malformed destination, or a value the zone rejects.

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 domain is disabled, or a conflicting record already exists.

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