Reorder header rules
const url = 'https://api.nsin.ir/domains/example.com/rules/header/reorder';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"id":1,"priority":1}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.nsin.ir/domains/example.com/rules/header/reorder \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ { "id": 1, "priority": 1 } ]'Sets the priority of several header rules at once. Lower priority
values are evaluated first, and because header rules compose rather
than stopping at the first match, order decides which rule wins when
two of them write the same header name — the later one does. The body
is a bare array. Requires rules.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 ”A bare array — not wrapped in an object.
object
Example generated
[ { "id": 1, "priority": 1 }]Responses
Section titled “ Responses ”Number of rules whose priority changed.
object
How many rules were changed.
Example generated
{ "updated": 1}Malformed body, or a negative priority.
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"}No such domain, or your role on it does not permit this operation. The
rules endpoints deliberately answer 404 rather than 403 for an
insufficient role, so they never confirm that a domain exists to someone
who cannot use it.
The single error shape used by every endpoint.
object
Human-readable description of what went wrong.
Examples
{ "error": "not found"}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"}