Skip to main content
POST
/
storagezone
Add Storage Zone
curl --request POST \
  --url https://api.bunny.net/storagezone \
  --header 'AccessKey: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "Name": "<string>",
  "Region": "<string>",
  "ReplicationRegions": [
    "<string>"
  ],
  "ZoneTier": "Standard",
  "StorageZoneType": "NotSupported"
}
'
{
  "Id": 123,
  "DateModified": "2023-11-07T05:31:56Z",
  "Deleted": true,
  "StorageUsed": 123,
  "FilesStored": 123,
  "Rewrite404To200": true,
  "ReplicationChangeInProgress": true,
  "PriceOverride": 123,
  "Discount": 123,
  "UserId": "<string>",
  "Name": "<string>",
  "Password": "<string>",
  "Region": "<string>",
  "ReplicationRegions": [
    "<string>"
  ],
  "PullZones": [
    {
      "Id": 123,
      "Enabled": true,
      "Suspended": true,
      "StorageZoneId": 123,
      "EdgeScriptId": 123,
      "EnableGeoZoneUS": true,
      "EnableGeoZoneEU": true,
      "EnableGeoZoneASIA": true,
      "EnableGeoZoneSA": true,
      "EnableGeoZoneAF": true,
      "ZoneSecurityEnabled": true,
      "ZoneSecurityIncludeHashRemoteIP": true,
      "IgnoreQueryStrings": true,
      "MonthlyBandwidthLimit": 123,
      "MonthlyBandwidthUsed": 123,
      "MonthlyCharges": 123,
      "AddHostHeader": true,
      "EnableAccessControlOriginHeader": true,
      "DisableCookies": true,
      "EnableOriginShield": true,
      "CacheControlMaxAgeOverride": 123,
      "CacheControlPublicMaxAgeOverride": 123,
      "BurstSize": 123,
      "RequestLimit": 123,
      "BlockRootPathAccess": true,
      "BlockPostRequests": true,
      "LimitRatePerSecond": 123,
      "LimitRateAfter": 123,
      "ConnectionLimitPerIPCount": 123,
      "PriceOverride": 123,
      "OptimizerPricing": 123,
      "AddCanonicalHeader": true,
      "EnableLogging": true,
      "EnableCacheSlice": true,
      "EnableSmartCache": true,
      "EnableWebPVary": true,
      "EnableAvifVary": true,
      "EnableCountryCodeVary": true,
      "EnableCountryStateCodeVary": true,
      "EnableMobileVary": true,
      "EnableCookieVary": true,
      "EnableHostnameVary": true,
      "AWSSigningEnabled": true,
      "LoggingIPAnonymizationEnabled": true,
      "EnableTLS1": true,
      "EnableTLS1_1": true,
      "VerifyOriginSSL": true,
      "ErrorPageEnableCustomCode": true,
      "ErrorPageEnableStatuspageWidget": true,
      "ErrorPageWhitelabel": true,
      "LogForwardingEnabled": true,
      "LogForwardingPort": 123,
      "LoggingSaveToStorage": true,
      "LoggingStorageZoneId": 123,
      "FollowRedirects": true,
      "VideoLibraryId": 123,
      "DnsRecordId": 123,
      "DnsZoneId": 123,
      "OptimizerEnabled": true,
      "OptimizerTunnelEnabled": true,
      "OptimizerDesktopMaxWidth": 2500,
      "OptimizerMobileMaxWidth": 2500,
      "OptimizerImageQuality": 50,
      "OptimizerMobileImageQuality": 50,
      "OptimizerEnableWebP": true,
      "OptimizerPrerenderHtml": true,
      "OptimizerEnableManipulationEngine": true,
      "OptimizerMinifyCSS": true,
      "OptimizerMinifyJavaScript": true,
      "OptimizerWatermarkEnabled": true,
      "OptimizerWatermarkOffset": 123,
      "OptimizerWatermarkMinImageSize": 123,
      "OptimizerAutomaticOptimizationEnabled": true,
      "PermaCacheStorageZoneId": 123,
      "OriginRetries": 123,
      "OriginConnectTimeout": 123,
      "OriginResponseTimeout": 123,
      "UseStaleWhileUpdating": true,
      "UseStaleWhileOffline": true,
      "OriginRetry5XXResponses": true,
      "OriginRetryConnectionTimeout": true,
      "OriginRetryResponseTimeout": true,
      "OriginRetryDelay": 123,
      "OriginShieldEnableConcurrencyLimit": true,
      "OriginShieldMaxConcurrentRequests": 123,
      "EnableSafeHop": true,
      "CacheErrorResponses": true,
      "OriginShieldQueueMaxWaitTime": 123,
      "OriginShieldMaxQueuedRequests": 123,
      "OptimizerForceClasses": true,
      "UseBackgroundUpdate": true,
      "EnableAutoSSL": true,
      "EnableQueryStringOrdering": true,
      "ShieldDDosProtectionEnabled": true,
      "EnableRequestCoalescing": true,
      "RequestCoalescingTimeout": 123,
      "DisableLetsEncrypt": true,
      "EnableBunnyImageAi": true,
      "PreloadingScreenEnabled": true,
      "PreloadingScreenShowOnFirstVisit": true,
      "PreloadingScreenCodeEnabled": true,
      "PreloadingScreenDelay": 123,
      "EUUSDiscount": 123,
      "SouthAmericaDiscount": 123,
      "AfricaDiscount": 123,
      "AsiaOceaniaDiscount": 123,
      "BlockNoneReferrer": true,
      "CacheVersion": 123,
      "OptimizerEnableUpscaling": true,
      "EnableWebSockets": true,
      "MaxWebSocketConnections": 123,
      "Name": "<string>",
      "OriginUrl": "<string>",
      "Hostnames": [
        {
          "Id": 123,
          "ForceSSL": true,
          "IsSystemHostname": true,
          "IsManagedHostname": true,
          "HasCertificate": true,
          "Value": "<string>",
          "Certificate": "<string>",
          "CertificateKey": "<string>",
          "CertificateKeyType": "Ecdsa",
          "CertificateProvisionType": "Unknown"
        }
      ],
      "EdgeScriptExecutionPhase": "Cache",
      "MiddlewareScriptId": 123,
      "MagicContainersAppId": "<string>",
      "MagicContainersEndpointId": "<string>",
      "AllowedReferrers": [
        "<string>"
      ],
      "BlockedReferrers": [
        "<string>"
      ],
      "BlockedIps": [
        "<string>"
      ],
      "ZoneSecurityKey": "<string>",
      "OriginHostHeader": "<string>",
      "Type": "Premium",
      "AccessControlOriginHeaderExtensions": [
        "<string>"
      ],
      "BudgetRedirectedCountries": [
        "<string>"
      ],
      "BlockedCountries": [
        "<string>"
      ],
      "EdgeRules": [
        {
          "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
        }
      ],
      "CookieVaryParameters": [
        "<string>"
      ],
      "CnameDomain": "<string>",
      "AWSSigningKey": "<string>",
      "AWSSigningSecret": "<string>",
      "AWSSigningRegionName": "<string>",
      "ErrorPageCustomCode": "<string>",
      "ErrorPageStatuspageCode": "<string>",
      "OriginShieldZoneCode": "<string>",
      "LogForwardingHostname": "<string>",
      "LogForwardingToken": "<string>",
      "LogForwardingProtocol": "UDP",
      "DnsRecordValue": "<string>",
      "OptimizerWatermarkUrl": "<string>",
      "OptimizerWatermarkPosition": {},
      "PermaCacheType": "Automatic",
      "QueryStringVaryParameters": [
        "<string>"
      ],
      "OptimizerClasses": [
        {
          "Name": "<string>",
          "Properties": {}
        }
      ],
      "OptimizerStaticHtmlWordPressPath": "<string>",
      "OptimizerStaticHtmlWordPressBypassCookie": "<string>",
      "LogAnonymizationType": "OneDigit",
      "LogFormat": "Plain",
      "LogForwardingFormat": "Plain",
      "ShieldDDosProtectionType": "DetectOnly",
      "OriginType": "OriginUrl",
      "OriginLinkValue": "<string>",
      "BunnyAiImageBlueprints": [
        {
          "Name": "<string>",
          "Properties": {}
        }
      ],
      "PreloadingScreenCode": "<string>",
      "PreloadingScreenLogoUrl": "<string>",
      "PreloadingScreenTheme": "Light",
      "RoutingFilters": [
        "<string>"
      ],
      "StickySessionType": "Off",
      "StickySessionCookieName": "<string>",
      "StickySessionClientHeaders": "<string>",
      "UserId": "<string>"
    }
  ],
  "ReadOnlyPassword": "<string>",
  "Custom404FilePath": "<string>",
  "StorageHostname": "<string>",
  "ZoneTier": "Standard",
  "StorageZoneType": "NotSupported"
}

