How to update a Firewall Rule & Filter?

I have been trying to update a firewall rule & filter via API but I am having problems.

This is my request:

curl -X PUT "https://api.cloudflare.com/client/v4/zones/{zone-id}/firewall/rules/{rule-id}" \
     -H "X-Auth-Email: {cf-email}" \
     -H "X-Auth-Key: {cf-api-key}" \
     -H "Content-Type: application/json" \
     --data '{"id":"{rule-id}","action":"block","description":"Block ASNs","filter":{"id":"{filter-id}","expression":"(ip.geoip.asnum in {15169 16509 22612})"}}'

I think the problem is related to the expression field, but I am not sure what’s wrong there. Because when I send this request I get a “success” message in the output.

Is this expression correctly built? (ip.geoip.asnum in {15169 16509 22612})

I was making the request to the wrong endpoint. This thread help me out fixed the problem: Firewall rule is not editible from API

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.