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": "ForceSSL",
  "ActionParameter1": "<string>",
  "ActionParameter2": "<string>",
  "ActionParameter3": "<string>",
  "Triggers": [
    {
      "Type": "Url",
      "PatternMatchingType": 0,
      "PatternMatches": [
        "<string>"
      ],
      "Parameter1": "<string>"
    }
  ],
  "ExtraActions": [
    {
      "ActionType": "<unknown>",
      "ActionParameter1": "<string>",
      "ActionParameter2": "<string>",
      "ActionParameter3": "<string>"
    }
  ],
  "TriggerMatchingType": 0,
  "Description": "<string>",
  "Enabled": true,
  "OrderIndex": 123
}
'

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

Model definition for EdgeRuleV2Model

Guid
string

The unique GUID of the edge rule

ActionType
enum<string>

The action type of the edge rule

Available options:
ForceSSL,
Redirect,
OriginUrl,
OverrideCacheTime,
BlockRequest,
SetResponseHeader,
SetRequestHeader,
ForceDownload,
DisableTokenAuthentication,
EnableTokenAuthentication,
OverrideCacheTimePublic,
IgnoreQueryString,
DisableOptimizer,
ForceCompression,
SetStatusCode,
BypassPermaCache,
OverrideBrowserCacheTime,
OriginStorage,
SetNetworkRateLimit,
SetConnectionLimit,
SetRequestsPerSecondLimit,
RunEdgeScript,
OriginMagicContainers,
DisableWAF,
RetryOrigin,
OverrideBrowserCacheResponseHeader,
RemoveBrowserCacheResponseHeader,
DisableShieldChallenge,
DisableShield,
DisableShieldBotDetection,
BypassAwsS3Authentication,
DisableShieldAccessLists,
DisableShieldRateLimiting
Example:

"ForceSSL"

ActionParameter1
string

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

ActionParameter2
string

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

ActionParameter3
string

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

Triggers
object[]

The list of trigger that trigger the edge rule

ExtraActions
object[]

Additional actions to be performed

TriggerMatchingType
enum<integer>

The trigger matching type

Available options:
0,
1,
2
Description
string

The description of the edge rule

Enabled
boolean

Determines if the edge rule is currently enabled or not

OrderIndex
integer

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

Response

The Edge Rule was successfuly added