Authorizations

AccessKey
string
header
required

API Access Key authorization header

Body

Name
string | null
required

The name of the storage zone

Region
string | null
required

The code of the main storage zone region (Possible values: DE, NY, LA, SG)

ReplicationRegions
string[] | null

The code of the main storage zone region (Possible values: DE, NY, LA, SG, SYD)

ZoneTier
enum<string>

Determines the storage zone tier that will be storing the data

Available options:
Standard,
Edge
Example:

"Standard"

StorageZoneType
enum<string>

The Storage Zone S3 support type

Available options:
NotSupported,
Supported
Example:

"NotSupported"

Response

The storage zone that was added

Id
integer<int64>
required

The ID of the storage zone

DateModified
string<date-time>
required

The date when the zone was last modified

Deleted
boolean
required

Determines if the zone was deleted or not

StorageUsed
integer<int64>
required

The total amount of storage used by this zone

FilesStored
integer<int64>
required

The total number of files stored by this zone

Rewrite404To200
boolean
required

Determines if the storage zone will rewrite 404 status codes to 200 status codes

ReplicationChangeInProgress
boolean
required

Determines if the storage zone is currently enabling a new replication region

PriceOverride
number<decimal>
required

The custom price override for this zone. Unit is $/TB/month.

Discount
integer<int32>
required

The Storage Zone specific pricing discount.

UserId
string | null

The ID of the user that owns the storage zone

Name
string | null

The name of the storage zone

Password
string | null

The API access key or FTP password

Region
string | null

The main region used by the storage zone

ReplicationRegions
string[] | null

The replication regions enabled for this storage zone

PullZones
object[] | null

The list of pull zones connected to this storage zone

ReadOnlyPassword
string | null

The read-only API access key or FTP password

Custom404FilePath
string | null

The custom 404 error path that will be returned in case of a missing file.

StorageHostname
string | null

Determines the storage hostname for this zone

ZoneTier
enum<string>

Determines the storage zone tier that is storing the data

Available options:
Standard,
Edge
Example:

"Standard"

StorageZoneType
enum<string>

The Storage Zone S3 support type

Available options:
NotSupported,
Supported
Example:

"NotSupported"