Skip to content

Commit 74d9915

Browse files
committed
Update rule JSON object
1 parent 7e312da commit 74d9915

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

src/content/docs/ruleset-engine/rulesets-api/json-object.mdx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,33 +39,27 @@ A fully populated ruleset object has the following JSON structure.
3939
The ruleset object has the following properties:
4040

4141
- `id` <Type text="String" />
42-
4342
- A 32-character UUIDv4 string that represents the unique Cloudflare-generated identifier for a given version of a ruleset.
4443
- Unique, read-only.
4544

4645
- `name` <Type text="String" />
47-
4846
- A human-readable name for the ruleset.
4947
- The name is immutable. You cannot change the name over the lifetime of the ruleset.
5048

5149
- `description` <Type text="String" />
52-
5350
- Optional description for the ruleset.
5451
- You can change the description over the lifetime of the ruleset.
5552

5653
- `kind` <Type text="String" />
57-
5854
- The kind of ruleset the JSON object represents.
5955
- One of `root`, `zone`, `managed`, `custom`.
6056
- `kind` is immutable.
6157

6258
- `version` <Type text="Integer" />
63-
6459
- The version of the ruleset.
6560
- Read-only value starting at `1` and incremented by `1` each time the ruleset is modified.
6661

6762
- `rules` <Type text="Array<Rule>" />
68-
6963
- A list of rules to include in the ruleset. Refer to [Rule object structure and properties](/ruleset-engine/rulesets-api/json-object/#rule-object-structure-and-properties) for details.
7064

7165
- `last_updated` <Type text="Timestamp" />
@@ -80,44 +74,54 @@ A fully populated rule JSON object has the following structure:
8074
{
8175
"id": "fdb0dd271f3f40b19679cc5d91396024",
8276
"version": "2",
77+
"ref": "<REF>",
78+
"description": "<DESCRIPTION>",
8379
"action": "block",
84-
"categories": ["wordpress"],
80+
"action_parameters": [
81+
// action parameters vary according to the action
82+
],
83+
"categories": ["<CATEGORY_1>", "<CATEGORY_2>"],
8584
"expression": "cf.zone.name eq \"example.com\"",
86-
"last_updated": "2022-07-20T10:44:29.124515Z",
85+
"last_updated": "2025-07-20T10:44:29.124515Z",
8786
"enabled": true
8887
}
8988
```
9089

9190
The JSON object properties for a rule are defined as follows:
9291

9392
- `id` <Type text="String" />
94-
9593
- A 32-character UUIDv4 string that represents the unique Cloudflare-generated identifier for a given version of a rule.
9694
- Unique, read-only.
9795

9896
- `version` <Type text="Integer" />
99-
10097
- The version of the rule.
10198
- Read-only value starting at `1` and incremented by `1` each time the rule is modified.
10299
- Changing the order of a rule in a ruleset does not change its version.
103100

104-
- `action` <Type text="String" />
101+
- `ref` <Type text="String" />
102+
- A user-defined external identifier that must be unique for each rule in a ruleset.
103+
- Use this field in your Terraform configuration to prevent Terraform from recreating the rule on changes. Refer to [How to keep the same rule ID between modifications](/terraform/troubleshooting/rule-id-changes/#how-to-keep-the-same-rule-id-between-modifications) for more information.
104+
105+
- `description` <Type text="String" />
106+
- A descriptive name of the rule.
105107

108+
- `action` <Type text="String" />
106109
- Defines what happens when there is a match for the rule expression.
107-
- The available actions depend on the [phase](/ruleset-engine/about/phases/) where the rule's ruleset is executed.
110+
- The available [actions](/ruleset-engine/rules-language/actions/) depend on the [phase](/ruleset-engine/about/phases/) where the rule's ruleset is executed.
108111

109-
- `categories` <Type text="Array<String>" />
112+
- `action_parameters` <Type text="Object" />
113+
- One or more parameters configuring the rule action.
114+
- The exact properties vary according to the action. Refer to each Cloudflare product's API instructions for more information.
110115

116+
- `categories` <Type text="Array<String>" />
111117
- Tags associated with the current rule. You can define overrides that affect rules with a given tag.
112118
- Read-only. Only available in [WAF Managed Rules](/waf/managed-rules/) and [DDoS managed rulesets](/ddos-protection/managed-rulesets/).
113119

114120
- `expression` <Type text="String" />
115-
116121
- Criteria defining when there is a match for the current rule.
117122
- The fields and functions you can use in a rule expression depend on the phase where the rule's ruleset is executed.
118123

119124
- `last_updated` <Type text="Timestamp" />
120-
121125
- The time (UTC) when the rule was last updated in ISO 8601 format: `YYYY-MM-DDThh:mm:ss.TZD`.
122126
- Read-only.
123127

0 commit comments

Comments
 (0)