Updates one or more existing firewall rules.
/zones/{zone_identifier}/firewall/rules
put
Firewall rules
firewall-rules-update-firewall-rules
{
"business": true,
"enterprise": true,
"free": true,
"pro": true
} null [
{
"in": "path",
"name": "zone_identifier",
"required": true,
"schema": {
"description": "Identifier",
"example": "023e105f4ecef8ad9ca31a8372d0c353",
"maxLength": 32,
"readOnly": true,
"type": "string"
}
}
] {
"content": {
"application/json": {
"schema": {
"required": [
"id"
]
}
}
},
"required": true
} {
"200": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"enum": [
true
],
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"items": {},
"nullable": true,
"type": "array"
},
"result_info": {
"properties": {
"count": {
"description": "Total number of results for the requested service",
"example": 1,
"type": "number"
},
"page": {
"description": "Current page within paginated list of results",
"example": 1,
"type": "number"
},
"per_page": {
"description": "Number of results per page of results",
"example": 20,
"type": "number"
},
"total_count": {
"description": "Total results available without any search parameters",
"example": 2000,
"type": "number"
}
},
"type": "object"
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"items": {
"allOf": [
{
"allOf": [
{
"properties": {
"action": {
"description": "The action to apply to a matched request. The `log` action is only available on an Enterprise plan.",
"enum": [
"block",
"challenge",
"js_challenge",
"managed_challenge",
"allow",
"log",
"bypass"
],
"example": "block",
"type": "string"
},
"description": {
"description": "An informative summary of the firewall rule.",
"example": "Blocks traffic identified during investigation for MIR-31",
"maxLength": 500,
"type": "string"
},
"id": {
"description": "The unique identifier of the firewall rule.",
"example": "372e67954025e0ba6aaa6d586b9e0b60",
"maxLength": 32,
"readOnly": true,
"type": "string"
},
"paused": {
"description": "When true, indicates that the firewall rule is currently paused.",
"example": false,
"type": "boolean"
},
"priority": {
"description": "The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority.",
"example": 50,
"maximum": 2147483647,
"minimum": 0,
"type": "number"
},
"products": {
"items": {
"description": "A list of products to bypass for a request when using the `bypass` action.",
"enum": [
"zoneLockdown",
"uaBlock",
"bic",
"hot",
"securityLevel",
"rateLimit",
"waf"
],
"example": "waf",
"type": "string"
},
"type": "array"
},
"ref": {
"description": "A short reference tag. Allows you to select related firewall rules.",
"example": "MIR-31",
"maxLength": 50,
"type": "string"
}
},
"type": "object"
},
{
"properties": {
"filter": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"description": {
"description": "An informative summary of the filter.",
"example": "Restrict access from these browsers on this address range.",
"maxLength": 500,
"type": "string"
},
"expression": {
"description": "The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).",
"example": "(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155",
"type": "string"
},
"id": {
"description": "The unique identifier of the filter.",
"example": "372e67954025e0ba6aaa6d586b9e0b61",
"maxLength": 32,
"minLength": 32,
"readOnly": true,
"type": "string"
},
"paused": {
"description": "When true, indicates that the filter is currently paused.",
"example": false,
"type": "boolean"
},
"ref": {
"description": "A short reference tag. Allows you to select related filters.",
"example": "FIL-100",
"maxLength": 50,
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"deleted": {
"description": "When true, indicates that the firewall rule was deleted.",
"example": true,
"type": "boolean"
},
"id": {
"description": "The unique identifier of the filter.",
"example": "372e67954025e0ba6aaa6d586b9e0b61",
"maxLength": 32,
"minLength": 32,
"readOnly": true,
"type": "string"
}
},
"required": [
"id",
"deleted"
]
}
]
}
}
}
],
"type": "object"
},
{
"required": [
"id",
"filter",
"action",
"paused"
],
"type": "object"
}
]
},
"type": "array"
}
},
"required": [
"result"
],
"type": "object"
}
]
}
}
},
"description": "Update firewall rules response"
},
"4xx": {
"content": {
"application/json": {
"schema": {
"allOf": [
{
"allOf": [
{
"allOf": [
{
"properties": {
"errors": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"messages": {
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
},
"result": {
"anyOf": [
{
"type": "object"
},
{
"items": {},
"type": "array"
},
{
"type": "string"
}
]
},
"success": {
"description": "Whether the API call was successful",
"enum": [
true
],
"example": true,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
},
{
"properties": {
"result": {
"items": {},
"nullable": true,
"type": "array"
},
"result_info": {
"properties": {
"count": {
"description": "Total number of results for the requested service",
"example": 1,
"type": "number"
},
"page": {
"description": "Current page within paginated list of results",
"example": 1,
"type": "number"
},
"per_page": {
"description": "Number of results per page of results",
"example": 20,
"type": "number"
},
"total_count": {
"description": "Total results available without any search parameters",
"example": 2000,
"type": "number"
}
},
"type": "object"
}
}
}
],
"type": "object"
},
{
"properties": {
"result": {
"items": {
"allOf": [
{
"allOf": [
{
"properties": {
"action": {
"description": "The action to apply to a matched request. The `log` action is only available on an Enterprise plan.",
"enum": [
"block",
"challenge",
"js_challenge",
"managed_challenge",
"allow",
"log",
"bypass"
],
"example": "block",
"type": "string"
},
"description": {
"description": "An informative summary of the firewall rule.",
"example": "Blocks traffic identified during investigation for MIR-31",
"maxLength": 500,
"type": "string"
},
"id": {
"description": "The unique identifier of the firewall rule.",
"example": "372e67954025e0ba6aaa6d586b9e0b60",
"maxLength": 32,
"readOnly": true,
"type": "string"
},
"paused": {
"description": "When true, indicates that the firewall rule is currently paused.",
"example": false,
"type": "boolean"
},
"priority": {
"description": "The priority of the rule. Optional value used to define the processing order. A lower number indicates a higher priority. If not provided, rules with a defined priority will be processed before rules without a priority.",
"example": 50,
"maximum": 2147483647,
"minimum": 0,
"type": "number"
},
"products": {
"items": {
"description": "A list of products to bypass for a request when using the `bypass` action.",
"enum": [
"zoneLockdown",
"uaBlock",
"bic",
"hot",
"securityLevel",
"rateLimit",
"waf"
],
"example": "waf",
"type": "string"
},
"type": "array"
},
"ref": {
"description": "A short reference tag. Allows you to select related firewall rules.",
"example": "MIR-31",
"maxLength": 50,
"type": "string"
}
},
"type": "object"
},
{
"properties": {
"filter": {
"oneOf": [
{
"additionalProperties": false,
"properties": {
"description": {
"description": "An informative summary of the filter.",
"example": "Restrict access from these browsers on this address range.",
"maxLength": 500,
"type": "string"
},
"expression": {
"description": "The filter expression. For more information, refer to [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/).",
"example": "(http.request.uri.path ~ \".*wp-login.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.addr ne 172.16.22.155",
"type": "string"
},
"id": {
"description": "The unique identifier of the filter.",
"example": "372e67954025e0ba6aaa6d586b9e0b61",
"maxLength": 32,
"minLength": 32,
"readOnly": true,
"type": "string"
},
"paused": {
"description": "When true, indicates that the filter is currently paused.",
"example": false,
"type": "boolean"
},
"ref": {
"description": "A short reference tag. Allows you to select related filters.",
"example": "FIL-100",
"maxLength": 50,
"type": "string"
}
},
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"deleted": {
"description": "When true, indicates that the firewall rule was deleted.",
"example": true,
"type": "boolean"
},
"id": {
"description": "The unique identifier of the filter.",
"example": "372e67954025e0ba6aaa6d586b9e0b61",
"maxLength": 32,
"minLength": 32,
"readOnly": true,
"type": "string"
}
},
"required": [
"id",
"deleted"
]
}
]
}
}
}
],
"type": "object"
},
{
"required": [
"id",
"filter",
"action",
"paused"
],
"type": "object"
}
]
},
"type": "array"
}
},
"required": [
"result"
],
"type": "object"
}
]
},
{
"properties": {
"errors": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": [
{
"code": 7003,
"message": "No route for the URI"
}
],
"minLength": 1
},
"messages": {
"allOf": [
{
"example": [],
"items": {
"properties": {
"code": {
"minimum": 1000,
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object",
"uniqueItems": true
},
"type": "array"
}
],
"example": []
},
"result": {
"enum": [
null
],
"nullable": true,
"type": "object"
},
"success": {
"description": "Whether the API call was successful",
"enum": [
false
],
"example": false,
"type": "boolean"
}
},
"required": [
"success",
"errors",
"messages",
"result"
],
"type": "object"
}
]
}
}
},
"description": "Update firewall rules response failure"
}
} [
{
"api_email": [],
"api_key": []
},
{
"api_token": []
}
]