POST example
Last updated Apr 24, 2026 This example creates several filters using a single API call.
Requestbash
curl "https://api.cloudflare.com/client/v4/zones/{zone_id}/filters" \
--header "X-Auth-Email: <EMAIL>" \
--header "X-Auth-Key: <API_KEY>" \
--header "Content-Type: application/json" \
--data '[
{
"expression": "ip.src eq 93.184.216.0"
},
{
"expression": "http.request.uri.path matches \"^/api/.*$\"",
"description": "/api"
},
{
"expression": "not http.request.uri.path matches \"^/api/.*$\"",
"description": "not /api"
},
{
"expression": "(http.request.uri.path ~ \"^.*/wp-login.php$\" or http.request.uri.path ~ \"^.*/xmlrpc.php$\")",
"description": "Login"
},
{
"expression": "ip.src eq 93.184.216.0 and (http.request.uri.path ~ \"^.*/wp-login.php$\" or http.request.uri.path ~ \"^.*/xmlrpc.php$\")",
"description": "Login from office"
}
]'
Responsejson
{
"result": [
{
"id": "<FILTER_ID_1>",
"paused": false,
"expression": "ip.src eq 93.184.216.0"
},
{
"id": "<FILTER_ID_2>",
"paused": false,
"description": "/api",
"expression": "http.request.uri.path matches \"^/api/.*$\""
},
{
"id": "<FILTER_ID_3>",
"paused": false,
"description": "not /api",
"expression": "not http.request.uri.path matches \"^/api/.*$\""
},
{
"id": "<FILTER_ID_4>",
"paused": false,
"description": "Login",
"expression": "(http.request.uri.path ~ \"^.*/wp-login.php$\" or http.request.uri.path ~ \"^.*/xmlrpc.php$\")"
},
{
"id": "<FILTER_ID_5>",
"paused": false,
"description": "Login from office",
"expression": "ip.src eq 93.184.216.0 and (http.request.uri.path ~ \"^.*/wp-login.php$\" or http.request.uri.path ~ \"^.*/xmlrpc.php$\")"
}
],
"success": true,
"errors": [],
"messages": []
}
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/firewall/api/cf-filters/post/#page","headline":"POST example","description":"Create filters or rules with a POST API request.","url":"https://developers.cloudflare.com/firewall/api/cf-filters/post/","inLanguage":"en","image":"https://developers.cloudflare.com/firewall/api/cf-filters/post/og.png?v=047b064eb6adf018","dateModified":"2026-04-24","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Update filters or rules with PUT API requests. title: PUT examples image: https://developers.cloudflare.com/firewall/api/cf-filters/put/og.png?v=f719bf015b6a6f4c
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/firewall/llms.txt
Use this file to discover all available pages before exploring further.
Docs