Skip to main content
POST
/
pullzone
/
{pullZoneId}
/
edgerules
/
addOrUpdate
Add/Update Edge Rule
curl --request POST \
  --url https://api.bunny.net/pullzone/{pullZoneId}/edgerules/addOrUpdate \
  --header 'AccessKey: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "Guid": "<string>",
  "ActionType": 0,
  "ActionParameter1": "<string>",
  "ActionParameter2": "<string>",
  "ActionParameter3": "<string>",
  "Triggers": [
    {
      "Type": 0,
      "PatternMatches": [
        "<string>"
      ],
      "PatternMatchingType": 0,
      "Parameter1": "<string>"
    }
  ],
  "ExtraActions": [
    {
      "ActionType": 0,
      "ActionParameter1": "<string>",
      "ActionParameter2": "<string>",
      "ActionParameter3": "<string>"
    }
  ],
  "TriggerMatchingType": 0,
  "Description": "<string>",
  "Enabled": true,
  "OrderIndex": 123,
  "ReadOnly": true
}
'

Authorizations

AccessKey
string
header
required

API Access Key authorization header

Path Parameters

pullZoneId
integer<int64>
required

The ID of the Pull Zone where the Edge Rule will be created

Body

application/json

The Edge Rule that will be added

Guid
string | null

The unique GUID of the edge rule

ActionType
enum<integer>

The action type of the edge rule. ForceSSL = 0, Redirect = 1, OriginUrl = 2, OverrideCacheTime = 3, BlockRequest = 4, SetResponseHeader = 5, SetRequestHeader = 6, ForceDownload = 7, DisableTokenAuthentication = 8, EnableTokenAuthentication = 9, OverrideCacheTimePublic = 10, IgnoreQueryString = 11, DisableOptimizer = 12, ForceCompression = 13, SetStatusCode = 14, BypassPermaCache = 15, OverrideBrowserCacheTime = 16

Available options:
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29
ActionParameter1
string | null

The Action parameter 1. The value depends on other parameters of the edge rule.

ActionParameter2
string | null

The Action parameter 2. The value depends on other parameters of the edge rule.

ActionParameter3
string | null

The Action parameter 3. The value depends on other parameters of the edge rule.

Triggers
object[] | null
ExtraActions
object[] | null
TriggerMatchingType
enum<integer>

The trigger matching type. MatchAny = 0, MatchAll = 1, MatchNone = 2

Available options:
0,
1,
2
Description
string | null

The description of the edge rule

Enabled
boolean

Determines if the edge rule is currently enabled or not

OrderIndex
integer<int32>

The index of the edge rule in the list of execution priority

ReadOnly
boolean

Determines if the edge rule is read-only and cannot be modified or deleted

Response

The Edge Rule was successfuly added