https://pb.YOUR_SUBDOMAIN.workers.dev
All endpoints (except GET /f/{fileId}) require authentication via Bearer token:
Authorization: Bearer pb_1234567890abcdef
Upload a new file to the service.
POST /upload
Authorization: Bearer PB_API_KEY
Content-Type: multipart/form-dataRequest Body:
file: Binary file data (multipart/form-data)
Response:
{
"url": "https://pb.YOUR_SUBDOMAIN.workers.dev/f/abc123def456",
"fileId": "abc123def456",
"size": 1024
}Status Codes:
200 OK: File uploaded successfully401 Unauthorized: Invalid or missing API key413 Payload Too Large: File exceeds size limit500 Internal Server Error: Upload failed
Retrieve a previously uploaded file. No authentication required.
GET /f/{fileId}Response:
- Binary file data with appropriate Content-Type and Content-Disposition headers
- Original filename preserved in Content-Disposition header
Status Codes:
200 OK: File retrieved successfully404 Not Found: File not found
Delete a file you uploaded.
DELETE /f/{fileId}
Authorization: Bearer PB_API_KEYResponse:
{
"fileId": "abc123def456",
"message": "File deleted successfully"
}Status Codes:
200 OK: File deleted successfully401 Unauthorized: Invalid or missing API key403 Forbidden: File not owned by this API key404 Not Found: File not found
List all files uploaded with your API key.
GET /list
Authorization: Bearer PB_API_KEYResponse:
{
"files": [
{
"fileId": "abc123def456",
"originalName": "document.pdf",
"size": 1024,
"contentType": "application/pdf",
"uploadedAt": "2023-12-01T10:30:00.000Z",
"url": "https://pb.YOUR_SUBDOMAIN.workers.dev/f/abc123def456"
}
]
}Status Codes:
200 OK: List retrieved successfully401 Unauthorized: Invalid or missing API key
All error responses follow this format:
{
"error": "Error message description"
}Rate limits are enforced by Cloudflare Workers:
- 1000 requests per minute per IP
- File size limits depend on your Cloudflare plan
The API supports CORS for browser-based uploads. All endpoints include appropriate CORS headers.