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
PaymentAmounthas 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
PaymentAmounthas 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
Bodyrequires 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
LinkedPullZoneandLinkedStorageZoneare not required unlike stated in the API specifications. - The key
Bodyrequires 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
searchis 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',
],
'PlayerVersion' => 1,
],
)
);
Note
- The key
ReplicationRegionshas 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)
- The key
PlayerVersionhas the following possible values:1= Default video player2= Beta video player
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',
'EnableTranscribingChaptersGeneration' => false,
'EnableTranscribingMomentsGeneration' => false,
'ScaleVideoUsingBothDimensions' => true,
],
)
);
Note
- The key
EnabledResolutionshas the following possible values (comma separated):240p360p480p720p1080p1440p2160p
- The key
Controlshas the following possible values (comma separated):play-largeplayprogresscurrent-timemutevolumecaptionssettingspipairplayfullscreen
- The key
MinClientSecurityLevelhas the following possible values:NoneL1L2L3
- The key
DrmVersionhas the following possible values:BasicEnterpriseBasicV2
- To get a full list of possible value options for key
TranscribingCaptionLanguages, see the Get Languages endpoint. - The key
EncodingTierhas the following possible values:0=Free1=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
Hostnameallows 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
Hostnamedoes 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
Hostnamedoes 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
Hostnamedoes 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
searchcan be used to filter onIdorDomain. A search value with anIdvalue will perform an exact match, whereas a search value with aDomainwill perform a wildcard search:bunny,nnyand.netwill 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
LogAnonymizationTypehas the following possible values:0=OneDigit1=Drop
- The key
CertificateKeyTypehas the following possible values:0=Ecdsa1=Rsa
- In order to disable
LoggingIPAnonymizationEnabledyou first need to agree to the DPA agreement (GDPR). - The API accepts both the integer as well as enum value for the
LogAnonymizationTypeandCertificateKeyType.
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
EnviromentalVariablesis misspelled in the API specifications. - The key
Typehas the following possible values:0=A1=AAAA2=CNAME3=TXT4=MX5=RDR(Redirect)6=Flatten7=PZ(Pull Zone)8=SRV9=CAA10=PTR11=SCR(Script)12=NS
- The key
ScriptIdis not returned in the response. - The key
MonitorTypehas the following possible values:0=None1=Ping2=HTTP3=Monitor
- The key
SmartRoutingTypehas the following possible values:0=None1=Latency2=Geolocation
- The API accepts both the integer as well as enum value for the
Type,MonitorTypeandSmartRoutingType.
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
EnviromentalVariablesis misspelled in the API specifications. - The key
Typehas the following possible values:0=A1=AAAA2=CNAME3=TXT4=MX5=Redirect6=Flatten7=PullZone8=SRV9=CAA10=PTR11=Script12=NS
- The key
ScriptIdis not returned in the response. - The key
MonitorTypehas the following possible values:0=None1=Ping2=HTTP3=Monitor
- The key
SmartRoutingTypehas the following possible values:0=None1=Latency2=Geolocation
- The API accepts both the integer as well as enum value for the
Type,MonitorTypeandSmartRoutingType.
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
searchis 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
Typehas the following possible values:0= Premium1= Volume
- The key
OriginTypehas the following possible values:0=OriginUrl1=DnsAccelerate2=StorageZone3=LoadBalancer4=EdgeScript5=MagicContainers6=PushZone
- The key
LogFormathas the following possible values:0=Plain1=JSON
- The key
LogForwardingFormathas the following possible values:0=Plain1=JSON
- The key
LogAnonymizationTypehas the following possible values:0=OneDigit1=Drop
- The key
LogForwardingProtocolhas the following possible values:0=UDP1=TCP2=TCPEncrypted3=DataDog
- The key
ShieldDDosProtectionTypehas the following possible values:0=DetectOnly1=ActiveStandard2=ActiveAggresive
- The key
OptimizerWatermarkPositionhas the following possible values:0=BottomLeft1=BottomRight2=TopLeft4=Center5=CenterStretch
- The key
PreloadingScreenThemehas the following possible values:0=Light1=Dark
- The key
StickySessionTypehas the following possible values:0=Off1=On
- The keys
CacheControlBrowserMaxAgeOverrideandCacheControlBrowserMaxAgeOverrideaccept any values in seconds. The Bunny dashboard will show the valueMatch Server Cache Expirationbut the value updated through the API will be honored. - The key
OriginShieldZoneCodeaccepts 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,PreloadingScreenThemeandStickySessionType.
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
Typehas the following possible values:0= Premium1= Volume
- The key
OriginTypehas the following possible values:0=OriginUrl1=DnsAccelerate2=StorageZone3=LoadBalancer4=EdgeScript5=MagicContainers6=PushZone
- The key
LogFormathas the following possible values:0=Plain1=JSON
- The key
LogForwardingFormathas the following possible values:0=Plain1=JSON
- The key
LogAnonymizationTypehas the following possible values:0=OneDigit1=Drop
- The key
LogForwardingProtocolhas the following possible values:0=UDP1=TCP2=TCPEncrypted3=DataDog
- The key
ShieldDDosProtectionTypehas the following possible values:0=DetectOnly1=ActiveStandard2=ActiveAggresive
- The key
OptimizerWatermarkPositionhas the following possible values:0(BottomLeft)1(BottomRight)2(TopLeft)4(Center)5(CenterStretch)
- The key
PreloadingScreenThemehas the following possible values:0=Light1=Dark
- The key
StickySessionTypehas the following possible values:0=Off1=On
- The key
PreloadingScreenShowOnFirstVisitis required when using preloading screen features. - The keys
CacheControlBrowserMaxAgeOverrideandCacheControlBrowserMaxAgeOverrideaccept any values in seconds. The Bunny dashboard will show the valueMatch Server Cache Expirationbut the value updated through the API will be honored. - The key
OriginShieldZoneCodeaccepts the 2-digit codeFR(France, Paris) orIL(Illinois, Chicago). - The keys
OptimizerClassesandBunnyAiImageBlueprintsaccept arrays of objects withNameandPropertiesfields. - The API accepts both the integer as well as enum value for the
Type,OriginType,LogFormat,LogForwardingFormat,LogAnonymizationType,LogForwardingProtocol,ShieldDDosProtectionType,PreloadingScreenThemeandStickySessionType.
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
ActionTypehas the following possible values:0=ForceSSL1=Redirect2=OriginUrl3=OverrideCacheTime4=BlockRequest5=SetResponseHeader6=SetRequestHeader7=ForceDownload8=DisableTokenAuthentication9=EnableTokenAuthentication10=OverrideCacheTimePublic11=IgnoreQueryString12=DisableOptimizer13=ForceCompression14=SetStatusCode15=BypassPermaCache16=OverrideBrowserCacheTime17=OriginStorage18=SetNetworkRateLimit19=SetConnectionLimit20=SetRequestsPerSecondLimit21=RunEdgeScript22=OriginMagicContainers23=DisableWAF24=RetryOrigin25=OverrideBrowserCacheResponseHeader26=RemoveBrowserCacheResponseHeader27=DisableShieldChallenge28=DisableShield29=DisableShieldBotDetection30=BypassAwsS3Authentication31=DisableShieldAccessLists32=DisableShieldRateLimiting
- The key
Typein aTriggerobject has the following possible values:0=URL1=RequestHeader2=ResponseHeader3=URLExtension4=CountryCode5=RemoteIP6=UrlQueryString7=RandomChance8=StatusCode9=RequestMethod10=CookieValue11=CountryStateCode12=OriginRetryAttemptCount13=OriginConnectionError
- The key
TriggerMatchingTypehas the following possible values:0=MatchAny1=MatchAll2=MatchNone
- The API accepts both the integer as well as enum value for the
ActionType,TypeandTriggerMatchingType. - The keys
Guid,TypeandPatternMatchingTypein 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
Idin 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
CertificateandCertificateKeyrequire 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
Hostnameallows 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
Hostnamedoes 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
Hostnamedoes 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
searchis 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
OriginUrlallows 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.pngdoesn't exist on the storage zone, the system will try to proxy and fetch it from theOriginUrlinstead. You can omit it unless needed. - The key
ZoneTierhas the following possible values (undocumented):0=Standard(HDD)1=Edge(SSD)
- The key
Regionhas 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
ReplicationRegionshas 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
StorageZoneTypeis 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
OriginUrlallows 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.pngdoesn't exist on the storage zone, the system will try to proxy and fetch it from theOriginUrlinstead. You can omit it unless needed. - The key
ReplicationZoneshas 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 Audit Log
$bunnyHttpClient->request(
new \ToshY\BunnyNet\Model\Api\Base\User\GetUserAuditLog(
date: (new \DateTime('-1 day'))->format('m-d-y'),
query: [
'Product' => [
'BunnyShield',
],
'ResourceType' => [
'Access Lists',
],
'ResourceId' => [
'1',
],
'ActorId' => [
'53c6cf29-c7cc-4d82-8187-56938c5e0734',
],
'Order' => [
'<key>' => '<value>',
],
'ContinuationToken' => [
'MWRiMjM0MTItMzM4Yy00NmFiLWEwYzEtN2E2ZGE2N2FiYzc4LTE3NjE4NjA0ODE4ODM=',
],
'Limit' => [
10000
]
],
)
);
Note
- The key
Limithas a value range of 1-10000.
Warning
- The key
Limitis currently not functional. - The key
Orderhas unknown key-value usage.
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.