Skip to main content
PUT
/
limits
/
rules
Upsert a batch of rules.
curl --request PUT \
  --url https://api.example.com/limits/rules \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "pattern": "<string>",
    "description": "<string>",
    "disabled": true,
    "limits": {
      "concurrency": 2
    },
    "precondition": {
      "type": "none"
    }
  }
]
'
[
  {
    "disabled": true,
    "last_modified_millis_since_epoch": 1,
    "limits": {
      "concurrency": 2
    },
    "pattern": "<string>",
    "version": 1,
    "description": "<string>"
  }
]

Body

application/json
pattern
string
required

The pattern that selects which scope/limit-key combinations the rule applies to. Examples: "*", "scope1/*", "scope1/foo/bar".

description
string | null

Free-form description shown in the rule book; not consulted at runtime.

disabled
boolean

Soft-tombstone toggle. true parks the rule (the runtime treats it as absent) without removing it.

limits
object

Per-rule effective limits.

None on a field means "unlimited" (no rule constrains this dimension). Under the bilrost feature this type is also the wire shape persisted inside [crate::PersistedRule]; under serde it's the JSON wire shape for the admin REST model — adding a new limit kind here means allocating a fresh bilrost(tag(...)) next to the new field.

precondition
object

Optimistic-concurrency guard. { "type": "matches", "version": v } requires the rule's current version to be v; { "type": "does_not_exist" } requires the rule to be absent (strict insert); { "type": "none" } (or omitted) is unconditional.

Response

Rules upserted

disabled
boolean
required
last_modified_millis_since_epoch
integer<int64>
required

Millis since UNIX epoch.

Required range: x >= 0
limits
object
required

Per-rule effective limits.

None on a field means "unlimited" (no rule constrains this dimension). Under the bilrost feature this type is also the wire shape persisted inside [crate::PersistedRule]; under serde it's the JSON wire shape for the admin REST model — adding a new limit kind here means allocating a fresh bilrost(tag(...)) next to the new field.

pattern
string
required
version
integer<int32>
required

Per-rule version: bumped on runtime-relevant changes.

Required range: x >= 0
description
string | null