v32

latestOpenAPI 3.1.0raw.githubusercontent.com2026-05-151,1412,2144.5 MB
Rule templates

Get rule template details

get/cdn/resources/rule_templates/{rule_template_id}

Path parameters

rule_template_idinteger required

Rule template ID.

Response

Successful.

idinteger

Rule template ID.

namestring

Rule template name.

clientinteger

Client ID

deletedboolean

Defines whether the template has been deleted.

Possible values:

  • true - Template has been deleted.
  • false - Template has not been deleted.
rulestring

Path to the file or folder for which the rule will be applied.

The rule is applied if the requested URI matches the rule path.

We add a leading forward slash to any rule path. Specify a path without a forward slash.

ruleTypeinteger

Rule type.

Possible values:

  • Type 0 - Regular expression. Must start with '^/' or '/'.
  • Type 1 - Regular expression. Note that for this rule type we automatically add / to each rule pattern before your regular expression. This type is legacy, please use Type 0.
weightinteger

Rule execution order: from lowest (1) to highest.

If requested URI matches multiple rules, the one higher in the order of the rules will be applied.

templateboolean

Determines whether the rule is a template.

defaultboolean

Defines whether the template is a system template developed for common cases. System templates are available to all customers.

Possible values:

  • true - Template is a system template and cannot be changed by a user.
  • false - Template is a custom template and can be changed by a user.
overrideOriginProtocol'HTTPS' | 'HTTP' | 'MATCH' nullable

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • HTTPS - CDN servers connect to origin via HTTPS protocol.
  • HTTP - CDN servers connect to origin via HTTP protocol.
  • MATCH - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • null - originProtocol setting is inherited from the CDN resource settings.

Example response

{
  "id": 5,
  "name": "All images template",
  "client": 7,
  "rule": "/folder/images/*.png",
  "weight": 1,
  "template": true,
  "options": {
    "allowedHttpMethods": {
      "enabled": true,
      "value": [
        "GET",
        "POST"
      ]
    },
    "brotli_compression": {
      "enabled": true,
      "value": [
        "text/html",
        "text/plain"
      ]
    },
    "browser_cache_settings": {
      "enabled": true,
      "value": "3600s"
    },
    "cache_http_headers": {
      "enabled": false,
      "value": [
        "vary",
        "content-length",
        "last-modified",
        "connection",
        "accept-ranges",
        "content-type",
        "content-encoding",
        "etag",
        "cache-control",
        "expires",
        "keep-alive",
        "server"
      ]
    },
    "cors": {
      "enabled": true,
      "value": [
        "domain.com",
        "domain2.com"
      ],
      "always": true
    },
    "country_acl": {
      "enabled": true,
      "policy_type": "allow",
      "excepted_values": [
        "GB",
        "DE"
      ]
    },
    "disable_cache": {
      "enabled": true,
      "value": false
    },
    "disable_proxy_force_ranges": {
      "enabled": true,
      "value": true
    },
    "edge_cache_settings": {
      "enabled": true,
      "value": "43200s",
      "custom_values": {
        "100": "43200s"
      }
    },
    "fastedge": {
      "enabled": true,
      "on_request_headers": {
        "enabled": true,
        "app_id": "1001",
        "interrupt_on_error": true
      }
    },
    "fetch_compressed": {
      "enabled": true,
      "value": false
    },
    "follow_origin_redirect": {
      "enabled": true,
      "codes": [
        302,
        308
      ]
    },
    "force_return": {
      "enabled": true,
      "code": 301,
      "body": "http://example.com/redirect_address",
      "time_interval": {
        "start_time": "09:00",
        "end_time": "20:00",
        "time_zone": "CET"
      }
    },
    "forward_host_header": {
      "enabled": false,
      "value": false
    },
    "gzipOn": {
      "enabled": true,
      "value": true
    },
    "hostHeader": {
      "enabled": true,
      "value": "host.com"
    },
    "ignore_cookie": {
      "enabled": true,
      "value": true
    },
    "ignoreQueryString": {
      "enabled": true,
      "value": false
    },
    "image_stack": {
      "enabled": true,
      "avif_enabled": true,
      "webp_enabled": false,
      "quality": 80,
      "png_lossless": true
    },
    "ip_address_acl": {
      "enabled": true,
      "policy_type": "deny",
      "excepted_values": [
        "192.168.1.100/32"
      ]
    },
    "limit_bandwidth": {
      "enabled": true,
      "limit_type": "static",
      "speed": 100,
      "buffer": 200
    },
    "proxy_cache_key": {
      "enabled": true,
      "value": "$scheme$uri"
    },
    "proxy_cache_methods_set": {
      "enabled": true,
      "value": false
    },
    "proxy_connect_timeout": {
      "enabled": true,
      "value": "4s"
    },
    "proxy_read_timeout": {
      "enabled": true,
      "value": "10s"
    },
    "query_params_blacklist": {
      "enabled": true,
      "value": [
        "some",
        "blacklisted",
        "query"
      ]
    },
    "query_params_whitelist": {
      "enabled": true,
      "value": [
        "some",
        "whitelisted",
        "query"
      ]
    },
    "query_string_forwarding": {
      "enabled": true,
      "forward_from_file_types": [
        "m3u8",
        "mpd"
      ],
      "forward_to_file_types": [
        "ts",
        "mp4"
      ],
      "forward_only_keys": [
        "auth_token",
        "session_id"
      ],
      "forward_except_keys": [
        "debug_info"
      ]
    },
    "redirect_http_to_https": {
      "enabled": true,
      "value": true
    },
    "redirect_https_to_http": {
      "enabled": false,
      "value": true
    },
    "referrer_acl": {
      "enabled": true,
      "policy_type": "deny",
      "excepted_values": [
        "example.com",
        "*.example.net"
      ]
    },
    "response_headers_hiding_policy": {
      "enabled": true,
      "mode": "hide",
      "excepted": [
        "my-header"
      ]
    },
    "rewrite": {
      "enabled": true,
      "body": "/(.*) /additional_path/$1",
      "flag": "break"
    },
    "secure_key": {
      "enabled": true,
      "key": "secretkey",
      "type": 2
    },
    "slice": {
      "enabled": true,
      "value": true
    },
    "sni": {
      "enabled": true,
      "sni_type": "custom",
      "custom_hostname": "custom.example.com"
    },
    "stale": {
      "enabled": true,
      "value": [
        "http_404",
        "http_500"
      ]
    },
    "static_response_headers": {
      "enabled": true,
      "value": [
        {
          "name": "X-Example",
          "value": [
            "Value_1"
          ],
          "always": true
        },
        {
          "name": "X-Example-Multiple",
          "value": [
            "Value_1",
            "Value_2",
            "Value_3"
          ],
          "always": false
        }
      ]
    },
    "staticHeaders": {
      "enabled": true,
      "value": {
        "X-Example": "Value_1",
        "X-Example-Multiple": [
          "Value_2",
          "Value_3"
        ]
      }
    },
    "staticRequestHeaders": {
      "enabled": true,
      "value": {
        "Header-One": "Value 1",
        "Header-Two": "Value 2"
      }
    },
    "user_agent_acl": {
      "enabled": true,
      "policy_type": "allow",
      "excepted_values": [
        "UserAgent Value",
        "~*.*bot.*",
        ""
      ]
    },
    "waap": {
      "enabled": true,
      "value": true
    },
    "websockets": {
      "enabled": true,
      "value": true
    }
  }
}