Update many records at once
const url = 'https://api.nsin.ir/domains/example.com/records/batch-update';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"updates":[{"id":1,"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 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, "proxied": true, "captcha": true, "scheme": "Http", "port": 1, "host_header": "example", "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.
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.comRequest Body required
Section titled “Request Body required ”object
object
Id of the record to update.
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 ”Per-record outcome.
Outcome of a best-effort bulk operation. The status code is 200 even
when some records failed — inspect results.
object
object
Present only when ok is false.
Example generated
{ "succeeded": 1, "failed": 1, "results": [ { "id": 1, "ok": true, "error": "example" } ]}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 it is not visible to this account. Domains you cannot access are reported as not found rather than forbidden.
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"}