For complete API documentation, see the Edge Storage API Reference.
Authentication
All requests require authentication using theAccessKey header with your storage zone password.
Storage endpoints
The API endpoint depends on your storage zone’s primary region:
Find your endpoint in the Access page of your storage zone.
Upload a file
Upload files using a PUT request with the file content in the request body.Request format
Method:PUT
URL format: https://{region}.bunnycdn.com/{storageZoneName}/{path}/{fileName}
Path parameters:
storageZoneName(required) - Your storage zone namepath(optional) - Directory path where the file will be stored (omit for root)fileName(required) - Name for the uploaded file
AccessKey(required) - Your storage zone passwordContent-Type(optional) - MIME type of the file (e.g.,image/jpeg,application/pdf)Checksum(optional) - SHA256 checksum in HEX format (uppercase)
Example
With checksum
Response codes
Important considerations
- Use the correct regional endpoint for your storage zone’s primary region
- Checksum hashes must be SHA256 in HEX format and UPPERCASE
- Use
--upload-filewith curl to send file contents as raw binary - The
Content-Typeheader helps with proper file serving but is optional
Download a file
Download files using a GET request:List files
List files in a directory using a GET request to the directory path:Delete a file
Delete files or directories using a DELETE request. Deleting a directory recursively removes all of its contents.Deleting the root directory
By default, deleting the root directory (/) is blocked as a safety guard. To bypass this protection, include allowRootDelete=true as either a query string parameter or a request header.
Via query string parameter:
- Key:
allowRootDelete - Value:
true
- Name:
allowRootDelete - Value:
true