You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/ruleset-engine/rulesets-api/json-object.mdx
+19-15Lines changed: 19 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,33 +39,27 @@ A fully populated ruleset object has the following JSON structure.
39
39
The ruleset object has the following properties:
40
40
41
41
-`id` <Typetext="String" />
42
-
43
42
- A 32-character UUIDv4 string that represents the unique Cloudflare-generated identifier for a given version of a ruleset.
44
43
- Unique, read-only.
45
44
46
45
-`name` <Typetext="String" />
47
-
48
46
- A human-readable name for the ruleset.
49
47
- The name is immutable. You cannot change the name over the lifetime of the ruleset.
50
48
51
49
-`description` <Typetext="String" />
52
-
53
50
- Optional description for the ruleset.
54
51
- You can change the description over the lifetime of the ruleset.
55
52
56
53
-`kind` <Typetext="String" />
57
-
58
54
- The kind of ruleset the JSON object represents.
59
55
- One of `root`, `zone`, `managed`, `custom`.
60
56
-`kind` is immutable.
61
57
62
58
-`version` <Typetext="Integer" />
63
-
64
59
- The version of the ruleset.
65
60
- Read-only value starting at `1` and incremented by `1` each time the ruleset is modified.
66
61
67
62
-`rules` <Typetext="Array<Rule>" />
68
-
69
63
- 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.
70
64
71
65
-`last_updated` <Typetext="Timestamp" />
@@ -80,44 +74,54 @@ A fully populated rule JSON object has the following structure:
80
74
{
81
75
"id": "fdb0dd271f3f40b19679cc5d91396024",
82
76
"version": "2",
77
+
"ref": "<REF>",
78
+
"description": "<DESCRIPTION>",
83
79
"action": "block",
84
-
"categories": ["wordpress"],
80
+
"action_parameters": [
81
+
// action parameters vary according to the action
82
+
],
83
+
"categories": ["<CATEGORY_1>", "<CATEGORY_2>"],
85
84
"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",
87
86
"enabled": true
88
87
}
89
88
```
90
89
91
90
The JSON object properties for a rule are defined as follows:
92
91
93
92
-`id` <Typetext="String" />
94
-
95
93
- A 32-character UUIDv4 string that represents the unique Cloudflare-generated identifier for a given version of a rule.
96
94
- Unique, read-only.
97
95
98
96
-`version` <Typetext="Integer" />
99
-
100
97
- The version of the rule.
101
98
- Read-only value starting at `1` and incremented by `1` each time the rule is modified.
102
99
- Changing the order of a rule in a ruleset does not change its version.
103
100
104
-
-`action` <Typetext="String" />
101
+
-`ref` <Typetext="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` <Typetext="String" />
106
+
- A descriptive name of the rule.
105
107
108
+
-`action` <Typetext="String" />
106
109
- 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.
108
111
109
-
-`categories` <Typetext="Array<String>" />
112
+
-`action_parameters` <Typetext="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.
110
115
116
+
-`categories` <Typetext="Array<String>" />
111
117
- Tags associated with the current rule. You can define overrides that affect rules with a given tag.
112
118
- Read-only. Only available in [WAF Managed Rules](/waf/managed-rules/) and [DDoS managed rulesets](/ddos-protection/managed-rulesets/).
113
119
114
120
-`expression` <Typetext="String" />
115
-
116
121
- Criteria defining when there is a match for the current rule.
117
122
- The fields and functions you can use in a rule expression depend on the phase where the rule's ruleset is executed.
118
123
119
124
-`last_updated` <Typetext="Timestamp" />
120
-
121
125
- The time (UTC) when the rule was last updated in ISO 8601 format: `YYYY-MM-DDThh:mm:ss.TZD`.
0 commit comments