/ docs

API & SLA reference

Programmatic upload and file listing for Enterprise accounts, plus the health-check endpoint for uptime monitoring.

/ authentication

API keys

Generate a key from the API tab on your dashboard — available to Enterprise accounts and to members of an Enterprise-owned team. The full key (sf_live_...) is shown once at creation; only a SHA-256 hash is stored server-side, so save it somewhere safe. A key issued under a team acts on that team's shared storage and files; a key issued outside a team acts on the owner's personal files.

Send it on every request as a bearer token:

curl -H "Authorization: Bearer sf_live_..." \
  https://www.share-files.xyz/api/v1/files
/ uploading a file

Uploads are two steps: request a direct upload URL, PUT the file bytes straight to storage, then confirm the upload to create the shareable link. This keeps large files off our API servers.

POST/api/v1/upload/init

1. Request an upload URL

Body:

{
  "fileName": "report.pdf",
  "fileSize": 4831201,
  "mimeType": "application/pdf"
}

Response:

{
  "file_id": "b6e2...",
  "upload_url": "https://...r2.cloudflarestorage.com/...",
  "storage_path": "<user_id>/<file_id>/report.pdf"
}
POST(upload_url from step 1)

2. Upload the file bytes

PUT the raw file directly to upload_url — not to ShareFile:

curl -X PUT "${upload_url}" \
  -H "Content-Type: application/pdf" \
  --data-binary @report.pdf
POST/api/v1/upload/complete

3. Confirm and get the share link

Body (file_id and storage_path from step 1):

{
  "file_id": "b6e2...",
  "storage_path": "<user_id>/<file_id>/report.pdf",
  "name": "report.pdf",
  "mime_type": "application/pdf",
  "expiry_days": 30,
  "password": "optional"
}

Response:

{
  "success": true,
  "file_id": "b6e2...",
  "share_url": "https://www.share-files.xyz/download/b6e2..."
}
/ listing files
GET/api/v1/files

List your (or your team's) files

Returns the 200 most recent files, newest first — team files if the key belongs to a team, personal files otherwise.

{
  "files": [
    {
      "id": "b6e2...",
      "name": "report.pdf",
      "size": 4831201,
      "mime_type": "application/pdf",
      "expiry_days": 30,
      "expires_at": "2026-09-16T12:41:48.029Z",
      "download_count": 2,
      "created_at": "2026-08-17T12:41:47.678Z",
      "download_url": "https://www.share-files.xyz/download/b6e2..."
    }
  ]
}
/ errors

Status codes

401Missing or invalid Authorization: Bearer <key> header, or the key was revoked.
403The key's account/team isn't on the Enterprise plan, or the storage quota is exhausted.
400Missing required fields, or storage_path doesn't match the file_id from init.
413File exceeds the plan's per-file size limit (20 GB on Enterprise).
500Upload processing or database error — safe to retry.

Every error response is { "error": "..." } with a human-readable message — safe to surface directly to a user.

/ sla & uptime
GET/api/health

Health check for uptime monitoring

Public, unauthenticated, and safe to poll frequently. Checks database connectivity and reports round-trip latency. Point an external uptime monitor (Better Uptime, Pingdom, UptimeRobot, Datadog Synthetics, etc.) at this URL to track ShareFile's availability independently of our own dashboards.

Healthy response — 200 OK:

{
  "status": "ok",
  "checks": {
    "database": { "ok": true, "latency_ms": 42 }
  },
  "timestamp": "2026-08-17T12:42:52.970Z"
}

Degraded response — 503:

{
  "status": "degraded",
  "checks": {
    "database": { "ok": false, "latency_ms": 1204 }
  },
  "timestamp": "2026-08-17T12:42:52.970Z"
}

This endpoint reports live status — it doesn't itself constitute an SLA. Enterprise SLA terms, uptime commitments, and credit issuance are handled directly with your account contact; reach out via the Enterprise page or contact us.

/ limits
  • API access requires the Enterprise plan (self or team owner).
  • 20 GB max per file, 1 TB pooled storage (fair-use) shared across a team.
  • Link expiry: 1–30 days, set per upload via expiry_days.
  • Uploads under a team key count against the team owner's quota and appear in the team's audit log.
Advertisement