Upload File
File storage
Upload File
Upload and index documents from paths visible inside the server container (async file upload job).
POST
Upload File
Overview
Upload one or more files from a server-visible path into a text namespace. The server reads the file from disk (no HTTP multipart body), chunks it with the bundled Python chunker, generates batch summaries every 100 chunks, embeds each chunk, and stores them for search.Path-based upload only (v1). Copy or mount files under
~/.moorcheh/uploads on the host (mounted read-only as /uploads in the container). API requests must use container paths such as /uploads/document.pdf..pdf, .docx, .xlsx, .pptx, .txt, .csv, .md, .json.
The job runs asynchronously. Poll File job status with the returned job_id.
Path parameters
Target text namespace.
Headers
Must be
application/jsonBody
Non-empty array of file objects.
Absolute path inside the server container. Use
/uploads/... for files under the default upload mount.When
true, re-chunk and replace the index even if file_size and file_mtime match a previous upload.Optional extra keys on each file object are merged into chunk metadata (for example
"department": "engineering").File identity and deduplication
file_idis server-generated: first 16 hex chars ofsha256(namespace + NUL + absolute_path).- Skip re-upload when the same path already exists with the same
file_sizeandfile_mtime, unlessforce_reindexistrue. - Chunk ids:
{file_id}_chunk_{index}. Summary ids:{file_id}_summary_{batch}. - Each content chunk metadata includes
summary_chunk_id(bare id, e.g.abc_summary_0) linking to its batch summary.
Request example
Response fields
"success" when the upload job started or all files were skipped.Human-readable result.
Async job id when at least one file is uploading. Poll File job status.
Target namespace.
Number of file entries in the request.
Files accepted into the upload job.
Files skipped as already indexed (same size/mtime). Each entry includes
file_id, absolute_path, and message.Errors
| HTTP | Cause |
|---|---|
| 400 | Empty files, unsupported extension, path outside /uploads, file not found, non-text namespace |
| 404 | Namespace not found |
POST time). If exceeded, the job finishes with status: "failed" and last_error like "Item limit exceeded: max …, current …, requested … new items." — poll File job status.