I’m trying to update a firewall rule through an API call. For now, I’m just using CURL to rest out the API call before moving it into a production script. However, the filter portion of the API call is not working. When I perform the following API PUT call:
curl --request PUT \
--url https://api.cloudflare.com/client/v4/zones/{zone_identifier}/firewall/rules/{id} \
--header 'Content-Type: application/json' \
--header 'X-Auth-Email: myEmail' \
--header 'X-Auth-Key: myAPIKey' \
--data '{"id":"firewallRuleID", "paused":false, "description":"Description of my Rule", "action":"allow", "ref":"refIDofMyRule", "filter": {"description":"An informative summary of the filter.", "id": "The unique identifier of the filter.","expression": "(ip.src eq 3.3.3.3)", "paused":false}}'
The ip.src is not updating. Instead, the response returns the IP that is already there. In this example 1.1.1.1
.
Response:
{
"result": {
"id": "FireWall ID",
"paused": false,
"description": "Firewall Rule Description",
"action": "skip",
"ref": "refIDofMyRule",
"filter": {
"id": "The unique identifier of the filter.",
"expression": "(ip.src eq 1.1.1.1)",
"paused": false
},
"created_on": "2023-07-28T19:11:55Z",
"modified_on": "2023-07-28T22:47:56Z",
"index": 0
},
"success": true,
"errors": [],
"messages": []
}
Not sure if I’m doing something wrong or if there is a bug with the API.
Any guidance would be appreciated!