---
title: "Add/Update Edge Rule"
method: POST
path: "/pullzone/{pullZoneId}/edgerules/addOrUpdate"
tags: ["Pull Zone"]
---

# Add/Update Edge Rule

`POST /pullzone/{pullZoneId}/edgerules/addOrUpdate`

## Path parameters

- `pullZoneId` integer, required

## Request body

- EdgeRuleV2Model
  - `Guid` string, nullable — The unique GUID of the edge rule
  - `ActionType` 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 | 30 | 31 | 32 | 33 | 34 | 37 — 0 = ForceSSL 1 = Redirect 2 = OriginUrl 3 = OverrideCacheTime 4 = BlockRequest 5 = SetResponseHeader 6 = SetRequestHeader 7 = ForceDownload 8 = DisableTokenAuthentication 9 = EnableTokenAuthentication 10 = OverrideCacheTimePublic 11 = IgnoreQueryString 12 = DisableOptimizer 13 = ForceCompression 14 = SetStatusCode 15 = BypassPermaCache 16 = OverrideBrowserCacheTime 17 = OriginStorage 18 = SetNetworkRateLimit 19 = SetConnectionLimit 20 = SetRequestsPerSecondLimit 21 = RunEdgeScript 22 = OriginMagicContainers 23 = DisableWAF 24 = RetryOrigin 25 = OverrideBrowserCacheResponseHeader 26 = RemoveBrowserCacheResponseHeader 27 = DisableShieldChallenge 28 = DisableShield 29 = DisableShieldBotDetection 30 = BypassAwsS3Authentication 31 = DisableShieldAccessLists 32 = DisableShieldRateLimiting 33 = EnableRequestCoalescing 34 = DisableRequestCoalescing 37 = StripCookiesClientToOrigin
  - `ActionParameter1` string, nullable — The Action parameter 1. The value depends on other parameters of the edge rule.
  - `ActionParameter2` string, nullable — The Action parameter 2. The value depends on other parameters of the edge rule.
  - `ActionParameter3` string, nullable — The Action parameter 3. The value depends on other parameters of the edge rule.
  - `Triggers` Trigger[], nullable
    - `Type` 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 — 0 = Url 1 = RequestHeader 2 = ResponseHeader 3 = UrlExtension 4 = CountryCode 5 = RemoteIP 6 = UrlQueryString 7 = RandomChance 8 = StatusCode 9 = RequestMethod 10 = CookieValue 11 = CountryStateCode 12 = OriginRetryAttemptCount 13 = OriginConnectionError
    - `PatternMatches` string[], nullable — The list of pattern matches that will trigger the edge rule
    - `PatternMatchingType` 0 | 1 | 2 — 0 = MatchAny 1 = MatchAll 2 = MatchNone
    - `Parameter1` string, nullable — The trigger parameter 1. The value depends on the type of trigger.
  - `ExtraActions` EdgeRuleV2ActionModel[], nullable
    - `ActionType` 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 | 30 | 31 | 32 | 33 | 34 | 37 — 0 = ForceSSL 1 = Redirect 2 = OriginUrl 3 = OverrideCacheTime 4 = BlockRequest 5 = SetResponseHeader 6 = SetRequestHeader 7 = ForceDownload 8 = DisableTokenAuthentication 9 = EnableTokenAuthentication 10 = OverrideCacheTimePublic 11 = IgnoreQueryString 12 = DisableOptimizer 13 = ForceCompression 14 = SetStatusCode 15 = BypassPermaCache 16 = OverrideBrowserCacheTime 17 = OriginStorage 18 = SetNetworkRateLimit 19 = SetConnectionLimit 20 = SetRequestsPerSecondLimit 21 = RunEdgeScript 22 = OriginMagicContainers 23 = DisableWAF 24 = RetryOrigin 25 = OverrideBrowserCacheResponseHeader 26 = RemoveBrowserCacheResponseHeader 27 = DisableShieldChallenge 28 = DisableShield 29 = DisableShieldBotDetection 30 = BypassAwsS3Authentication 31 = DisableShieldAccessLists 32 = DisableShieldRateLimiting 33 = EnableRequestCoalescing 34 = DisableRequestCoalescing 37 = StripCookiesClientToOrigin
    - `ActionParameter1` string, nullable
    - `ActionParameter2` string, nullable
    - `ActionParameter3` string, nullable
  - `TriggerMatchingType` 0 | 1 | 2 — 0 = MatchAny 1 = MatchAll 2 = MatchNone
  - `Description` string, nullable — 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
  - `ReadOnly` boolean — Determines if the edge rule is read-only and cannot be modified or deleted

## Response `201`

The Edge Rule was successfuly added

## Other responses

- `401` — The request authorization failed
- `404` — The Pull Zone with the requested ID does not exist
- `500` — Internal Server Error

---

[API](https://skmtc.net/bunny/apis/bunny-net-cdn-logging.md) · [All operations](https://skmtc.net/bunny/apis/bunny-net-cdn-logging/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bunny/bunny-net-cdn-logging/revisions/9e622620664b/schema)
