Developer-first API

Build secure file storage into your apps with our simple, powerful API. Zero-knowledge encryption included.

Why developers love our API 💻

Simple & Fast

Upload a file with just one API call. Download with another. That's it.

Security Built-in

End-to-end encryption happens automatically. You don't need to think about it.

Global CDN

Your files are automatically distributed worldwide for lightning-fast access.

Real-time Analytics

Track downloads, views, and user engagement with detailed analytics.

Multiple SDKs

Native libraries for JavaScript, Python, PHP, and more coming soon.

Generous Limits

1000 requests/minute for pro accounts. Scale up as you grow.

Quick Start Guide 🚀

1. Get your API key

Sign up and generate your API key in the dashboard.

2. Upload a file

BASH
# Upload file with automatic encryption curl -X POST \ 'https://api.privvault.com/v1/upload' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -F 'file=@document.pdf' \ -F 'password=optional_password'
JAVASCRIPT
const formData = new FormData(); formData.append('file', fileInput.files[0]); formData.append('password', 'optional_password'); const response = await fetch('https://api.privvault.com/v1/upload', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY' }, body: formData }); const result = await response.json(); console.log('Download code:', result.download_code);
PYTHON
import requests with open('document.pdf', 'rb') as f: response = requests.post( 'https://api.privvault.com/v1/upload', headers={'Authorization': 'Bearer YOUR_API_KEY'}, files={'file': f}, data={'password': 'optional_password'} ) result = response.json() print(f"Download code: {result['download_code']}")

3. Response

200 OK
{ "success": true, "download_code": "ABC1-DEF2-GHI3", "file_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "download_url": "https://privvault.com/ABC1-DEF2-GHI3", "expires_at": "2025-08-23T14:30:00Z", "blockchain_hash": "0x7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069", "file_size": 2048576, "encrypted": true }

4. That's it! 🎉

Your file is now securely encrypted and stored. Share the download_code with anyone who needs access.

API Endpoints 📡

POST /v1/upload

Upload and encrypt a file. Returns a download code for secure sharing.

Parameters
Parameter Type Required Description
file file Required File to upload
password string Optional Additional password protection
expires_in integer Optional Expiration time in seconds (default: 30 days)
allow_preview boolean Optional Enable file preview without download (default: true)
GET /v1/download/{download_code}

Download and decrypt a file using its download code.

Parameters
Parameter Type Required Description
download_code string Required Download code from upload response
password string Optional Password if file was password protected
GET /v1/info/{download_code}

Get file metadata without downloading the actual file.

200 OK
{ "filename": "document.pdf", "file_size": 2048576, "content_type": "application/pdf", "uploaded_at": "2025-07-23T14:30:00Z", "expires_at": "2025-08-23T14:30:00Z", "download_count": 5, "has_password": true, "preview_available": true }
DELETE /v1/delete/{file_id}

Permanently delete a file. Requires API key authentication.

200 OK
{ "success": true, "message": "File deleted successfully" }

Rate Limiting & Quotas ⏱️

Current Limits

Free accounts: 0 requests/minute, 0GB storage
Premium accounts: 1000 requests/minute, 100GB+ storage

Rate Limit Headers

Every API response includes rate limit information:

X-RateLimit-Limit: 100 X-RateLimit-Remaining: 95 X-RateLimit-Reset: 1627123456

429 Too Many Requests

When you exceed limits, you'll receive:

{ "error": "rate_limit_exceeded", "message": "Too many requests", "retry_after": 60 }

Error Handling 🚨

Common Error Codes

400 Bad Request
{ "error": "invalid_request", "message": "File too large" }
401 Unauthorized
{ "error": "unauthorized", "message": "Invalid API key" }
404 Not Found
{ "error": "file_not_found", "message": "File expired or doesn't exist" }
500 Server Error
{ "error": "server_error", "message": "Something went wrong" }

SDKs & Libraries 📚

JavaScript SDK

For browsers and Node.js

Available
npm install privvault-js
Python SDK

For Python 3.7+

Available
pip install privvault
PHP SDK

For PHP 7.4+

Beta
composer require privvault/php-sdk
Java SDK

For Java 11+

Planned
Go SDK

For Go 1.18+

Planned
Rust SDK

For Rust 1.60+

Planned

Real-world Examples 🌟

Photo Sharing App

// Upload user photo with auto-expiry async function sharePhoto(file) { const formData = new FormData(); formData.append('file', file); formData.append('expires_in', '86400'); // 24 hours const response = await fetch('https://api.privvault.com/v1/upload', { method: 'POST', headers: { 'Authorization': 'Bearer ' + API_KEY }, body: formData }); const result = await response.json(); return result.download_url; }

Document Management

# Secure document upload with password import privvault client = privvault.Client(api_key='your_api_key') # Upload with strong password result = client.upload( file_path='confidential.pdf', password='super_secure_password_123', expires_in=7*24*3600 # 7 days ) print(f"Share this link: {result.download_url}")

Ready to build with PrivVault? 🎯

Get your API key and start building secure file storage into your apps today.

Get API Key 🔑 View Security Details 🛡️