Edge Rules

Change an edge rule

Changed on

Absent fields keep their value. Send the revision you edited so a concurrent change is refused (409) instead of overwritten.

patch/projects/{project_id}/edge-rules/{rule_id}

Request

  • Base URL
    /api (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    HTTP bearer

Path parameters

project_idinteger required

Project ID

rule_idinteger required

Edge rule ID

Request body

enabledboolean nullable
environment_idinteger nullable

null applies the rule to every environment.

mode'enforce' | 'log_only' nullable

log_only evaluates the rule and records matches but never acts.

namestring nullable

An empty name regenerates it from the rule.

revisioninteger nullable

The revision the change was made against. When given and the rule has moved on, the update is refused with 409.

Response

Rule updated

created_atstring date-time required
enabledboolean required
environment_idinteger nullable

null applies the rule to every environment of the project.

hitsinteger required

Requests this rule has matched, across every proxy. Counters are flushed every few seconds.

idinteger required
last_hit_atstring date-time nullable
mode'enforce' | 'log_only' required

log_only evaluates the rule and records matches but never acts.

namestring required
positioninteger required

0-based evaluation order. The first rule that decides wins.

project_idinteger required
revisioninteger required

Edit counter. Send it back on update so a concurrent change is refused instead of overwritten.

summarystring required

The rule in one sentence, e.g. "Block with 403 when path starts with /admin".

updated_atstring date-time required

Example response

{
  "created_at": "2026-10-31T09:30:00Z",
  "last_hit_at": "2026-10-31T09:30:00Z",
  "updated_at": "2026-10-31T09:30:00Z"
}

Changes

    • breaking

      removed the required property extensions from the response with the status

    • breaking

      removed the required property extensions from the response with the status

    • breaking

      removed the required property extensions from the response with the status

    3 more changes in this revision