Update a DNS record
const url = 'https://api.nsin.ir/domains/example.com/records/1';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","destination":"example","mx_priority":1,"proxied":true,"captcha":true,"scheme":"Http","port":1,"host_header":"example","monitor":true,"timeout":1,"comment":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.nsin.ir/domains/example.com/records/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "destination": "example", "mx_priority": 1, "proxied": true, "captcha": true, "scheme": "Http", "port": 1, "host_header": "example", "monitor": true, "timeout": 1, "comment": "example" }'Partial update — omitted fields keep their current value. Requires
records.edit.
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 DNS record.
Request Body required
Section titled “Request Body required ”Every field is optional; omitted fields keep their current value.
object
Protocol the edge uses to reach the origin for a proxied record.
Default follows the request’s own scheme; Auto probes.
Responses
Section titled “ Responses ”Updated record.
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.
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.
Upstream timeout in seconds. Default: 15.
Only meaningful for MX.
Free-form note.
Example
{ "name": "www", "original_name": "www.example.com.", "type": "A", "scheme": "Http"}Invalid value, or the record is not editable.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Example
{ "error": "read-only API key"}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"}Domain or record not found.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
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"}