openapi: 3.1.0 info: title: Bunny.net Core Platform API description: | Best-effort OpenAPI 3.1 description of the Bunny.net Core Platform REST API for managing Pull Zones, Storage Zones, DNS Zones, Stream video libraries, statistics, billing, purge, API keys, and reference data. Authentication uses the `AccessKey` header containing your account API key issued from the Bunny.net dashboard. version: "1.0" contact: name: Bunny.net url: https://docs.bunny.net/reference/bunnynet-api-overview servers: - url: https://api.bunny.net description: Bunny.net Core Platform API security: - accessKeyAuth: [] tags: - name: PullZones - name: StorageZones - name: DNSZones - name: Stream - name: Statistics - name: Billing - name: Purge - name: APIKeys - name: Countries - name: Regions paths: /pullzone: get: tags: [PullZones] summary: List pull zones operationId: listPullZones parameters: - name: page in: query schema: type: integer - name: perPage in: query schema: type: integer - name: includeCertificate in: query schema: type: boolean responses: "200": description: List of pull zones content: application/json: schema: $ref: "#/components/schemas/PullZoneList" post: tags: [PullZones] summary: Add a pull zone operationId: addPullZone requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PullZoneCreate" responses: "201": description: Pull zone created content: application/json: schema: $ref: "#/components/schemas/PullZone" /pullzone/{id}: parameters: - $ref: "#/components/parameters/IdPath" get: tags: [PullZones] summary: Get pull zone operationId: getPullZone responses: "200": description: Pull zone content: application/json: schema: $ref: "#/components/schemas/PullZone" post: tags: [PullZones] summary: Update pull zone operationId: updatePullZone requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PullZoneUpdate" responses: "200": description: Pull zone content: application/json: schema: $ref: "#/components/schemas/PullZone" delete: tags: [PullZones] summary: Delete pull zone operationId: deletePullZone responses: "204": description: Deleted /pullzone/{id}/purgeCache: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Purge pull zone cache operationId: purgePullZoneCache responses: "204": description: Purged /pullzone/{id}/addAllowedReferer: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Add allowed referer operationId: addAllowedReferer requestBody: required: true content: application/json: schema: type: object required: [Hostname] properties: Hostname: type: string responses: "204": description: Added /pullzone/{id}/removeAllowedReferer: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Remove allowed referer operationId: removeAllowedReferer requestBody: required: true content: application/json: schema: type: object required: [Hostname] properties: Hostname: type: string responses: "204": description: Removed /pullzone/{id}/addBlockedIP: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Add blocked IP operationId: addBlockedIp requestBody: required: true content: application/json: schema: type: object required: [BlockedIp] properties: BlockedIp: type: string responses: "204": description: Added /pullzone/{id}/removeBlockedIP: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Remove blocked IP operationId: removeBlockedIp requestBody: required: true content: application/json: schema: type: object required: [BlockedIp] properties: BlockedIp: type: string responses: "204": description: Removed /pullzone/{id}/addCustomCertificate: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Add custom certificate operationId: addCustomCertificate requestBody: required: true content: application/json: schema: type: object properties: Hostname: type: string Certificate: type: string CertificateKey: type: string responses: "204": description: Added /pullzone/{id}/addCustomHostname: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Add custom hostname operationId: addCustomHostname requestBody: required: true content: application/json: schema: type: object required: [Hostname] properties: Hostname: type: string responses: "204": description: Added /pullzone/{id}/removeCustomHostname: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Remove custom hostname operationId: removeCustomHostname requestBody: required: true content: application/json: schema: type: object required: [Hostname] properties: Hostname: type: string responses: "204": description: Removed /pullzone/{id}/setForceSSL: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Set force SSL on hostname operationId: setForceSsl requestBody: required: true content: application/json: schema: type: object properties: Hostname: type: string ForceSSL: type: boolean responses: "204": description: Set /pullzone/{id}/resetTokenKey: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [PullZones] summary: Reset token authentication key operationId: resetTokenKey responses: "204": description: Reset /storagezone: get: tags: [StorageZones] summary: List storage zones operationId: listStorageZones responses: "200": description: Storage zones content: application/json: schema: type: array items: $ref: "#/components/schemas/StorageZone" post: tags: [StorageZones] summary: Add a storage zone operationId: addStorageZone requestBody: required: true content: application/json: schema: type: object required: [Name] properties: Name: type: string Region: type: string ReplicationRegions: type: array items: type: string ZoneTier: type: integer responses: "201": description: Storage zone content: application/json: schema: $ref: "#/components/schemas/StorageZone" /storagezone/{id}: parameters: - $ref: "#/components/parameters/IdPath" get: tags: [StorageZones] summary: Get storage zone operationId: getStorageZone responses: "200": description: Storage zone content: application/json: schema: $ref: "#/components/schemas/StorageZone" post: tags: [StorageZones] summary: Update storage zone operationId: updateStorageZone requestBody: required: true content: application/json: schema: type: object properties: ReplicationZones: type: array items: type: string OriginUrl: type: [string, "null"] Custom404FilePath: type: string Rewrite404To200: type: boolean responses: "204": description: Updated delete: tags: [StorageZones] summary: Delete storage zone operationId: deleteStorageZone responses: "204": description: Deleted /storagezone/{id}/resetPassword: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [StorageZones] summary: Reset storage zone password operationId: resetStorageZonePassword responses: "204": description: Reset /storagezone/{id}/resetReadOnlyPassword: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [StorageZones] summary: Reset read-only password operationId: resetReadOnlyPassword responses: "204": description: Reset /dnszone: get: tags: [DNSZones] summary: List DNS zones operationId: listDnsZones responses: "200": description: DNS zones content: application/json: schema: type: array items: $ref: "#/components/schemas/DnsZone" post: tags: [DNSZones] summary: Add DNS zone operationId: addDnsZone requestBody: required: true content: application/json: schema: type: object required: [Domain] properties: Domain: type: string responses: "201": description: DNS zone content: application/json: schema: $ref: "#/components/schemas/DnsZone" /dnszone/{id}: parameters: - $ref: "#/components/parameters/IdPath" get: tags: [DNSZones] summary: Get DNS zone operationId: getDnsZone responses: "200": description: DNS zone content: application/json: schema: $ref: "#/components/schemas/DnsZone" post: tags: [DNSZones] summary: Update DNS zone operationId: updateDnsZone requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: "204": description: Updated delete: tags: [DNSZones] summary: Delete DNS zone operationId: deleteDnsZone responses: "204": description: Deleted /dnszone/{id}/records: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [DNSZones] summary: Add DNS record operationId: addDnsRecord requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DnsRecord" responses: "201": description: DNS record content: application/json: schema: $ref: "#/components/schemas/DnsRecord" /dnszone/{id}/records/{recordId}: parameters: - $ref: "#/components/parameters/IdPath" - name: recordId in: path required: true schema: type: integer post: tags: [DNSZones] summary: Update DNS record operationId: updateDnsRecord requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/DnsRecord" responses: "204": description: Updated delete: tags: [DNSZones] summary: Delete DNS record operationId: deleteDnsRecord responses: "204": description: Deleted /dnszone/{id}/enableDNSSEC: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [DNSZones] summary: Enable DNSSEC operationId: enableDnssec responses: "204": description: Enabled /dnszone/{id}/disableDNSSEC: parameters: - $ref: "#/components/parameters/IdPath" post: tags: [DNSZones] summary: Disable DNSSEC operationId: disableDnssec responses: "204": description: Disabled /videolibrary: get: tags: [Stream] summary: List video libraries operationId: listVideoLibraries responses: "200": description: Libraries content: application/json: schema: type: array items: $ref: "#/components/schemas/VideoLibrary" post: tags: [Stream] summary: Add video library operationId: addVideoLibrary requestBody: required: true content: application/json: schema: type: object required: [Name] properties: Name: type: string ReplicationRegions: type: array items: type: string responses: "201": description: Library content: application/json: schema: $ref: "#/components/schemas/VideoLibrary" /videolibrary/{id}: parameters: - $ref: "#/components/parameters/IdPath" get: tags: [Stream] summary: Get video library operationId: getVideoLibrary responses: "200": description: Library content: application/json: schema: $ref: "#/components/schemas/VideoLibrary" post: tags: [Stream] summary: Update video library operationId: updateVideoLibrary requestBody: required: true content: application/json: schema: type: object additionalProperties: true responses: "204": description: Updated delete: tags: [Stream] summary: Delete video library operationId: deleteVideoLibrary responses: "204": description: Deleted /statistics: get: tags: [Statistics] summary: Get account statistics operationId: getStatistics parameters: - name: dateFrom in: query schema: type: string format: date-time - name: dateTo in: query schema: type: string format: date-time - name: pullZone in: query schema: type: integer - name: serverZoneId in: query schema: type: integer - name: loadErrors in: query schema: type: boolean - name: hourly in: query schema: type: boolean responses: "200": description: Statistics content: application/json: schema: $ref: "#/components/schemas/Statistics" /statistics/optimizer: get: tags: [Statistics] summary: Get optimizer statistics operationId: getOptimizerStatistics responses: "200": description: Statistics content: application/json: schema: type: object /statistics/safehop: get: tags: [Statistics] summary: Get SafeHop statistics operationId: getSafehopStatistics responses: "200": description: Statistics content: application/json: schema: type: object /billing: get: tags: [Billing] summary: Get billing details operationId: getBilling responses: "200": description: Billing details content: application/json: schema: type: object /billing/summary: get: tags: [Billing] summary: Get billing summary operationId: getBillingSummary responses: "200": description: Billing summary content: application/json: schema: type: object /billing/paymentRequests: get: tags: [Billing] summary: Get pending payment requests operationId: getPaymentRequests responses: "200": description: Pending payment requests content: application/json: schema: type: array items: type: object /purge: post: tags: [Purge] summary: Purge URL from CDN operationId: purgeUrl parameters: - name: url in: query required: true schema: type: string - name: async in: query schema: type: boolean responses: "204": description: Purged /apikey: get: tags: [APIKeys] summary: List API keys operationId: listApiKeys responses: "200": description: Keys content: application/json: schema: type: array items: type: object properties: Id: type: integer Key: type: string Roles: type: array items: type: string /countries: get: tags: [Countries] summary: Get country list operationId: getCountries responses: "200": description: Countries content: application/json: schema: type: array items: type: object properties: Name: type: string IsoCode: type: string IsEU: type: boolean TaxRate: type: number TaxPrefix: type: string FlagUrl: type: string PopList: type: array items: type: string /region: get: tags: [Regions] summary: List regions operationId: listRegions responses: "200": description: Regions content: application/json: schema: type: array items: type: object properties: Id: type: integer Name: type: string PricePerGigabyte: type: number RegionCode: type: string ContinentCode: type: string CountryCode: type: string Latitude: type: number Longitude: type: number components: securitySchemes: accessKeyAuth: type: apiKey in: header name: AccessKey description: API key issued from the Bunny.net dashboard. parameters: IdPath: name: id in: path required: true schema: type: integer schemas: PullZoneList: type: object properties: Items: type: array items: $ref: "#/components/schemas/PullZone" CurrentPage: type: integer TotalItems: type: integer HasMoreItems: type: boolean PullZone: type: object properties: Id: type: integer Name: type: string OriginUrl: type: string Enabled: type: boolean Hostnames: type: array items: type: object properties: Id: type: integer Value: type: string ForceSSL: type: boolean IsSystemHostname: type: boolean HasCertificate: type: boolean StorageZoneId: type: integer CacheControlMaxAgeOverride: type: integer AllowedReferrers: type: array items: type: string BlockedReferrers: type: array items: type: string BlockedIps: type: array items: type: string EnableGeoZoneUS: type: boolean EnableGeoZoneEU: type: boolean EnableGeoZoneASIA: type: boolean EnableGeoZoneSA: type: boolean EnableGeoZoneAF: type: boolean ZoneSecurityEnabled: type: boolean ZoneSecurityKey: type: string Type: type: integer PullZoneCreate: type: object required: [Name, OriginUrl] properties: Name: type: string OriginUrl: type: string StorageZoneId: type: integer Type: type: integer PullZoneUpdate: type: object additionalProperties: true StorageZone: type: object properties: Id: type: integer UserId: type: string Name: type: string Password: type: string ReadOnlyPassword: type: string DateModified: type: string format: date-time Deleted: type: boolean StorageUsed: type: integer FilesStored: type: integer Region: type: string ReplicationRegions: type: array items: type: string PullZones: type: array items: $ref: "#/components/schemas/PullZone" DnsZone: type: object properties: Id: type: integer Domain: type: string Records: type: array items: $ref: "#/components/schemas/DnsRecord" DateModified: type: string format: date-time DateCreated: type: string format: date-time NameserversDetected: type: boolean CustomNameserversEnabled: type: boolean Nameserver1: type: string Nameserver2: type: string DnsRecord: type: object properties: Id: type: integer Type: type: integer description: 0=A, 1=AAAA, 2=CNAME, 3=TXT, 4=MX, 5=Redirect, 6=Flatten, 7=PullZone, 8=SRV, 9=CAA, 10=PTR, 11=Script, 12=NS Ttl: type: integer Value: type: string Name: type: string Weight: type: integer Priority: type: integer Port: type: integer Flags: type: integer Tag: type: string Accelerated: type: boolean AcceleratedPullZoneId: type: integer Disabled: type: boolean VideoLibrary: type: object properties: Id: type: integer Name: type: string VideoCount: type: integer TrafficUsage: type: integer StorageUsage: type: integer ApiKey: type: string ReadOnlyApiKey: type: string DateCreated: type: string format: date-time ReplicationRegions: type: array items: type: string EnabledResolutions: type: string ViAiPublisherId: type: string VastTagUrl: type: string WatermarkPositionLeft: type: integer WatermarkPositionTop: type: integer WatermarkWidth: type: integer WatermarkHeight: type: integer EnableMP4Fallback: type: boolean AllowedReferrers: type: array items: type: string BlockedReferrers: type: array items: type: string BlockNoneReferrer: type: boolean EnableTokenAuthentication: type: boolean EnableTokenIPVerification: type: boolean Statistics: type: object properties: TotalBandwidthUsed: type: integer TotalRequestsServed: type: integer CacheHitRate: type: number BandwidthUsedChart: type: object additionalProperties: type: number BandwidthCachedChart: type: object additionalProperties: type: number CacheHitRateChart: type: object additionalProperties: type: number RequestsServedChart: type: object additionalProperties: type: number PullRequestsPulledChart: type: object additionalProperties: type: number OriginShieldBandwidthUsedChart: type: object additionalProperties: type: number OriginShieldInternalBandwidthUsedChart: type: object additionalProperties: type: number OriginTrafficChart: type: object additionalProperties: type: number Error3xxChart: type: object additionalProperties: type: number Error4xxChart: type: object additionalProperties: type: number Error5xxChart: type: object additionalProperties: type: number UserBalanceHistoryChart: type: object additionalProperties: type: number UserStorageUsedChart: type: object additionalProperties: type: number GeoTrafficDistribution: type: object additionalProperties: type: number