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

# Add/Update Edge Rule

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

## Request

- Base URL: `https://api.bunny.net`
- URL: `https://api.bunny.net/pullzone/{pullZoneId}/edgerules/addOrUpdate`
- Auth: API key in header `AccessKey`
- TypeScript: <https://skmtc.dev/bunny/apis/bunny-net-api/docs/pullzone/:pullZoneId/edgerules/addOrUpdate/post.ts> (a function with typed inputs; its response is checked against the schema)

## 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 | 35 | 36 | 37: 0 = Force SSL 1 = Redirect 2 = Origin URL 3 = Override Cache Time 4 = Block Request 5 = Set Response Header 6 = Set Request Header 7 = Force Download 8 = Disable Token Authentication 9 = Enable Token Authentication 10 = Override Cache Time Public 11 = Ignore Query String 12 = Disable Optimizer 13 = Force Compression 14 = Set Status Code 15 = Bypass Perma-Cache 16 = Override Browser Cache Time 17 = Origin Storage 18 = Set Network Rate Limit 19 = Set Connection Limit 20 = Set Requests Per Second Limit 21 = Run Edge Script 22 = Origin Magic Containers 23 = Disable WAF 24 = Retry Origin 25 = Override Browser Cache Response Header 26 = Remove Browser Cache Response Header 27 = Disable Shield Challenge 28 = Disable Shield 29 = Disable Shield Bot Detection 30 = Bypass AWS S3 Authentication 31 = Disable Shield Access Lists 32 = Disable Shield Rate Limiting 33 = Enable Request Coalescing 34 = Disable Request Coalescing 35 = Use Load Balancer 36 = Force Load Balancer Sticky Session Mode 37 = Strip Cookies (Client to Origin)
  - `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 = Request Header 2 = Response Header 3 = URL Extension 4 = Country Code 5 = Remote IP 6 = URL Query String 7 = Random Chance 8 = Status Code 9 = Request Method 10 = Cookie Value 11 = Country State Code 12 = Origin Retry Attempt Count 13 = Origin Connection Error
    - `PatternMatches` string[], nullable: The list of pattern matches that will trigger the edge rule
    - `PatternMatchingType` 0 | 1 | 2: 0 = Match Any 1 = Match All 2 = Match None
    - `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 | 35 | 36 | 37: 0 = Force SSL 1 = Redirect 2 = Origin URL 3 = Override Cache Time 4 = Block Request 5 = Set Response Header 6 = Set Request Header 7 = Force Download 8 = Disable Token Authentication 9 = Enable Token Authentication 10 = Override Cache Time Public 11 = Ignore Query String 12 = Disable Optimizer 13 = Force Compression 14 = Set Status Code 15 = Bypass Perma-Cache 16 = Override Browser Cache Time 17 = Origin Storage 18 = Set Network Rate Limit 19 = Set Connection Limit 20 = Set Requests Per Second Limit 21 = Run Edge Script 22 = Origin Magic Containers 23 = Disable WAF 24 = Retry Origin 25 = Override Browser Cache Response Header 26 = Remove Browser Cache Response Header 27 = Disable Shield Challenge 28 = Disable Shield 29 = Disable Shield Bot Detection 30 = Bypass AWS S3 Authentication 31 = Disable Shield Access Lists 32 = Disable Shield Rate Limiting 33 = Enable Request Coalescing 34 = Disable Request Coalescing 35 = Use Load Balancer 36 = Force Load Balancer Sticky Session Mode 37 = Strip Cookies (Client to Origin)
    - `ActionParameter1` string, nullable
    - `ActionParameter2` string, nullable
    - `ActionParameter3` string, nullable
  - `TriggerMatchingType` 0 | 1 | 2: 0 = Match Any 1 = Match All 2 = Match None
  - `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 successfully added

## Other responses

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

## Changes

- **2026-11-12** `2b06f94dbfbf`: 39 breaking, 1 info
  - removed the enum value `0.00` of the request property `ExtraActions/items/ActionType`
  - removed the enum value `1.00` of the request property `ExtraActions/items/ActionType`
  - removed the enum value `10.00` of the request property `ExtraActions/items/ActionType`
  - removed the enum value `11.00` of the request property `ExtraActions/items/ActionType`
  - …36 more
- **2026-10-27** `2096a6606d8d`: 4 info
  - added the new `35.00` enum value to the request property `ActionType/oneOf[#/components/schemas/EdgeRuleActionType]/`
  - added the new `35.00` enum value to the request property `ExtraActions/items/ActionType`
  - added the new `36.00` enum value to the request property `ActionType/oneOf[#/components/schemas/EdgeRuleActionType]/`
  - added the new `36.00` enum value to the request property `ExtraActions/items/ActionType`
- **2026-08-07** `205129a7ebd5`: 2 info
  - added the new `37.00` enum value to the request property `ActionType/oneOf[#/components/schemas/EdgeRuleActionType]/`
  - added the new `37.00` enum value to the request property `ExtraActions/items/ActionType`
- …earlier changes not shown

[Operation history](https://skmtc.dev/bunny/apis/bunny-net-api/changes/pullzone/:pullZoneId/edgerules/addOrUpdate/post.md)

---

[API](https://skmtc.dev/bunny/apis/bunny-net-api.md) - [All operations](https://skmtc.dev/bunny/apis/bunny-net-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bunny/apis/bunny-net-api/revisions/2b06f94dbfbf?raw)
