Skip to main content
POST
/
shield
/
shield-zone
Create a Shield Zone for your PullZone
curl --request POST \
  --url https://api.bunny.net/shield/shield-zone \
  --header 'Content-Type: application/json' \
  --data '
{
  "pullZoneId": 123,
  "shieldZone": {
    "shieldZoneId": 123,
    "premiumPlan": true,
    "learningMode": true,
    "learningModeUntil": "2023-11-07T05:31:56Z",
    "wafEnabled": true,
    "wafDisabledRules": [
      "<string>"
    ],
    "wafLogOnlyRules": [
      "<string>"
    ],
    "wafCustomRuleOrder": [
      123
    ],
    "wafRequestHeaderLoggingEnabled": true,
    "requestBodyLoggingEnabled": true,
    "wafRequestIgnoredHeaders": [
      "<string>"
    ],
    "wafRealtimeThreatIntelligenceEnabled": true,
    "wafProfileId": 123,
    "wafEngineConfig": [
      {
        "name": "<string>",
        "valueEncoded": "<string>"
      }
    ],
    "dDoSChallengeWindow": 123,
    "whitelabelResponsePages": true
  }
}
'
import requests

url = "https://api.bunny.net/shield/shield-zone"

payload = {
"pullZoneId": 123,
"shieldZone": {
"shieldZoneId": 123,
"premiumPlan": True,
"learningMode": True,
"learningModeUntil": "2023-11-07T05:31:56Z",
"wafEnabled": True,
"wafDisabledRules": ["<string>"],
"wafLogOnlyRules": ["<string>"],
"wafCustomRuleOrder": [123],
"wafRequestHeaderLoggingEnabled": True,
"requestBodyLoggingEnabled": True,
"wafRequestIgnoredHeaders": ["<string>"],
"wafRealtimeThreatIntelligenceEnabled": True,
"wafProfileId": 123,
"wafEngineConfig": [
{
"name": "<string>",
"valueEncoded": "<string>"
}
],
"dDoSChallengeWindow": 123,
"whitelabelResponsePages": True
}
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
pullZoneId: 123,
shieldZone: {
shieldZoneId: 123,
premiumPlan: true,
learningMode: true,
learningModeUntil: '2023-11-07T05:31:56Z',
wafEnabled: true,
wafDisabledRules: ['<string>'],
wafLogOnlyRules: ['<string>'],
wafCustomRuleOrder: [123],
wafRequestHeaderLoggingEnabled: true,
requestBodyLoggingEnabled: true,
wafRequestIgnoredHeaders: ['<string>'],
wafRealtimeThreatIntelligenceEnabled: true,
wafProfileId: 123,
wafEngineConfig: [{name: '<string>', valueEncoded: '<string>'}],
dDoSChallengeWindow: 123,
whitelabelResponsePages: true
}
})
};

