Skip to main content
GET
/
shield
/
waf
/
custom-rule
/
{id}
Retrieve a specific custom WAF rule
curl --request GET \
  --url https://api.bunny.net/shield/waf/custom-rule/{id}
import requests

url = "https://api.bunny.net/shield/waf/custom-rule/{id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.bunny.net/shield/waf/custom-rule/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bunny.net/shield/waf/custom-rule/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.bunny.net/shield/waf/custom-rule/{id}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.bunny.net/shield/waf/custom-rule/{id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bunny.net/shield/waf/custom-rule/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "shieldZoneId": 123,
  "userId": "<string>",
  "ruleName": "<string>",
  "ruleDescription": "<string>",
  "ruleJson": "<string>",
  "ruleConfiguration": {
    "variableTypes": {
      "REQUEST_URI": "<string>",
      "REQUEST_URI_RAW": "<string>",
      "ARGS": "<string>",
      "ARGS_COMBINED_SIZE": "<string>",
      "ARGS_GET": "<string>",
      "ARGS_GET_NAMES": "<string>",
      "ARGS_POST": "<string>",
      "ARGS_POST_NAMES": "<string>",
      "FILES_NAMES": "<string>",
      "GEO": "<string>",
      "REMOTE_ADDR": "<string>",
      "QUERY_STRING": "<string>",
      "REQUEST_BASENAME": "<string>",
      "REQUEST_BODY": "<string>",
      "REQUEST_COOKIES_NAMES": "<string>",
      "REQUEST_COOKIES": "<string>",
      "REQUEST_FILENAME": "<string>",
      "REQUEST_HEADERS_NAMES": "<string>",
      "REQUEST_HEADERS": "<string>",
      "REQUEST_LINE": "<string>",
      "REQUEST_METHOD": "<string>",
      "REQUEST_PROTOCOL": "<string>",
      "RESPONSE_BODY": "<string>",
      "RESPONSE_HEADERS": "<string>",
      "RESPONSE_STATUS": "<string>",
      "FINGERPRINT": "<string>",
      "VERIFIED_BOT_CATEGORY": "<string>"
    },
    "transformationTypes": [],
    "value": "<string>",
    "chainedRuleConditions": [
      {
        "variableTypes": {
          "REQUEST_URI": "<string>",
          "REQUEST_URI_RAW": "<string>",
          "ARGS": "<string>",
          "ARGS_COMBINED_SIZE": "<string>",
          "ARGS_GET": "<string>",
          "ARGS_GET_NAMES": "<string>",
          "ARGS_POST": "<string>",
          "ARGS_POST_NAMES": "<string>",
          "FILES_NAMES": "<string>",
          "GEO": "<string>",
          "REMOTE_ADDR": "<string>",
          "QUERY_STRING": "<string>",
          "REQUEST_BASENAME": "<string>",
          "REQUEST_BODY": "<string>",
          "REQUEST_COOKIES_NAMES": "<string>",
          "REQUEST_COOKIES": "<string>",
          "REQUEST_FILENAME": "<string>",
          "REQUEST_HEADERS_NAMES": "<string>",
          "REQUEST_HEADERS": "<string>",
          "REQUEST_LINE": "<string>",
          "REQUEST_METHOD": "<string>",
          "REQUEST_PROTOCOL": "<string>",
          "RESPONSE_BODY": "<string>",
          "RESPONSE_HEADERS": "<string>",
          "RESPONSE_STATUS": "<string>",
          "FINGERPRINT": "<string>",
          "VERIFIED_BOT_CATEGORY": "<string>"
        },
        "value": "<string>"
      }
    ]
  },
  "errorResponse": {
    "success": true,
    "message": "<string>",
    "errorKey": "<string>"
  }
}
{
"statusCode": 123
}

Path Parameters

id
integer<int64>
required

The ID of the Custom WAF Rule.

Response

OK

id
integer<int64>
shieldZoneId
integer<int64>
userId
string | null
ruleName
string | null
ruleDescription
string | null
ruleJson
string | null
ruleConfiguration
object
errorResponse
object

Generic response object containing status information for API operations.

Last modified on June 26, 2026