Skip to content

Reorder header rules

PATCH
/domains/{domain}/rules/header/reorder
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.

domain
required
string

The domain name (for example example.com) — not a numeric id.

Example
example.com
Media type application/json

A bare array — not wrapped in an object.

Array<object>
object
id
required
integer
priority
required
integer
Example generated
[
{
"id": 1,
"priority": 1
}
]

Number of rules whose priority changed.

Media type application/json
object
updated

How many rules were changed.

integer
Example generated
{
"updated": 1
}

Malformed body, or a negative priority.

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

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.

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 notFound
{
"error": "not found"
}

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