Skip to content
nsin docs

Update many records at once

POST
/domains/{domain}/records/batch-update
curl --request POST \
--url https://api.nsin.ir/domains/example.com/records/batch-update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "updates": [ { "id": 1, "name": "example", "destination": "example", "mx_priority": 1, "ttl": 120, "proxied": true, "captcha": true, "scheme": "Http", "port": 1, "host_header": "example", "host_header_mode": "own", "monitor": true, "timeout": 1, "comment": "example" } ] }'

Applies an update to many records in one request. Each item accepts exactly the same optional fields as a single PUT.

Best-effort: every record is processed independently, so one bad record does not abort the rest. The response always returns 200 with a per-record results array — check it rather than the status code. At most 1000 records per call. The edge is notified once for the whole batch. 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
updates
required
Array
object
id
required

Id of the record to update.

integer
name
string
destination

New value — see destination on Record.

string
mx_priority

MX priority. MX only.

integer
<= 65535
ttl

Seconds resolvers may cache this record. Forced to 120 while proxied is true — a proxied record answers with our edge addresses, and traffic can only be moved between edges as fast as the slowest resolver still holding the old answer.

integer
default: 120 >= 1 <= 604800
proxied

See proxied on RecordCreate.

boolean
captcha

Challenge visitors before passing them to the origin.

boolean
scheme

Protocol the edge uses to reach the origin of a proxied record.

  • Https — TLS to port (443 when the port is unset or out of range).
  • Http — plain HTTP to port (80 when unset or out of range).
  • Auto — HTTPS on 443 first, falling back to plain HTTP. The port is always 443.
  • Default — accepted on input, and so are an empty or unrecognised value, but stored as Auto with port 443: a record never reads back as Default.
string
Allowed values: Http Https Auto Default
port

See port on RecordCreate.

integer
host_header

See host_header on RecordCreate. An empty string removes the override.

string
host_header_mode

See host_header_mode on RecordCreate.

string
Allowed values: own target
monitor

Include this record in uptime monitoring.

boolean
timeout

Origin wait before 504, in seconds. Max 1800 (30 minutes).

integer
>= 1 <= 1800
comment

Free-form note. An empty string removes it.

string
<= 1024 characters

Per-record outcome.

Media type application/json

Outcome of a best-effort bulk operation. The status code is 200 even when some records failed — inspect results.

object
succeeded
integer
failed
integer
results
Array<object>
object
id
integer
ok
boolean
error

Present only when ok is false.

string
Example generated
{
"succeeded": 1,
"failed": 1,
"results": [
{
"id": 1,
"ok": true,
"error": "example"
}
]
}

Malformed body, an empty updates, or more than 1000 records.

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. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

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 banned.

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