This page describes the JSON objects used in API requests creating or updating rulesets and their rules via Rulesets API, as well as the objects returned by the API.
A fully populated ruleset object has the following JSON structure.
{
"id": "6a359df138c442b385d20140d4d96919",
"name": "Example Ruleset",
"description": "Description of Example Ruleset",
"kind": "custom",
"version": "2",
"phase": "http_request_firewall_custom",
"rules": [
{
"id": "fdb0dd271f3f40b19679cc5d91396024",
"version": "2",
"action": "block",
"expression": "cf.zone.name eq \"example.com\" ",
"last_updated": "2022-07-20T10:44:29.124515Z"
}
],
"last_updated": "2022-07-20T10:44:29.124515Z"
}For details on the properties of rules items in the rules array, refer to the Rule object structure and properties section.
The ruleset object has the following properties:
-
idString- A 32-character UUIDv4 string that represents the unique Cloudflare-generated identifier for a given version of a ruleset.
- Unique, read-only.
-
nameString- A human-readable name for the ruleset.
- The name is immutable. You cannot change the name over the lifetime of the ruleset.
-
descriptionString- Optional description for the ruleset.
- You can change the description over the lifetime of the ruleset.
-
kindString