Base API
Base endpoint for pull zones, video libraries, storage zones, billing, support, and more.
Everything that can be done with the control panel can also be achieved with the API.
Setup
<?php
require 'vendor/autoload.php';
use ToshY\BunnyNet\BunnyHttpClient;
use ToshY\BunnyNet\Enum\Endpoint;
$bunnyHttpClient = new BunnyHttpClient(
client: new \Symfony\Component\HttpClient\Psr18Client(),
// Provide the account API key.
apiKey: '2cebf4f8-4bff-429f-86f6-bce2c2163d7e89fb0a86-a1b2-463c-a142-11eba8811989',
baseUrl: Endpoint::BASE
);
Usage
Abuse Case
List Abuse Cases
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\AbuseCase\ListAbuseCases(
query: [
'page' => 1,
'perPage' => 1000,
],
)
)
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get DMCA Case
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\AbuseCase\GetDmcaCase(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get Abuse Case
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\AbuseCase\GetAbuseCase(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Resolve DMCA Case
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\AbuseCase\ResolveDmcaCase(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Resolve Abuse Case
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\AbuseCase\ResolveAbuseCase(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Check Abuse Case
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\AbuseCase\CheckAbuseCase(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Auth
Auth JWT 2FA
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Auth\AuthJwt2fa(
body: [
'Code' => 'abc',
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Refresh JWT
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Auth\RefreshJwt()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Countries
List Countries
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Countries\ListCountries()
);
API Keys
List API Keys
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\ApiKeys\ListApiKeys(
query: [
'page' => 1,
'perPage' => 1000,
],
)
);
Billing
Get Billing Details
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\GetBillingDetails()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Configure Auto Recharge
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\ConfigureAutoRecharge(
body: [
'AutoRechargeEnabled' => true,
'PaymentMethodToken' => 1000,
'PaymentAmount' => 10,
'RechargeTreshold' => 2,
],
)
);
Note
- The key
RechargeTreshold
(misspelled) has a value range of 2-2000. - The key
PaymentAmount
has a value range of 10-2000.
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Create Payment Checkout
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\CreatePaymentCheckout(
body: [
'RechargeAmount' => 10,
'PaymentAmount' => 10,
'PaymentRequestId' => 123456,
'Nonce' => 'ab',
],
)
);
Note
- The key
PaymentAmount
has a value range of 10-2000.
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Prepare Payment Authorization
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\PreparePaymentAuthorization()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get Affiliate Details
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\GetAffiliateDetails()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Claim Affiliate Credits
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\ClaimAffiliateCredits()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get The Coinify Bitcoin exchange rate
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\GetCoinifyBitcoinExchangeRate()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Create Coinify payment
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\CreateCoinifyPayment(
query: [
'amount' => 123,
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get Billing Summary
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\GetBillingSummary()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get Billing Summary PDF
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\GetBillingSummaryPDF(
billingRecordId: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Apply Promo Code
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Billing\ApplyPromoCode(
query: [
'CouponCode' => 'YOUFOUNDME',
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Support
List Tickets
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Support\ListTickets(
query: [
'page' => 1,
'perPage' => 1000,
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get Ticket Details
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Support\GetTicketDetails(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Close Ticket
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Support\CloseTicket(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Reply Ticket
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Support\ReplyTicket(
id: 1,
body: [
'Message' => 'Hope you are having a nice day!\n\nThe weather is nice outside.',
'Attachments' => [
[
'Body' => 'aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==',
'FileName' => 'details.txt',
'ContentType' => 'text/plain',
],
],
],
)
);
Note
- The key
Body
requires its contents to be base64 encoded.
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Create Ticket
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Support\CreateTicket(
id: 1,
body: [
'Subject' => 'Good day!',
'LinkedPullZone' => 1,
'LinkedVideoLibrary' => 3,
'LinkedDnsZone' => 4,
'Message' => 'Hope you are having a nice day!\n\nThe weather is nice outside.',
'LinkedStorageZone' => 2,
'Attachments' => [
[
'Body' => 'aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==',
'FileName' => 'details.txt',
'ContentType' => 'text/plain',
],
],
],
)
);
Note
- The keys
LinkedPullZone
andLinkedStorageZone
are not required unlike stated in the API specifications. - The key
Body
requires its contents to be base64 encoded.
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
DRM Certificate
List DRM Certificates
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DrmCertificate\ListDrmCertificates(
query: [
'page' => 1,
'perPage' => 1000,
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Integrations
Get GitHub Integration
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Integration\GetGitHubIntegration()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Info
This endpoint returns the following response:
{
"Accounts": [
{
"Id": 1,
"Name": "MyConnectedGitHubUsername"
}
]
}
The id
can be used as IntegrationId
for the Add Edge Script endpoint.
Region
List Regions
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Region\ListRegions()
);
Stream Video Library
List Video Libraries
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\ListVideoLibraries(
query: [
'page' => 0,
'perPage' => 1000,
'search' => 'bunny',
],
)
);
Note
- The key
search
is currently not functional.
Add Video Library
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\AddVideoLibrary(
body: [
'Name' => 'New Video Library',
'ReplicationRegions' => [
'UK',
'SE',
'NY',
'LA',
'SG',
'SYD',
'BR',
'JH',
],
],
)
);
Note
- The key
ReplicationRegions
has the following possible values:UK
= London (United Kingdom)SE
= Norway (Stockholm)NY
= New York (United States East)LA
= Los Angeles (United States West)SG
= Singapore (Singapore)SYD
= Sydney (Oceania)BR
= Sao Paulo (Brazil)JH
= Johannesburg (Africa)
Get Video Library
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\GetVideoLibrary(
id: 1,
),
);
Update Video Library
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\UpdateVideoLibrary(
id: 1,
body: [
'Name' => 'New Video Library V2',
'CustomHTML' => '<style>.plyr--full-ui input[type=range]{color: purple}</style>',
'PlayerKeyColor' => '6a329f',
'EnableTokenAuthentication' => true,
'EnableTokenIPVerification' => false,
'ResetToken' => false,
'WatermarkPositionLeft' => 0,
'WatermarkPositionTop' => 0,
'WatermarkWidth' => 0,
'WatermarkHeight' => 0,
'EnabledResolutions' => '720p,1080p,1440p,2160p',
'ViAiPublisherId' => '',
'VastTagUrl' => '',
'WebhookUrl' => 'https://example.com/video-status',
'CaptionsFontSize' => 20,
'CaptionsFontColor' => 'white',
'CaptionsBackground' => 'black',
'UILanguage' => 'GR',
'AllowEarlyPlay' => true,
'PlayerTokenAuthenticationEnabled' => true,
'BlockNoneReferrer' => true,
'EnableMP4Fallback' => true,
'KeepOriginalFiles' => true,
'AllowDirectPlay' => true,
'EnableDRM' => false,
'Controls' => 'play,progress,current-time,mute,volume,pip,fullscreen',
'Bitrate240p' => 600,
'Bitrate360p' => 800,
'Bitrate480p' => 1400,
'Bitrate720p' => 2800,
'Bitrate1080p' => 5000,
'Bitrate1440p' => 8000,
'Bitrate2160p' => 25000,
'ShowHeatmap' => false,
'EnableContentTagging' => true,
'FontFamily' => 'Arial',
'EnableTranscribing' => false,
'EnableTranscribingTitleGeneration' => false,
'EnableTranscribingDescriptionGeneration' => false,
'TranscribingCaptionLanguages' => [],
'AppleFairPlayDrm' => [
'Enabled' => false,
],
'GoogleWidevineDrm' => [
'Enabled' => false,
'SdOnlyForL3' => false,
'MinClientSecurityLevel' => 'None',
],
'EnableCaptionsInPlaylist' => true,
'RememberPlayerPosition' => true,
'EnableMultiAudioTrackSupport' => true,
'UseSeparateAudioStream' => true,
'JitEncodingEnabled' => true,
'EncodingTier' => 'Free',
'OutputCodecs' => 'x264,vp9,hevc,av1',
'PlayerVersion' => 1,
'RemoveMetadataFromFallbackVideos' => false,
'DrmVersion' => 'Basic',
'PlaybackSpeeds' => '0.25,0.5,0.75,1.0,1.25,1.5,1.75,2.0,2.5,3,3.5,4',
],
)
);
Note
- The key
EnabledResolutions
has the following possible values (comma separated):240p
360p
480p
720p
1080p
1440p
2160p
- The key
Controls
has the following possible values (comma separated):play-large
play
progress
current-time
mute
volume
captions
settings
pip
airplay
fullscreen
- The key
MinClientSecurityLevel
has the following possible values:None
L1
L2
L3
- The key
DrmVersion
has the following possible values:Basic
Enterprise
BasicV2
- To get a full list of possible value options for key
TranscribingCaptionLanguages
, see the Get Languages endpoint. - The key
EncodingTier
has the following possible values:0
=Free
1
=Premium
- The API accepts both the integer as well as enum value for the
EncodingTier
.
Delete Video Library
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\DeleteVideoLibrary(
id: 1,
)
);
Get Video Library Transcribing Statistics
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\GetTranscribingStatistics(
id: 1,
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
],
)
);
Get Video Library DRM Statistics
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\GetDrmStatistics(
id: 1,
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
],
)
);
Get Languages
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\GetLanguages()
);
Reset Password
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\ResetPassword(
query: [
'id' => 1,
],
)
);
Reset Password (by path parameter)
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\ResetPasswordByPathParameter(
id: 1,
)
);
Add Watermark
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\AddWatermark(
id: 1,
)
);
Delete Watermark
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\DeleteWatermark(
id: 1,
)
);
Add Allowed Referer
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\AddAllowedReferer(
id: 1,
body: [
'Hostname' => '*.example.com,*.example.org',
],
)
);
Note
- The key
Hostname
allows multiple values through comma separated values.
Remove Allowed Referer
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\RemoveAllowedReferer(
id: 1,
body: [
'Hostname' => '*.example.com',
],
)
);
Note
- The key
Hostname
does not allow multiple values.
Add Blocked Referer
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\AddBlockedReferer(
id: 1,
body: [
'Hostname' => 'evil.org',
],
)
);
Note
- The key
Hostname
does not allow multiple values.
Remove Blocked Referer
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StreamVideoLibrary\RemoveBlockedReferer(
id: 1,
body: [
'Hostname' => 'evil.org',
],
)
);
Note
- The key
Hostname
does not allow multiple values.
DNS Zone
List DNS Zones
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\ListDnsZones(
query: [
'page' => 1,
'perPage' => 1000,
'search' => 'bunny.net',
],
)
);
Note
- The key
search
can be used to filter onId
orDomain
. A search value with anId
value will perform an exact match, whereas a search value with aDomain
will perform a wildcard search:bunny
,nny
and.net
will all match the DNS zone forbunny.net
.
Add DNS Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\AddDnsZone(
body: [
'Domain' => 'example.com',
],
)
);
Get DNS Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\GetDnsZone(
id: 1,
)
);
Update DNS Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\UpdateDnsZone(
id: 1,
body: [
'CustomNameserversEnabled' => true,
'Nameserver1' => 'abbby.ns.cloudflare.com',
'Nameserver2' => 'jonah.ns.cloudflare.com',
'SoaEmail' => 'admin@example.com',
'LoggingEnabled' => true,
'LogAnonymizationType' => 'OneDigit',
'CertificateKeyType' => 'Ecdsa',
'LoggingIPAnonymizationEnabled' => true,
],
)
);
Note
- The key
LogAnonymizationType
has the following possible values:0
=OneDigit
1
=Drop
- The key
CertificateKeyType
has the following possible values:0
=Ecdsa
1
=Rsa
- In order to disable
LoggingIPAnonymizationEnabled
you first need to agree to the DPA agreement (GDPR). - The API accepts both the integer as well as enum value for the
LogAnonymizationType
andCertificateKeyType
.
Delete DNS Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\DeleteDnsZone(
id: 1,
)
);
Enable DNSSEC on DNS Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\EnableDnssecOnDnsZone(
id: 1,
)
);
Disable DNSSEC on DNS Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\DisableDnssecOnDnsZone(
id: 1,
)
);
Export DNS Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\ExportDnsRecords(
id: 1,
)
);
Get DNS Query Statistics
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\GetDnsZoneQueryStatistics(
id: 1,
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
],
)
);
Check DNS Zone Availability
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\CheckDnsZoneAvailability(
body: [
'Name' => 'example.com',
],
)
);
Add DNS Record
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\AddDnsRecord(
zoneId: 1,
body: [
'Type' => 'TXT',
'Ttl' => 15,
'Value' => 'My TXT Value',
'Name' => '',
'Weight' => 0,
'Priority' => 0,
'Flags' => 0,
'Tag' => '',
'Port' => 0,
'PullZoneId' => 0,
'ScriptId' => 0,
'Accelerated' => false,
'MonitorType' => 'None',
'GeolocationLatitude' => 0,
'GeolocationLongitude' => 0,
'LatencyZone' => null,
'SmartRoutingType' => 'None',
'Disabled' => false,
'EnviromentalVariables' => [
[
'Name' => 'Hello',
'Value' => 'World',
],
],
'Comment' => '',
],
)
);
Note
- The key
EnviromentalVariables
is misspelled in the API specifications. - The key
Type
has the following possible values:0
=A
1
=AAAA
2
=CNAME
3
=TXT
4
=MX
5
=RDR
(Redirect)6
=Flatten
7
=PZ
(Pull Zone)8
=SRV
9
=CAA
10
=PTR
11
=SCR
(Script)12
=NS
- The key
ScriptId
is not returned in the response. - The key
MonitorType
has the following possible values:0
=None
1
=Ping
2
=HTTP
3
=Monitor
- The key
SmartRoutingType
has the following possible values:0
=None
1
=Latency
2
=Geolocation
- The API accepts both the integer as well as enum value for the
Type
,MonitorType
andSmartRoutingType
.
Update DNS Record
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\UpdateDnsRecord(
zoneId: 1,
id: 2,
body: [
'Type' => 'TXT',
'Ttl' => 15,
'Value' => 'My TXT Value',
'Name' => '',
'Weight' => 0,
'Priority' => 0,
'Flags' => 0,
'Tag' => '',
'Port' => 0,
'PullZoneId' => 0,
'ScriptId' => 0,
'Accelerated' => false,
'MonitorType' => 'None',
'GeolocationLatitude' => 0,
'GeolocationLongitude' => 0,
'LatencyZone' => null,
'SmartRoutingType' => 'None',
'Disabled' => false,
'EnviromentalVariables' => [
[
'Name' => 'Hello',
'Value' => 'World',
],
],
'Comment' => '',
'Id' => 1,
],
)
);
Note
- The key
EnviromentalVariables
is misspelled in the API specifications. - The key
Type
has the following possible values: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
- The key
ScriptId
is not returned in the response. - The key
MonitorType
has the following possible values:0
=None
1
=Ping
2
=HTTP
3
=Monitor
- The key
SmartRoutingType
has the following possible values:0
=None
1
=Latency
2
=Geolocation
- The API accepts both the integer as well as enum value for the
Type
,MonitorType
andSmartRoutingType
.
Delete DNS Record
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\DeleteDnsRecord(
zoneId: 1,
id: 2,
)
);
Recheck DNS Configuration
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\RecheckDnsConfiguration(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Dismiss DNS Configuration Notice
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\DismissDnsConfigurationNotice(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Import DNS Records
/*
* File contents read into string from the local filesystem.
*/
$content = file_get_contents('./example.com.2023-08-20.bind');
/*
* File contents handle from a `$filesystem` (Flysystem FtpAdapter).
*/
$content = $filesystem->readStream('./example.com.2023-08-20.bind');
// Import DNS records.
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\DnsZone\ImportDnsRecords(
zoneId: 1,
body: $content,
)
);
Pull Zone
List Pull Zones
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\ListPullZones(
query: [
'page' => 0,
'perPage' => 1000,
'search' => 'bunny',
'includeCertificate' => false,
],
)
);
Note
- The key
search
is currently not functional.
Add Pull Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\AddPullZone(
body: [
'OriginUrl' => 'https://my-bucket-2.service.com',
'AllowedReferrers' => [],
'BlockedReferrers' => [],
'BlockNoneReferrer' => false,
'BlockedIps' => [],
'EnableGeoZoneUS' => true,
'EnableGeoZoneEU' => true,
'EnableGeoZoneASIA' => true,
'EnableGeoZoneSA' => true,
'EnableGeoZoneAF' => true,
'BlockRootPathAccess' => false,
'BlockPostRequests' => false,
'EnableQueryStringOrdering' => true,
'EnableWebpVary' => false,
'EnableAvifVary' => false,
'EnableMobileVary' => false,
'EnableCountryCodeVary' => false,
'EnableCountryStateCodeVary' => false,
'EnableHostnameVary' => false,
'EnableCacheSlice' => false,
'ZoneSecurityEnabled' => false,
'ZoneSecurityIncludeHashRemoteIP' => false,
'IgnoreQueryStrings' => true,
'MonthlyBandwidthLimit' => 0,
'AccessControlOriginHeaderExtensions' => [],
'EnableAccessControlOriginHeader' => true,
'DisableCookies' => true,
'BudgetRedirectedCountries' => [],
'BlockedCountries' => [],
'CacheControlMaxAgeOverride' => -1,
'CacheControlPublicMaxAgeOverride' => -1,
'CacheControlBrowserMaxAgeOverride' => 157784760,
'AddHostHeader' => false,
'AddCanonicalHeader' => false,
'EnableLogging' => true,
'LoggingIPAnonymizationEnabled' => true,
'PermaCacheStorageZoneId' => 0,
'PermaCacheType' => 'Automatic',
'AWSSigningEnabled' => false,
'AWSSigningKey' => null,
'AWSSigningRegionName' => null,
'AWSSigningSecret' => null,
'EnableOriginShield' => false,
'OriginShieldZoneCode' => 'FR',
'EnableTLS1' => true,
'EnableTLS1_1' => true,
'CacheErrorResponses' => false,
'VerifyOriginSSL' => false,
'LogForwardingEnabled' => false,
'LogForwardingHostname' => null,
'LogForwardingPort' => 0,
'LogForwardingToken' => null,
'LogForwardingProtocol' => 'UDP',
'LoggingSaveToStorage' => false,
'LoggingStorageZoneId' => 0,
'FollowRedirects' => false,
'ConnectionLimitPerIPCount' => 0,
'RequestLimit' => 0,
'LimitRateAfter' => 0,
'LimitRatePerSecond' => 0,
'BurstSize' => 0,
'ErrorPageEnableCustomCode' => false,
'ErrorPageCustomCode' => null,
'ErrorPageEnableStatuspageWidget' => false,
'ErrorPageStatuspageCode' => null,
'ErrorPageWhitelabel' => false,
'OptimizerEnabled' => false,
'OptimizerTunnelEnabled' => false,
'OptimizerDesktopMaxWidth' => 1600,
'OptimizerMobileMaxWidth' => 800,
'OptimizerImageQuality' => 85,
'OptimizerMobileImageQuality' => 70,
'OptimizerEnableWebP' => true,
'OptimizerPrerenderHtml' => false,
'OptimizerEnableManipulationEngine' => true,
'OptimizerMinifyCSS' => true,
'OptimizerMinifyJavaScript' => true,
'OptimizerWatermarkEnabled' => true,
'OptimizerWatermarkUrl' => '',
'OptimizerWatermarkPosition' => 0,
'OptimizerWatermarkOffset' => 3,
'OptimizerWatermarkMinImageSize' => 300,
'OptimizerAutomaticOptimizationEnabled' => true,
'OptimizerClasses' => [],
'OptimizerForceClasses' => false,
'OptimizerStaticHtmlWordPressPath' => '',
'OptimizerStaticHtmlWordPressBypassCookie' => '',
'OptimizerEnableUpscaling' => false,
'Type' => 0,
'OriginRetries' => 0,
'OriginConnectTimeout' => 10,
'OriginResponseTimeout' => 60,
'UseStaleWhileUpdating' => false,
'UseStaleWhileOffline' => false,
'OriginRetry5XXResponses' => false,
'OriginRetryConnectionTimeout' => true,
'OriginRetryResponseTimeout' => true,
'OriginRetryDelay' => 0,
'DnsOriginPort' => 0,
'DnsOriginScheme' => '',
'QueryStringVaryParameters' => [],
'OriginShieldEnableConcurrencyLimit' => false,
'OriginShieldMaxConcurrentRequests' => 5000,
'EnableCookieVary' => false,
'CookieVaryParameters' => [],
'EnableSafeHop' => false,
'OriginShieldQueueMaxWaitTime' => 30,
'OriginShieldMaxQueuedRequests' => 5000,
'UseBackgroundUpdate' => false,
'EnableAutoSSL' => false,
'LogAnonymizationType' => 'OneDigit',
'StorageZoneId' => 0,
'EdgeScriptId' => 0,
'MiddlewareScriptId' => 0,
'EdgeScriptExecutionPhase' => 'Cache',
'OriginType' => 'OriginUrl',
'MagicContainersAppId' => '',
'MagicContainersEndpointId' => '',
'LogFormat' => 'Plain',
'LogForwardingFormat' => 'Plain',
'ShieldDDosProtectionType' => 'DetectOnly',
'ShieldDDosProtectionEnabled' => false,
'OriginHostHeader' => '',
'EnableSmartCache' => false,
'EnableRequestCoalescing' => false,
'RequestCoalescingTimeout' => 30,
'DisableLetsEncrypt' => false,
'EnableBunnyImageAi' => false,
'BunnyAiImageBlueprints' => [],
'PreloadingScreenEnabled' => false,
'PreloadingScreenCode' => '',
'PreloadingScreenLogoUrl' => null,
'PreloadingScreenShowOnFirstVisit' => true,
'PreloadingScreenTheme' => 'Dark',
'PreloadingScreenCodeEnabled' => false,
'PreloadingScreenDelay' => 700,
'RoutingFilters' => [],
'StickySessionType' => 'Off',
'StickySessionCookieName' => '',
'StickySessionClientHeaders' => '',
'EnableWebSockets' => false,
'MaxWebSocketConnections' => 0,
'Name' => 'New Pull Zone',
],
)
);
Note
- The key
Type
has the following possible values:0
= Premium1
= Volume
- The key
OriginType
has the following possible values:0
=OriginUrl
1
=DnsAccelerate
2
=StorageZone
3
=LoadBalancer
4
=EdgeScript
5
=MagicContainers
6
=PushZone
- The key
LogFormat
has the following possible values:0
=Plain
1
=JSON
- The key
LogForwardingFormat
has the following possible values:0
=Plain
1
=JSON
- The key
LogAnonymizationType
has the following possible values:0
=OneDigit
1
=Drop
- The key
LogForwardingProtocol
has the following possible values:0
=UDP
1
=TCP
2
=TCPEncrypted
3
=DataDog
- The key
ShieldDDosProtectionType
has the following possible values:0
=DetectOnly
1
=ActiveStandard
2
=ActiveAggresive
- The key
OptimizerWatermarkPosition
has the following possible values:0
=BottomLeft
1
=BottomRight
2
=TopLeft
4
=Center
5
=CenterStretch
- The key
PreloadingScreenTheme
has the following possible values:0
=Light
1
=Dark
- The key
StickySessionType
has the following possible values:0
=Off
1
=On
- The keys
CacheControlBrowserMaxAgeOverride
andCacheControlBrowserMaxAgeOverride
accept any values in seconds. The Bunny dashboard will show the valueMatch Server Cache Expiration
but the value updated through the API will be honored. - The key
OriginShieldZoneCode
accepts the 2-digit codeFR
(France, Paris) orIL
(Illinois, Chicago). - The API accepts both the integer as well as enum value for the
Type
,OriginType
,LogFormat
,LogForwardingFormat
,LogAnonymizationType
,LogForwardingProtocol
,ShieldDDosProtectionType
,PreloadingScreenTheme
andStickySessionType
.
Get Pull Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\GetPullZone(
id: 1,
query: [
'includeCertificate' => false,
],
)
);
Update Pull Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\UpdatePullZone(
id: 1,
body: [
'OriginUrl' => 'https://my-bucket-2.service.com',
'AllowedReferrers' => [],
'BlockedReferrers' => [],
'BlockNoneReferrer' => false,
'BlockedIps' => [],
'EnableGeoZoneUS' => true,
'EnableGeoZoneEU' => true,
'EnableGeoZoneASIA' => true,
'EnableGeoZoneSA' => true,
'EnableGeoZoneAF' => true,
'BlockRootPathAccess' => false,
'BlockPostRequests' => false,
'EnableQueryStringOrdering' => true,
'EnableWebpVary' => false,
'EnableAvifVary' => false,
'EnableMobileVary' => false,
'EnableCountryCodeVary' => false,
'EnableCountryStateCodeVary' => false,
'EnableHostnameVary' => false,
'EnableCacheSlice' => false,
'ZoneSecurityEnabled' => false,
'ZoneSecurityIncludeHashRemoteIP' => false,
'IgnoreQueryStrings' => true,
'MonthlyBandwidthLimit' => 0,
'AccessControlOriginHeaderExtensions' => [],
'EnableAccessControlOriginHeader' => true,
'DisableCookies' => true,
'BudgetRedirectedCountries' => [],
'BlockedCountries' => [],
'CacheControlMaxAgeOverride' => -1,
'CacheControlPublicMaxAgeOverride' => -1,
'CacheControlBrowserMaxAgeOverride' => 157784760,
'AddHostHeader' => false,
'AddCanonicalHeader' => false,
'EnableLogging' => true,
'LoggingIPAnonymizationEnabled' => true,
'PermaCacheStorageZoneId' => 0,
'PermaCacheType' => 'Automatic',
'AWSSigningEnabled' => false,
'AWSSigningKey' => null,
'AWSSigningRegionName' => null,
'AWSSigningSecret' => null,
'EnableOriginShield' => false,
'OriginShieldZoneCode' => 'FR',
'EnableTLS1' => true,
'EnableTLS1_1' => true,
'CacheErrorResponses' => false,
'VerifyOriginSSL' => false,
'LogForwardingEnabled' => false,
'LogForwardingHostname' => null,
'LogForwardingPort' => 0,
'LogForwardingToken' => null,
'LogForwardingProtocol' => 'UDP',
'LoggingSaveToStorage' => false,
'LoggingStorageZoneId' => 0,
'FollowRedirects' => false,
'ConnectionLimitPerIPCount' => 0,
'RequestLimit' => 0,
'LimitRateAfter' => 0,
'LimitRatePerSecond' => 0,
'BurstSize' => 0,
'ErrorPageEnableCustomCode' => false,
'ErrorPageCustomCode' => null,
'ErrorPageEnableStatuspageWidget' => false,
'ErrorPageStatuspageCode' => null,
'ErrorPageWhitelabel' => false,
'OptimizerEnabled' => false,
'OptimizerTunnelEnabled' => false,
'OptimizerDesktopMaxWidth' => 1600,
'OptimizerMobileMaxWidth' => 800,
'OptimizerImageQuality' => 85,
'OptimizerMobileImageQuality' => 70,
'OptimizerEnableWebP' => true,
'OptimizerPrerenderHtml' => false,
'OptimizerEnableManipulationEngine' => true,
'OptimizerMinifyCSS' => true,
'OptimizerMinifyJavaScript' => true,
'OptimizerWatermarkEnabled' => true,
'OptimizerWatermarkUrl' => '',
'OptimizerWatermarkPosition' => 0,
'OptimizerWatermarkOffset' => 3,
'OptimizerWatermarkMinImageSize' => 300,
'OptimizerAutomaticOptimizationEnabled' => true,
'OptimizerClasses' => [],
'OptimizerForceClasses' => false,
'OptimizerStaticHtmlWordPressPath' => '',
'OptimizerStaticHtmlWordPressBypassCookie' => '',
'Type' => 0,
'OriginRetries' => 0,
'OriginConnectTimeout' => 10,
'OriginResponseTimeout' => 60,
'UseStaleWhileUpdating' => false,
'UseStaleWhileOffline' => false,
'OriginRetry5XXResponses' => false,
'OriginRetryConnectionTimeout' => true,
'OriginRetryResponseTimeout' => true,
'OriginRetryDelay' => 0,
'DnsOriginPort' => 0,
'DnsOriginScheme' => '',
'QueryStringVaryParameters' => [],
'OriginShieldEnableConcurrencyLimit' => false,
'OriginShieldMaxConcurrentRequests' => 5000,
'EnableCookieVary' => false,
'CookieVaryParameters' => [],
'EnableSafeHop' => false,
'OriginShieldQueueMaxWaitTime' => 30,
'OriginShieldMaxQueuedRequests' => 5000,
'UseBackgroundUpdate' => false,
'EnableAutoSSL' => false,
'LogAnonymizationType' => 'OneDigit',
'StorageZoneId' => 0,
'EdgeScriptId' => 0,
'MiddlewareScriptId' => 0,
'EdgeScriptExecutionPhase' => 'Cache',
'OriginType' => 'OriginUrl',
'MagicContainersAppId' => '',
'MagicContainersEndpointId' => '',
'LogFormat' => 'Plain',
'LogForwardingFormat' => 'Plain',
'ShieldDDosProtectionType' => 'DetectOnly',
'ShieldDDosProtectionEnabled' => false,
'OriginHostHeader' => '',
'EnableSmartCache' => false,
'EnableRequestCoalescing' => false,
'RequestCoalescingTimeout' => 30,
'DisableLetsEncrypt' => false,
'EnableBunnyImageAi' => false,
'BunnyAiImageBlueprints' => [],
'PreloadingScreenEnabled' => false,
'PreloadingScreenCode' => '',
'PreloadingScreenLogoUrl' => null,
'PreloadingScreenShowOnFirstVisit' => true,
'PreloadingScreenTheme' => 'Dark',
'PreloadingScreenCodeEnabled' => false,
'PreloadingScreenDelay' => 700,
'RoutingFilters' => [],
'StickySessionType' => 'Off',
'StickySessionCookieName' => '',
'StickySessionClientHeaders' => '',
'OptimizerEnableUpscaling' => false,
'EnableWebSockets' => false,
'MaxWebSocketConnections' => 0,
],
)
);
Note
- The key
Type
has the following possible values:0
= Premium1
= Volume
- The key
OriginType
has the following possible values:0
=OriginUrl
1
=DnsAccelerate
2
=StorageZone
3
=LoadBalancer
4
=EdgeScript
5
=MagicContainers
6
=PushZone
- The key
LogFormat
has the following possible values:0
=Plain
1
=JSON
- The key
LogForwardingFormat
has the following possible values:0
=Plain
1
=JSON
- The key
LogAnonymizationType
has the following possible values:0
=OneDigit
1
=Drop
- The key
LogForwardingProtocol
has the following possible values:0
=UDP
1
=TCP
2
=TCPEncrypted
3
=DataDog
- The key
ShieldDDosProtectionType
has the following possible values:0
=DetectOnly
1
=ActiveStandard
2
=ActiveAggresive
- The key
OptimizerWatermarkPosition
has the following possible values:0
(BottomLeft)1
(BottomRight)2
(TopLeft)4
(Center)5
(CenterStretch)
- The key
PreloadingScreenTheme
has the following possible values:0
=Light
1
=Dark
- The key
StickySessionType
has the following possible values:0
=Off
1
=On
- The key
PreloadingScreenShowOnFirstVisit
is required when using preloading screen features. - The keys
CacheControlBrowserMaxAgeOverride
andCacheControlBrowserMaxAgeOverride
accept any values in seconds. The Bunny dashboard will show the valueMatch Server Cache Expiration
but the value updated through the API will be honored. - The key
OriginShieldZoneCode
accepts the 2-digit codeFR
(France, Paris) orIL
(Illinois, Chicago). - The keys
OptimizerClasses
andBunnyAiImageBlueprints
accept arrays of objects withName
andProperties
fields. - The API accepts both the integer as well as enum value for the
Type
,OriginType
,LogFormat
,LogForwardingFormat
,LogAnonymizationType
,LogForwardingProtocol
,ShieldDDosProtectionType
,PreloadingScreenTheme
andStickySessionType
.
Delete Pull Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\DeletePullZone(
id: 1,
)
);
Add/Update Edge Rule
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\AddOrUpdateEdgeRule(
pullZoneId: 1,
body: [
'Guid' => 'c71d9594-3bc6-4639-9896-ba3e96217587', // required for update, not add
'ActionType' => 'BlockRequest',
'ActionParameter1' => '',
'ActionParameter2' => '',
'ActionParameter3' => '',
'Triggers' => [
[
'Type' => 'URL',
'PatternMatches' => [
'https://example.b-cdn.net/images/*',
'https://example.b-cdn.net/videos/*',
]
'PatternMatchingType' => 'MatchAny',
'Parameter1' => '',
],
],
'ExtraActions' => [
[
'ActionType' => 'SetStatusCode',
'ActionParameter1' => '',
'ActionParameter2' => '',
'ActionParameter3' => '',
],
],
'TriggerMatchingType' => 'MatchAny',
'Description' => '',
'Enabled' => true,
'OrderIndex' => 1,
],
)
);
Note
- The key
ActionType
has the following possible values: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
- The key
Type
in aTrigger
object has the following possible values: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
- The key
TriggerMatchingType
has the following possible values:0
=MatchAny
1
=MatchAll
2
=MatchNone
- The API accepts both the integer as well as enum value for the
ActionType
,Type
andTriggerMatchingType
. - The keys
Guid
,Type
andPatternMatchingType
in the body are required parameters when updating an edge rule.
Set Edge Rule Enabled
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\SetEdgeRuleEnabled(
pullZoneId: 1,
edgeRuleId: 'c71d9594-3bc6-4639-9896-ba3e96217587',
body: [
'Id' => 1,
'Value' => true,
],
)
);
Note
- The key
Id
in the body denotes the pull zone ID (the same as the first argument) and is (for some reason) a required parameter.
Delete Edge Rule
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\DeleteEdgeRule(
pullZoneId: 1,
edgeRuleId: 'c71d9594-3bc6-4639-9896-ba3e96217587',
)
);
Set Zone Security Enabled
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\SetZoneSecurityEnabled(
Id: 1,
Value: true,
)
);
Note
- This endpoint corresponds to toggling the Enable Token Authentication switch in the Token Authentication > Security section of your pull zone.
Undocumented endpoint
This endpoint is not documented in the OpenAPI specifications but can still be used indefinitely.
Set Zone Security Include Hash Remote IP Enabled
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\SetZoneSecurityIncludeHashRemoteIpEnabled(
Id: 1,
Value: true,
)
);
Note
- This endpoint corresponds to toggling the Token IP Validation switch in the Token Authentication > Security section of your pull zone.
Undocumented endpoint
This endpoint is not documented in the OpenAPI specifications but can still be used indefinitely.
Get Origin Shield Queue Statistics
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\GetOriginShieldQueueStatistics(
pullZoneId: 1,
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
'hourly' => false,
],
)
);
Get SafeHop Statistics
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\GetSafeHopStatistics(
pullZoneId: 1,
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
'hourly' => false,
],
)
);
Get Optimizer Statistics
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\GetOptimizerStatistics(
pullZoneId: 1,
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
'hourly' => false,
],
)
);
Get WAF Statistics
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\GetWafStatistics(
pullZoneId: 1,
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
'hourly' => false,
],
)
);
Undocumented endpoint
This endpoint is not documented in the OpenAPI specifications but can still be used indefinitely.
Load Free Certificate
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\LoadFreeCertificate(
query: [
'hostname' => 'cdn.example.com',
],
)
);
Purge Cache (by tag)
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\PurgeCache(
id: 1,
body: [
'CacheTag' => 'mytag-region-*',
],
)
);
Check Pull Zone Availability
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\CheckPullZoneAvailability(
body: [
'Name' => 'test',
],
)
);
Add Custom Certificate
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\AddCustomCertificate(
id: 1,
body: [
'Hostname' => 'cdn.example.com',
'Certificate' => 'LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk5ldmVyIGdvbm5hIGdpdmUgeW91IHVwLgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t',
'CertificateKey' => 'LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpOZXZlciBnb25uYSBsZXQgeW91IGRvd24uCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0t',
],
)
);
Note
- The keys
Certificate
andCertificateKey
require the file contents to be sent as base64 encoded strings.
Remove Certificate
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\RemoveCertificate(
id: 1,
body: [
'Hostname' => 'cdn.example.com',
],
)
);
Add Custom Hostname
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\AddCustomHostname(
id: 1,
body: [
'Hostname' => 'cdn.example.com',
],
)
);
Remove Custom Hostname
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\RemoveCustomHostname(
id: 1,
body: [
'Hostname' => 'cdn.example.com',
],
)
);
Set Force SSL
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\SetForceSsl(
id: 1,
body: [
'Hostname' => 'cdn.example.com',
'ForceSSL' => true,
],
)
);
Reset Token Key
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\ResetTokenKey(
id: 1,
)
);
Add Allowed Referer
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\AddAllowedReferer(
id: 1,
body: [
'Hostname' => '*.example.com,*.example.org',
],
)
);
Note
- The key
Hostname
allows multiple values through comma separated values.
Remove Allowed Referer
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\RemoveAllowedReferer(
id: 1,
body: [
'Hostname' => '*.example.com',
],
)
);
Note
- The key
Hostname
does not allow multiple values.
Add Blocked Referer
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\AddBlockedReferer(
id: 1,
body: [
'Hostname' => '*.evil.org',
],
)
);
Note
- The key
Hostname
does not allow multiple values.
Remove Blocked Referer
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\RemoveBlockedReferer(
id: 1,
body: [
'Hostname' => '*.evil.org',
],
)
);
Add Blocked IP
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\AddBlockedIp(
id: 1,
body: [
'BlockedIp' => '12.345.67.89',
],
)
);
Remove Blocked IP
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\PullZone\RemoveBlockedIp(
id: 1,
body: [
'BlockedIp' => '12.345.67.89',
],
)
);
Purge
Purge URL
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Purge\PurgeUrl(
query: [
'url' => 'https://example.b-cdn.net/images/*',
'async' => false,
],
)
);
Purge URL (by header)
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Purge\PurgeUrlByHeader(
query: [
'url' => 'https://example.b-cdn.net/images/*',
'headerName' => '',
'headerValue' => '',
'async' => false,
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Search
Global Search
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Search\GlobalSearch(
query: [
'search' => 'bunny',
'from' => 0,
'size' => 20,
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Statistics
Get Statistics (traffic, cache hit & bandwidth)
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\Statistics\GetStatistics(
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
'pullZone' => -1,
'serverZoneId' => -1,
'loadErrors' => false,
'hourly' => false,
'loadOriginResponseTimes' => false,
'loadOriginTraffic' => false,
'loadRequestsServed' => false,
'loadBandwidthUsed' => false,
'loadOriginShieldBandwidth' => false,
'loadGeographicTrafficDistribution' => false,
'loadUserBalanceHistory' => false,
],
)
);
Storage Zone
List Storage Zones
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\ListStorageZones(
query: [
'page' => 0,
'perPage' => 1000,
'search' => 'bunny',
'includeDeleted' => 1000,
],
)
);
Note
- The key
search
is currently not functional.
Add Storage Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\AddStorageZone(
body: [
'OriginUrl' => '',
'Name' => 'Test',
'Region' => 'DE',
'ReplicationRegions' => '',
'ZoneTier' => 'Standard',
'StorageZoneType' => 'Supported',
],
)
);
Note
- The key
OriginUrl
allows you to specify a backup data source, in case the file does not exist on the Storage Zone. So for example, you would request/image.png
. Assumingimage.png
doesn't exist on the storage zone, the system will try to proxy and fetch it from theOriginUrl
instead. You can omit it unless needed. - The key
ZoneTier
has the following possible values (undocumented):0
=Standard
(HDD)1
=Edge
(SSD)
- The key
Region
has the following possible values:DE
= Falkenstein / Frankfurt (Germany) | HDD + SSDUK
= London (United Kingdom) | HDDSE
= Norway (Stockholm) | HDDNY
= New York (United States) | HDDLA
= Los Angeles (United States) | HDDSG
= Singapore (Singapore) | HDDSYD
= Sydney (Oceania) | HDDBR
= Sao Paolo (Brazil) | HDDJH
= Johannesburg (Africa) | HDD
- The key
ReplicationRegions
has the following possible values:DE
= Frankfurt (Germany) | SSDUK
= London (United Kingdom) | HDD + SSDSE
= Norway (Stockholm) | HDD + SSDCZ
= Prague (Czech Republic) | SSDES
= Madrid (Spain) | SSDNY
= New York (United States East) | HDD + SSDLA
= Los Angeles (United States West) | HDD + SSDWA
= Seattle (United States West) | SSDMI
= Miami (United States East) | SSDSG
= Singapore (Singapore) | HDD + SSDHK
= Hong Kong (SAR of China) | SSDJP
= Tokyo (Japan) | SSDSYD
= Sydney (Oceania) | HDD + SSDBR
= Sao Paolo (Brazil) | HDD + SSDJH
= Johannesburg (Africa) | HDD + SSD
- The API accepts both the integer as well as enum value for the
ZoneTier
.
Warning
- The key
StorageZoneType
is related to an upcoming feature and currently does not serve any purpose.
Check Storage Zone Availability
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\CheckStorageZoneAvailability(
body: [
'Name' => 'Test',
],
)
);
Get Storage Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\GetStorageZone(
id: 1,
)
);
Update Storage Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\UpdateStorageZone(
id: 1,
body: [
'ReplicationZones' => '',
'OriginUrl' => '',
'Custom404FilePath' => 'my-custom-404.html',
'Rewrite404To200' => false,
],
)
);
Note
- The key
OriginUrl
allows you to specify a backup data source, in case the file does not exist on the Storage Zone. So for example, you would request/image.png
. Assumingimage.png
doesn't exist on the storage zone, the system will try to proxy and fetch it from theOriginUrl
instead. You can omit it unless needed. - The key
ReplicationZones
has the following possible values:DE
= Frankfurt (Germany) | SSDUK
= London (United Kingdom) | HDD + SSDSE
= Norway (Stockholm) | HDD + SSDCZ
= Prague (Czech Republic) | SSDES
= Madrid (Spain) | SSDNY
= New York (United States East) | HDD + SSDLA
= Los Angeles (United States West) | HDD + SSDWA
= Seattle (United States West) | SSDMI
= Miami (United States East) | SSDSG
= Singapore (Singapore) | HDD + SSDHK
= Hong Kong (SAR of China) | SSDJP
= Tokyo (Japan) | SSDSYD
= Sydney (Oceania) | HDD + SSDBR
= Sao Paolo (Brazil) | HDD + SSDJH
= Johannesburg (Africa) | HDD + SSD
Delete Storage Zone
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\DeleteStorageZone(
id: 1,
query: [
'deleteLinkedPullZones' => true,
],
)
);
Get Storage Zone Statistics
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\GetStorageZoneStatistics(
id: 1,
query: [
'dateFrom' => 'm-d-Y',
'dateTo' => 'm-d-Y',
],
)
);
Get Storage Zone Connections
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\GetStorageZoneConnections(
id: 1,
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Reset Password
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\ResetPassword(
id: 1,
)
);
Reset Read-Only Password
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\StorageZone\ResetReadOnlyPassword(
query: [
'id' => 1,
],
)
);
User
Get Home Feed
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\GetHomeFeed()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get User Details
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\GetUserDetails()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Update User Details
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\UpdateUserDetails(
body: [
'FirstName' => 'John',
'Email' => 'john.doe@example.com',
'BillingEmail' => 'john.doe@example.com',
'LastName' => 'Doe',
'StreetAddress' => '1985 Robinson Court',
'City' => 'Windom',
'ZipCode' => '75492',
'Country' => 'US',
'CompanyName' => '',
'VATNumber' => '',
'ReceiveNotificationEmails' => true,
'ReceivePromotionalEmails' => false,
'Password' => '1234Abcd',
'OldPassword' => 'Abcd1234',
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Resend Email Confirmation
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\ResendEmailConfirmation()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Reset API Key
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\ResetApiKey()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
List Close Account Reasons
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\ListCloseAccountReasons()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Close Account
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\CloseAccount(
body: [
'Password' => 'Abcd1234',
'Reason' => 'No longer needed.',
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get DPA Details
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\GetDpaDetails()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Accept DPA
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\AcceptDpa()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get DPA Details (HTML)
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\GetDpaDetailsHtml()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
List Notifications
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\ListNotifications()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Set Notifications Opened
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\SetNotificationsOpened()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get Marketing Details
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\GetMarketingDetails()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Get What's New Items
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\GetWhatsNewItems()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Reset What's New
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\ResetWhatsNew()
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Generate 2FA Verification
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\GenerateTwoFactorAuthenticationVerification();
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Disable 2FA
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\DisableTwoFactorAuthentication(
body: [
'Password' => 'LoremIpsumDolor',
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Enable 2FA
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\EnableTwoFactorAuthentication(
body: [
'SecretValidator' => '',
'Secret' => '',
'TestPin' => '123456',
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.
Verify 2FA Code
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\VerifyTwoFactorAuthenticationCode(
body: [
'SecretValidator' => '',
'Secret' => '',
'TestPin' => '123456',
],
)
);
Undocumented endpoint
This endpoint is no longer in the OpenAPI specifications but can still be used indefinitely.