# Drop HTTP API Use the origin serving this file. Public links are bearer capabilities. Keep them private. All paths below are relative to that origin. Protected endpoints accept Authorization: Bearer TOKEN. Create a named upload or admin token from Library > API tokens after signing in as admin. Use HTTPS in production. Never put passwords or API tokens in URLs. ## Upload from a shell Set BASE to the origin and TOKEN to your token. Responses are JSON unless specified. curl -fsS -H "Authorization: Bearer $TOKEN" -F 'file=@clip.mp4' "$BASE/api/upload?days=7" Repeat -F for additional files in the same transfer. This streaming multipart/form-data endpoint requires a Content-Length (curl supplies it for regular files). Its storage reservation includes the MIME framing. Optional query parameters: days (default 7, 0 unlimited, maximum 36500) and URL-encoded message. For folders, streams of known size, large files and retries use the manifest API. The response includes id (private management identifier), share (public identifier), files and expires. Download: BASE/s/SHARE. Viewer: BASE/s/SHARE?view. For one file the download is the original. For multiple files the download is a streamed, uncompressed ZIP preserving relative paths. ## Resumable multipart upload 1. GET /api/me returns role and space.limit in bytes. Admins also get free, total and reserved. The limit is 70% of available filesystem bytes after subtracting outstanding reservations. 2. POST /api/transfers with Content-Type: application/json and the complete manifest: {"message":"For you","days":7,"files":[{"path":"clips/clip.mp4","size":12345}]} Save the transfer id and each files[].id in manifest order. The server reserves all declared file sizes before accepting the transfer. Up to 10000 files and 2 MiB of manifest JSON. File paths are relative. Duplicates are given numbered names; use the returned paths. 3. PATCH /api/transfers/ID/files/FILE_ID with binary bytes, Content-Length and Upload-Offset. Send sequential chunks of up to 8388608 bytes per file. The offset is the number of bytes already confirmed. Example for the entire 12345-byte example file: curl -fsS -X PATCH -H "Authorization: Bearer $TOKEN" -H 'Upload-Offset: 0' \ --data-binary @clip.mp4 "$BASE/api/transfers/$ID/files/$FILE_ID" Success: 204 and the next Upload-Offset header. Skip empty files. After an interruption or 409, GET /api/transfers/ID and resume each file at files[].offset. Only send remaining bytes from the same original. GET also distinguishes ready transfers. 4. POST /api/transfers/ID/finish. This is safe to retry. The response includes both identifiers. The share only becomes public once all files are complete. Link lifetime begins at completion. 5. DELETE /api/transfers/ID cancels a partial transfer and releases the reservation. Interrupted resumable transfers expire after 48 hours without confirmed progress. Failed one-shot multipart requests are discarded immediately. ## Sharing and administration - GET /api/transfers?q=SEARCH&offset=0 lists newest transfers, 50 per page. Search matches file paths and messages. An uploader sees only transfers owned by its token or browser identity. Each token is a separate owner. Admin sees every transfer. - GET /api/transfers/ID returns files with id, path, size, offset. Times are Unix seconds. - PATCH /api/transfers/ID with {"days":30} renews the link, {"days":0} makes it unlimited. {"rotate":true} replaces the public identifier immediately. Owners and admins can change links. Link expiry keeps bytes on disk; an admin can separately schedule actual deletion using {"deleteAt":UNIX_SECONDS} or cancel scheduled deletion with {"deleteAt":0}. - GET /api/transfers/ID/download downloads files privately even after public link expiry. Optional repeated file=FILE_ID query parameters restrict the selection. - POST /api/transfers/ID/files (admin): {"action":"rename","ids":["FILE_ID"],"path":"new/name.ext"}, {"action":"move","ids":["FILE_ID"],"path":"target/folder"} (empty path means root), or {"action":"delete","ids":["FILE_ID"]}. Deleting the last file removes its transfer. - DELETE /api/transfers/ID (admin): permanently delete the complete transfer and its bytes. - GET /api/tokens lists token names, roles and IDs (admin). - POST /api/tokens with {"name":"CI","role":"upload"} or role "admin" returns the raw token once. - DELETE /api/tokens/ID (admin) revokes it immediately. - GET /public/SHARE lists publicly shared files, message and expiry. GET /s/SHARE/FILE_ID downloads one original and accepts HTTP Range. Add ?inline for isolated preview content. - Browser login: POST /api/login {"password":"..."} sets an HttpOnly session cookie for 30 days. POST /api/logout clears the browser session. Use tokens for unattended clients. Errors have a non-2xx HTTP status and short text: 400 invalid input, 401 authentication, 403 insufficient role, 404 unknown/not owned/expired share, 409 offset or upload state, 411 missing length, 429 login throttled, 507 insufficient upload budget.