fetch('https://api.bunny.net/shield/shield-zone', 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/shield-zone",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pullZoneId' => 123,
'shieldZone' => [
'shieldZoneId' => 123,
'premiumPlan' => true,
'learningMode' => true,
'learningModeUntil' => '2023-11-07T05:31:56Z',
'wafEnabled' => true,
'wafDisabledRules' => [
'<string>'
],
'wafLogOnlyRules' => [
'<string>'
],
'wafCustomRuleOrder' => [
123
],
'wafRequestHeaderLoggingEnabled' => true,
'requestBodyLoggingEnabled' => true,
'wafRequestIgnoredHeaders' => [
'<string>'
],
'wafRealtimeThreatIntelligenceEnabled' => true,
'wafProfileId' => 123,
'wafEngineConfig' => [
[
'name' => '<string>',
'valueEncoded' => '<string>'
]
],
'dDoSChallengeWindow' => 123,
'whitelabelResponsePages' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://api.bunny.net/shield/shield-zone"

payload := strings.NewReader("{\n \"pullZoneId\": 123,\n \"shieldZone\": {\n \"shieldZoneId\": 123,\n \"premiumPlan\": true,\n \"learningMode\": true,\n \"learningModeUntil\": \"2023-11-07T05:31:56Z\",\n \"wafEnabled\": true,\n \"wafDisabledRules\": [\n \"<string>\"\n ],\n \"wafLogOnlyRules\": [\n \"<string>\"\n ],\n \"wafCustomRuleOrder\": [\n 123\n ],\n \"wafRequestHeaderLoggingEnabled\": true,\n \"requestBodyLoggingEnabled\": true,\n \"wafRequestIgnoredHeaders\": [\n \"<string>\"\n ],\n \"wafRealtimeThreatIntelligenceEnabled\": true,\n \"wafProfileId\": 123,\n \"wafEngineConfig\": [\n {\n \"name\": \"<string>\",\n \"valueEncoded\": \"<string>\"\n }\n ],\n \"dDoSChallengeWindow\": 123,\n \"whitelabelResponsePages\": true\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.bunny.net/shield/shield-zone")
.header("Content-Type", "application/json")
.body("{\n \"pullZoneId\": 123,\n \"shieldZone\": {\n \"shieldZoneId\": 123,\n \"premiumPlan\": true,\n \"learningMode\": true,\n \"learningModeUntil\": \"2023-11-07T05:31:56Z\",\n \"wafEnabled\": true,\n \"wafDisabledRules\": [\n \"<string>\"\n ],\n \"wafLogOnlyRules\": [\n \"<string>\"\n ],\n \"wafCustomRuleOrder\": [\n 123\n ],\n \"wafRequestHeaderLoggingEnabled\": true,\n \"requestBodyLoggingEnabled\": true,\n \"wafRequestIgnoredHeaders\": [\n \"<string>\"\n ],\n \"wafRealtimeThreatIntelligenceEnabled\": true,\n \"wafProfileId\": 123,\n \"wafEngineConfig\": [\n {\n \"name\": \"<string>\",\n \"valueEncoded\": \"<string>\"\n }\n ],\n \"dDoSChallengeWindow\": 123,\n \"whitelabelResponsePages\": true\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bunny.net/shield/shield-zone")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"pullZoneId\": 123,\n \"shieldZone\": {\n \"shieldZoneId\": 123,\n \"premiumPlan\": true,\n \"learningMode\": true,\n \"learningModeUntil\": \"2023-11-07T05:31:56Z\",\n \"wafEnabled\": true,\n \"wafDisabledRules\": [\n \"<string>\"\n ],\n \"wafLogOnlyRules\": [\n \"<string>\"\n ],\n \"wafCustomRuleOrder\": [\n 123\n ],\n \"wafRequestHeaderLoggingEnabled\": true,\n \"requestBodyLoggingEnabled\": true,\n \"wafRequestIgnoredHeaders\": [\n \"<string>\"\n ],\n \"wafRealtimeThreatIntelligenceEnabled\": true,\n \"wafProfileId\": 123,\n \"wafEngineConfig\": [\n {\n \"name\": \"<string>\",\n \"valueEncoded\": \"<string>\"\n }\n ],\n \"dDoSChallengeWindow\": 123,\n \"whitelabelResponsePages\": true\n }\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "pullZoneId": 123,
    "shieldZone": {
      "shieldZoneId": 123,
      "premiumPlan": true,
      "learningMode": true,
      "learningModeUntil": "2023-11-07T05:31:56Z",
      "wafEnabled": true,
      "wafDisabledRules": [
        "<string>"
      ],
      "wafLogOnlyRules": [
        "<string>"
      ],
      "wafCustomRuleOrder": [
        123
      ],
      "wafRequestHeaderLoggingEnabled": true,
      "requestBodyLoggingEnabled": true,
      "wafRequestIgnoredHeaders": [
        "<string>"
      ],
      "wafRealtimeThreatIntelligenceEnabled": true,
      "wafProfileId": 123,
      "wafEngineConfig": [
        {
          "name": "<string>",
          "valueEncoded": "<string>"
        }
      ],
      "dDoSChallengeWindow": 123,
      "whitelabelResponsePages": true
    }
  },
  "error": {
    "success": true,
    "message": "<string>",
    "errorKey": "<string>"
  }
}
{
"statusCode": 123
}
{
"data": {
"pullZoneId": 123,
"shieldZone": {
"shieldZoneId": 123,
"premiumPlan": true,
"learningMode": true,
"learningModeUntil": "2023-11-07T05:31:56Z",
"wafEnabled": true,
"wafDisabledRules": [
"<string>"
],
"wafLogOnlyRules": [
"<string>"
],
"wafCustomRuleOrder": [
123
],
"wafRequestHeaderLoggingEnabled": true,
"requestBodyLoggingEnabled": true,
"wafRequestIgnoredHeaders": [
"<string>"
],
"wafRealtimeThreatIntelligenceEnabled": true,
"wafProfileId": 123,
"wafEngineConfig": [
{
"name": "<string>",
"valueEncoded": "<string>"
}
],
"dDoSChallengeWindow": 123,
"whitelabelResponsePages": true
}
},
"error": {
"success": true,
"message": "<string>",
"errorKey": "<string>"
}
}
{
"data": {
"pullZoneId": 123,
"shieldZone": {
"shieldZoneId": 123,
"premiumPlan": true,
"learningMode": true,
"learningModeUntil": "2023-11-07T05:31:56Z",
"wafEnabled": true,
"wafDisabledRules": [
"<string>"
],
"wafLogOnlyRules": [
"<string>"
],
"wafCustomRuleOrder": [
123
],
"wafRequestHeaderLoggingEnabled": true,
"requestBodyLoggingEnabled": true,
"wafRequestIgnoredHeaders": [
"<string>"
],
"wafRealtimeThreatIntelligenceEnabled": true,
"wafProfileId": 123,
"wafEngineConfig": [
{
"name": "<string>",
"valueEncoded": "<string>"
}
],
"dDoSChallengeWindow": 123,
"whitelabelResponsePages": true
}
},
"error": {
"success": true,
"message": "<string>",
"errorKey": "<string>"
}
}

Body

Represents a request to create a new Shield Zone.

pullZoneId
integer<int64>
required
shieldZone
object

Response

OK

Response object for creating a new Shield Zone.

data
object

Represents a request to create a new Shield Zone.

error
object

Generic response object containing status information for API operations.

Last modified on July 7, 2026