Corpus Endpoints
All endpoints operate on the working directory’s input/
, output/
, logs/
, and archives/
.
Uploads & Files
POST /api/corpus/upload
— multipart form withfiles
(PDFs). Writes toinput/
and updatesoutput/uploads.json
.GET /api/corpus/file?name=<file>
— Inline-serve a file frominput/
(orinput/_pdfs
for archived PDFs). Supports.pdf
and.txt
.POST /api/corpus/remove
— Body{ name }
. Removes a file frominput/
and marks it removed in the registry.
Indexing
GET /api/corpus/index/stream
— Starts indexing and streams progress via SSE. Also converts PDFs→TXT if needed and writes log history.POST /api/corpus/index/stop
— No-op placeholder (single-process stream lifecycle).
State
GET /api/corpus/state
— Returns uploads registry and output stats if present. Also persists a mergeduploads.json
.POST /api/corpus/kg/rename
— Body{ name }
. Setsoutput/kg.json
friendly name.
Archives
POST /api/corpus/archive/create
— Archives working set intoarchives/kg-<timestamp>/
and resets a clean workspace.GET /api/corpus/archive/list
— Lists archives with computed size and name (fromkg.json
).POST /api/corpus/archive/restore
— Body{ name }
. Swaps current working set with the target archive contents.POST /api/corpus/archive/rename
— Body{ from, to }
. Changes archive folder name.POST /api/corpus/archive/delete
— Body{ name }
. Removes archive folder.
Nuke
POST /api/corpus/nuke
— Body{ "confirm": "NUKE INDEX" }
. Moves working dirs to a timestamped folder and resetsinput/
andoutput/
.
Last updated on