CloudFam
Features Payout Rates FAQ

Developer docs

CloudFam Developer API

Use the CloudFam API to upload files, manage your catalog, and monitor key signals like traffic quality — all from your own tools and workflows.

Authentication

All API requests must be authenticated using your unique API key. Include it in every request as an X-API-Key header.

Example header

X-API-Key: YOUR_API_KEY

API Tester

Before wiring the API into your application, you can experiment with requests in a controlled environment. The API Tester uses the same validation rules as production, so responses match real-world behavior.

Launch API Tester

Endpoints

Upload File (Direct Upload)

Recommended

Uploading is a three-step process designed for performance and reliability. You first create a temporary upload URL, then upload the file, and finally let CloudFam finalize the file and create a download link.

Step 1: Create an upload URL

Request a secure, one-time URL for uploading your file.

GET /api.php?action=create_upload_url

Success response (200 OK)

{
    "success": true,
    "uploadURL": "https://your-r2-presigned-url.com/...",
    "key": "temp-uploads/USER_ID/UNIQUE_ID"
}

Step 2: Upload the file

Perform a PUT request to the uploadURL you received in step 1. The body should be the raw file bytes.

curl --request PUT "THE_UPLOAD_URL_FROM_STEP_1" \
  --header 'Content-Type: your_file_mime_type' \
  --data-binary '@/path/to/your/file.zip'

Step 3: Finalize the upload

After the file upload has completed successfully, notify CloudFam so we can process the file and generate a download link.

POST /api.php?action=finalize_upload

Request body

{
    "key": "THE_KEY_FROM_STEP_1",
    "original_filename": "my-awesome-file.zip"
}

Success response (201 Created)

{
    "success": true,
    "message": "File finalized successfully.",
    "download_link": "https://cloudfam.io/a1b2c3d4e5f6"
}

View Files

Retrieve a list of all active files associated with the authenticated account.

GET /api.php?action=view_files

Success response (200 OK)

{
    "success": true,
    "files": [
        {
            "id": 1,
            "original_filename": "document.pdf",
            "file_size_bytes": 102400,
            "download_count": 150,
            "uploaded_at": "2025-08-14 10:00:00"
        }
    ]
}

Delete Files

Move one or more files to your trash. Files in trash are not served to users and can be permanently removed via the web interface or future API endpoints.

POST /api.php?action=delete_files

Request body

{
    "file_ids": [1, 2, 3]
}

Success response (200 OK)

{
    "success": true,
    "message": "3 file(s) moved to trash."
}

See Traffic Quality

Retrieve your current traffic quality score, which helps you understand how your traffic performs against our internal benchmarks.

GET /api.php?action=traffic_quality

Success response (200 OK)

{
    "success": true,
    "traffic_quality_score": 85
}