X-FILE File Storage

Overview
X-FILE is a secure storage and delivery layer for developers. It enforces tenant isolation, quota controls, expiring download links, and bulk managementβideal for temporary sharing, user uploads, or internal file drops.
Quick Start
- Use your
sk-private key to callPOST /x-file/upload, optionally passingexpirationanddownload_limitform fields. - The response includes a
tokenand download URL that you can embed in emails or front ends. - Retrieve usage stats with
GET /x-fileorGET /x-file/quotato monitor capacity. - Revoke access instantly via
DELETE /x-file/delete?token=.
Key Capabilities
- Quota governance: Per-account total storage, per-file size limits, and live usage metrics.
- Ephemeral links: Customize lifetimes and download counts; expired files are purged automatically.
- Tenant isolation: Each account has its own directory and ACLs, protecting sensitive content.
- Event-driven cleanup: Hooks into the event bus to remove files when accounts are deactivated.
API Reference
| Method | Path | Description |
|---|---|---|
POST | /x-file/upload | Multipart upload with optional expiration and download_limit |
GET | /x-file | List files and quota metrics |
GET | /x-file/quota | Check current quota usage |
GET | /x-file/download/{token} | Public download link for sharing |
DELETE | /x-file/delete?token= | Delete a specific file |
POST | /x-file/clear-all | Purge all files under the authenticated account |
Example: Upload and Share a File
export XAPI_KEY="your-xapi-key" # sk- prefixed key
curl -X POST https://api.xabcstack.com/x-file/upload \
-H "Authorization: Bearer $XAPI_KEY" \
-F "[email protected]" \
-F "expiration=7d" \
-F "download_limit=10"
Use the returned token to build a public link: https://api.xabcstack.com/x-file/download/{token}.
FAQ
- Max file size? Defaults to 256MB and can be tuned per account via quotas.
- Private downloads? Toggle via
POST /x-file/privacyso only authenticated calls can access files. - How to scale storage? Raise quotas through the admin workflowβchanges propagate immediately.