HTTP API

API reference

The API covers the same core actions as the dashboard: list files, upload content, manage folders, create shares, and download files or zip archives.

Issue a token

curl -X POST http://nathanielstam.com/api/auth/token \
  -H "Content-Type: application/json" \
  -d '{"username":"your-user","password":"your-password","label":"agent"}'

List files

curl http://nathanielstam.com/api/files?path=folder/subfolder \
  -H "Authorization: Bearer <token>"

Upload files or folders

curl -X POST http://nathanielstam.com/api/files/upload \
  -H "Authorization: Bearer <token>" \
  -F "path=uploads" \
  -F "[email protected]" \
  -F "[email protected]"

For folder uploads, send matching `relativePaths[]` values for each multipart file.

Download

curl -L "http://nathanielstam.com/api/files/download?path=reports/annual.pdf" \
  -H "Authorization: Bearer <token>" \
  -o annual.pdf

If the requested path is a folder, the response is a zip archive.

Create folder

POST /api/folders
{"path":"projects","name":"drafts"}

Move item

POST /api/files/move
{"source":"drafts/notes.txt","destination":"archive"}

Delete item

DELETE /api/files
{"path":"archive/notes.txt"}

Create share

curl -X POST http://nathanielstam.com/api/shares \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"path":"projects/spec.md"}'

Inspect public share

curl http://nathanielstam.com/api/public/shares/TOKEN

Replace `TOKEN` with the real share token. Add `?path=subfolder/file.txt` on the public download endpoint for nested items inside a shared folder.