Skip to main content
PATCH /api/v1/projects/{project_id}/rules/{id} Requires rules.write permission. Only the fields you include in the request body are updated; omitted fields are left unchanged.

Path parameters

project_id
string
required
UUID of the project.
id
string
required
UUID of the rule.

Request body

priority
integer
Updated evaluation order. Lower numbers are evaluated first.
attribute
string | null
Updated context attribute to evaluate. Pass null to clear.
operator
string | null
Updated comparison operator. One of eq, neq, in, not_in, contains, starts_with, ends_with. Pass null to clear.
value_json
string | null
Updated JSON-encoded target value. Pass null to clear.
rollout_percentage
integer | null
Updated rollout percentage (0–100). Pass null to clear.
bucket_by
string
Updated context field used for bucket hashing.
return_value
boolean
Updated value returned when this rule matches.
is_active
boolean
Set to false to disable this rule without deleting it.

Response

rule
object
required
The updated rule.

Errors

StatusWhen
403Caller lacks rules.write permission
404Rule not found

Example

curl -X PATCH http://localhost:8080/api/v1/projects/550e8400-e29b-41d4-a716-446655440000/rules/r1a2b3c4-d5e6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"rollout_percentage": 25, "is_active": true}'
{
  "rule": {
    "id": "r1a2b3c4-d5e6-7890-abcd-ef1234567890",
    "flag_id": "550e8400-e29b-41d4-a716-446655440000",
    "priority": 1,
    "rule_type": "percentage",
    "attribute": null,
    "operator": null,
    "value_json": null,
    "rollout_percentage": 25,
    "bucket_by": "user_id",
    "return_value": true,
    "is_active": true,
    "created_at": "2026-03-21T10:00:00Z",
    "updated_at": "2026-03-21T12:00:00Z"
  }
}

Build docs developers (and LLMs) love