R2 Manager API

Version 1.0.0

Welcome to the R2 Manager API

This API provides secure access to files stored in Cloudflare R2 storage. It allows you to create secure download links, monitor download statistics, and manage file uploads.

To use this API, you need an API key for authentication.

Available Endpoints

POST
/api/v1/secure-download
Creates a secure, signed download URL for a file with optional restrictions.

Auth required: Yes
GET
/api/v1/download-stats/:sessionId
Retrieves download statistics for a specific download session.

Auth required: Yes
GET
/api/v1/files
Lists all files in the R2 bucket, with optional filtering by prefix.

Auth required: Yes
GET
/api/v1/upload-url
Generates a pre-signed URL for direct file upload to R2.

Auth required: Yes
GET
/api/v1/download-logs
Retrieves audit logs of file downloads, including IP addresses and timestamps.

Auth required: Yes
GET
/api/v1/security-events
Lists security events such as unauthorized access attempts.

Auth required: Yes

API Usage Example

Create a secure download link:


curl -X POST https://api.dev.deslicer.io/api/v1/secure-download \
  -H "Content-Type: application/json" \
  -H "api-key: YOUR_API_KEY" \
  -d '{
    "file_key": "path/to/your/file.pdf",
    "max_downloads": 1,
    "expires_in": 3600
  }'