To invoke a Cloudflare Filters API operation, append the endpoint to the Cloudflare API base URL (https://api.cloudflare.com/client/v4/zones/{zone_id}). For authentication instructions, consult the standard Cloudflare API documentation.

The Cloudflare Filters API endpoints are:

Method + URL stub Description Notes
POST /filters - Create one or more filters
- See POST example call
- Handled as a single transaction
- If one fails, then all fail
GET /filters - Fetch filters
- See GET example call
- Query on (case-insensitive):
   - Exact match for one or more id
   - Text in the description value
   - Exact match on one or more ref

- Results paginated (25-item default)*

- No query returns all active and paused rules
GET /filters/{id} - Fetch a filter by ID
- See GET example call
PUT /filters - Update filters
- See PUT example call
- All filters must exist
- Handled as a single transaction
- If one fails, all updates fail
PUT /filters/{id} - Update a rule by ID
- See PUT example call
DELETE /filters - Delete filters
- See DELETE example calls
- Must be specified with list of identifiers returned by GET
- Empty input results in no deletion
- Returns 200 if rule does not exist
DELETE /filters/{id} - Delete a filter by ID
- See DELETE example call
* To learn how to page through results, see Requests > Pagination in Cloudflare API Getting Started.