Skip to content
Visit Firewall on GitHub
Set theme to dark (⇧+D)

POST example

Create Ruleset

POST accounts/{account_id}/rulesets

Creates a new ruleset.

The following parameters are required.

nameA human-readable name for the ruleset.StringThe name is immutable. You cannot change it over the lifetime of the ruleset.
descriptionOptional description for the ruleset.StringYou can change the description over the lifetime of the ruleset.
kindThe kind of ruleset the JSON object representsString

Allowed values:

  • root
  • custom

You can only create one root ruleset for your account.

Use the rules parameter to supply a list of rules that define the ruleset. For an object definition, see Rulesets API: JSON Objects.


curl -X POST \"{account_id}/rulesets" --data '{  "name": "Example ruleset",  "kind": "root",  "description": "Example ruleset description",  "rules": [    {    "action": "log",    "expression": " eq \"\""    }]}'


{  "result": {    "id": "{ruleset_id}",    "name": "Example ruleset",    "description": "Example ruleset description",    "kind": "root",    "version": "1",    "rules": [      {        "id": "{rule_id}",        "version": "1",        "action": "log",        "expression": " eq \"\"",        "last_updated": "2020-07-17T15:42:37.917815Z"      }    ],    "last_updated": "2020-07-17T15:42:37.917815Z",  },  "success": true,  "errors": [],  "messages": []}