API examples

Last updated Apr 23, 2026 Use the Rulesets API to configure custom rules via API.

The skip action supports different skip options, according to the security features or products that you wish to skip.

Before you continue

This page contains examples of different skip rule scenarios for custom rules. Take the following into account:

However, the entry point ruleset may not exist yet. In this case, invoke the Create a zone ruleset operation to create the entry point ruleset with a skip rule. Refer to Create ruleset for an example. - Although each example only includes one action parameter, you can use several skip options in the same rule by specifying the ruleset, phases, and products action parameters simultaneously.

Skip the remaining rules in the current ruleset

This example invokes the Create a zone ruleset rule operation to add a skip rule to the existing http_request_firewall_custom phase entry point ruleset with ID $RULESET_ID. The rule will skip all remaining rules in the current ruleset for requests matching the rule expression.

Create a zone ruleset rulebash

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/$RULESET_ID/rules" \
    --request POST \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "action": "skip",
        "action_parameters": {
                "ruleset": "current"
        },
        "expression": "http.request.uri.path contains \"/skip-current-ruleset/\"",
        "description": ""
    }'

Skip a phase

This example invokes the Create a zone ruleset rule operation to add a rule to the existing http_request_firewall_custom phase entry point ruleset with ID $RULESET_ID. The rule will skip the http_ratelimit phase for requests matching the rule expression.

Create a zone ruleset rulebash

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/$RULESET_ID/rules" \
    --request POST \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "action": "skip",
        "action_parameters": {
                "phases": [
                        "http_ratelimit"
                ]
        },
        "expression": "http.request.uri.path contains \"/skip-phase/\"",
        "description": ""
    }'

Refer to Available skip options for the list of phases you can skip.

Skip a phase and do not log matching requests

This example invokes the Create a zone ruleset rule operation to add a rule that:

  • Skips the http_ratelimit phase
  • Disables event logging for the current rule

Create a zone ruleset rulebash

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/$RULESET_ID/rules" \
    --request POST \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "action": "skip",
        "action_parameters": {
                "phases": [
                        "http_ratelimit"
                ]
        },
        "logging": {
                "enabled": false
        },
        "expression": "http.request.uri.path contains \"/disable-logging/\"",
        "description": ""
    }'

Refer to Available skip options for more information on disabling logging for requests that match a skip rule.

Skip security products

This example uses the Create a zone ruleset rule operation to add a rule that skips the Zone Lockdown and User Agent Blocking products for requests matching the rule expression.

Create a zone ruleset rulebash

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/$RULESET_ID/rules" \
    --request POST \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "action": "skip",
        "action_parameters": {
                "products": [
                        "zoneLockdown",
                        "uaBlock"
                ]
        },
        "expression": "http.request.uri.path contains \"/skip-products/\"",
        "description": ""
    }'

Refer to Available skip options for the list of products you can skip.

Skip the remaining rules in the current phase

This example invokes the Create a zone ruleset rule operation to add a skip rule to the existing http_request_firewall_custom phase entry point ruleset with ID $RULESET_ID. The rule will skip all remaining rules in the http_request_firewall_custom phase for requests matching the rule expression.

Create a zone ruleset rulebash

curl "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/$RULESET_ID/rules" \
    --request POST \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "action": "skip",
        "action_parameters": {
                "phase": "current"
        },
        "expression": "http.request.uri.path contains \"/skip-current-ruleset/\"",
        "description": ""
    }'

Currently, this skip option is only available at the zone level. Refer to Available skip options for more details.

Was this helpful?

YesNo

On this page

API examples - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/waf/custom-rules/skip/api-examples/#page","headline":"API examples","description":"API examples for configuring custom rules with the Skip action.","url":"https://developers.cloudflare.com/waf/custom-rules/skip/api-examples/","inLanguage":"en","image":"https://developers.cloudflare.com/waf/custom-rules/skip/api-examples/og.png?v=a7cfcc1023e23e0e","dateModified":"2026-04-23","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: Available skip options for WAF custom rules. title: Available skip options image: https://developers.cloudflare.com/waf/custom-rules/skip/options/og.png?v=8884b927a724d371


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/waf/llms.txt
Use this file to discover all available pages before exploring further.