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

  1. Use your sk- private key to call POST /x-file/upload, optionally passing expiration and download_limit form fields.
  2. The response includes a token and download URL that you can embed in emails or front ends.
  3. Retrieve usage stats with GET /x-file or GET /x-file/quota to monitor capacity.
  4. 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

MethodPathDescription
POST/x-file/uploadMultipart upload with optional expiration and download_limit
GET/x-fileList files and quota metrics
GET/x-file/quotaCheck 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-allPurge 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/privacy so only authenticated calls can access files.
  • How to scale storage? Raise quotas through the admin workflowβ€”changes propagate immediately.