Skip to content

Reorder rate limit rules

PATCH
/domains/{domain}/rules/rate-limit/reorder
curl --request PATCH \
--url https://api.nsin.ir/domains/example.com/rules/rate-limit/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[ { "id": 1, "priority": 1 } ]'

Sets the priority of several rate limit rules at once. Lower priority values are evaluated first. 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"
}