Docs

Upload API

واجهة الرفع

Create a key from API keys after you sign in. The full key is shown once and only its SHA-256 hash is stored. Send it as Authorization: Bearer fsk_…

Calls

Replace BASE with your FileShare address. A folder share link lists that folder. A file link downloads that file inside the same folder share.

curl -s -X POST "$BASE/api/v1/folders" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"path":"Client/2026"}'

curl -s "$BASE/api/v1/folders?path=Client/2026" \
  -H "Authorization: Bearer $KEY"

curl -s -X POST "$BASE/api/v1/uploads" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"filename":"photo.jpg","relative_path":"Client/2026/photo.jpg","total_size":12345,"client_key":"0123456789abcdef0123456789abcdef"}'

curl -s -X PUT "$BASE/api/v1/uploads/UPLOAD_ID?index=0&offset=0" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/octet-stream" \
  --data-binary @photo.jpg

curl -s -X POST "$BASE/api/v1/uploads/UPLOAD_ID/complete" \
  -H "Authorization: Bearer $KEY"

curl -s -X POST "$BASE/api/v1/shares" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"path":"Client/2026"}'

curl -s "$BASE/api/v1/usage" -H "Authorization: Bearer $KEY"

curl -s -X DELETE "$BASE/api/v1/files/FILE_ID" -H "Authorization: Bearer $KEY"
curl -s -X DELETE "$BASE/api/v1/folders/FOLDER_ID" -H "Authorization: Bearer $KEY"
curl -s -X DELETE "$BASE/api/v1/shares/SHARE_ID" -H "Authorization: Bearer $KEY"
curl -s -X DELETE "$BASE/api/v1/uploads/UPLOAD_ID" -H "Authorization: Bearer $KEY"
$Headers = @{ Authorization = "Bearer $Key" }
Invoke-RestMethod -Method Post -Uri "$Base/api/v1/folders" -Headers $Headers `
  -ContentType "application/json" -Body '{"path":"Client/2026"}'

filename is the file name. relative_path may be the folder, such as Client/2026, or the folder plus that same file name. A last segment that looks like a different file is rejected as ambiguous_path. GET /api/v1/usage needs files:read. DELETE moves a file or folder to trash, revokes a share, or cancels an open upload.

Usage and delete

Usage returns used_bytes, quota_bytes (null when unlimited), unlimited, file_count, and folder_count. Delete is scoped to the key owner and does not purge the file bytes immediately.

Resume a large folder

The sample scripts walk a local tree, such as tens of gigabytes of photos and videos. The base URL may include /api/v1 or omit it. Repeat --exclude, pass --files with one path per line, and use --min-age to skip a file that is still being written. --idempotent treats a skipped name as success. Run the same command again after a stop. Completed files are skipped. A partial file continues from bytes_received. HTTP 429 means wait for retry_after. An administrator can raise the upload rate or allowlist the address under Settings, Advanced.

The first request from a new PowerShell session can take about 40 seconds, then later requests are fast. That delay is on the client, usually IPv6 or DNS. On that machine set TLS 1.2 and prefer IPv4. The server cannot choose the client address family.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
pwsh ./tools/fileshare-upload.ps1 -BaseUrl "https://files.your-domain.com" -Token "fsk_..." -LocalPath "D:\photos" -RemotePath "Archive/2026" -Idempotent
curl --ipv4 -sS "https://files.your-domain.com/api/v1/health"
./tools/fileshare-upload.sh --exclude "*.tmp" --min-age 30 --idempotent "https://files.your-domain.com" "fsk_..." "/data/photos" "Archive/2026"