Download OpenAPI specification:
RAG Input file management endpoints. Handles upload and management of binary media files for RAG (Retrieval-Augmented Generation). A file may be placed in a scope (an ordered folder path, e.g. project/module); an empty scope means a plain database-level file. Files support versioning — each upload of the same file (identified by name + database + scope) creates a new version.
Supported file types: images, videos, audio, PDFs, and other binary media.
Limits (for product/UX awareness):
Uploads a binary file for RAG processing.
Stores the file in StorageSidecar and creates metadata in MetadataStoreSidecar.
Each upload of the same file (name + database + scope) creates a new version.
Optional custom_metadata is a JSON object of string keys/values stored with
the file and returned on get/list (replaced on each new version).
| database required | string Database name |
| name required | string [ 1 .. 255 ] characters File name identifier |
| scope | Array of strings (ScopeSegment) <= 5 items [ items [ 1 .. 128 ] characters ^[A-Za-z0-9_-]+$ ] Default: [] Ordered scope labels addressing the file within the database (e.g. [project, module]). Labels combined must not exceed 256 characters. Empty = default/legacy file. |
| file required | string <binary> File content to upload |
| custom_metadata | string Optional JSON object of string keys/values (e.g. {"author":"Ada","citable_url":"https://example.com"}). Opaque to File Manager; stored with the file and returned on get/list. At most 32 keys; key ≤64 chars; value ≤2048 chars; total serialized size ≤16 KiB. Omitted or empty = {}. |
{- "id": "string",
- "name": "string",
- "database": "string",
- "scope": [ ],
- "content_type": "string",
- "size": 0,
- "uploaded_at": "2019-08-24T14:15:22Z",
- "metadata_key": "string",
- "version": 1,
- "safe_to_delete": true,
- "custom_metadata": { }
}Lists RAG input files for a database, returning only the latest version of each file (one entry per file id). Optionally filtered by scope (this scope and below; empty = whole database), by exact file name, or by a case-insensitive substring search on the file name.
| database required | string Database name |
| name | string Filter by exact file name |
| search | string Case-insensitive substring match on the file name (UI search box). Combines with scope and pagination. |
| scope | Array of strings (ScopeSegment) <= 5 items [ items [ 1 .. 128 ] characters ^[A-Za-z0-9_-]+$ ] Ordered scope labels; returns files at this scope and below (e.g. scope=acme&scope=legal). Omit the parameter to search the entire database; supply it to search that scope and its subtree. Labels combined must not exceed 256 characters. Only the latest version of each file is returned. |
| limit | integer [ 1 .. 1000 ] Default: 100 Maximum number of results |
| offset | integer >= 0 Default: 0 Pagination offset |
{- "files": [
- {
- "id": "string",
- "name": "string",
- "database": "string",
- "scope": [ ],
- "content_type": "string",
- "storage_location": "string",
- "size": 0,
- "uploaded_at": "2019-08-24T14:15:22Z",
- "version": 1,
- "safe_to_delete": true,
- "custom_metadata": { }
}
], - "total": 0,
- "limit": 1,
- "offset": 0
}Upload several files at once, each placed under its own scope. Use for a folder / multi-category upload.
Two ways to say where each file goes:
scope and optional name. Entries pair with files by an explicit
file index, or by list order. Best for a UI submitting several
categories at once.scope; with
mapping=preserve_paths the subfolders in each upload's filename
become extra scope levels (a folder upload).Each file is processed independently: a bad file is reported as an error and does not stop the others. Max 100 files and 2 GiB total per request.
Status codes: 200 when all files succeed; 207 when the request was processed but one or more files failed (per-file results in the body); 500 when every file fails with an internal error (e.g. the storage backend is down); 400/413 for a malformed or oversized request.
| database required | string Database name |
| files required | Array of strings <binary> [ items <binary > ] One or more files to upload |
| manifest | string Optional JSON array, one entry per file: [{"file": 0, "scope": ["acme","legal"], "name": "a.pdf", "custom_metadata": {"author": "Ada"}}]. Each entry's scope follows the common scope limits. Optional per-entry custom_metadata is a string→string object (same limits as single-file upload), merged on top of the shared custom_metadata form field (entry value wins on a key collision). |
| scope | Array of strings (ScopeSegment) <= 5 items [ items [ 1 .. 128 ] characters ^[A-Za-z0-9_-]+$ ] Default: [] Shared ordered scope for all files when no manifest is supplied. Labels combined must not exceed 256 characters. |
| mapping | string Default: "flatten" Enum: "flatten" "preserve_paths" How to place files when using the shared scope. 'flatten' puts all files directly under scope; 'preserve_paths' appends each file's subfolders as extra scope levels. |
| custom_metadata | string Optional JSON object of string keys/values applied to every file in the batch. A manifest entry's own custom_metadata is merged on top (entry value wins on a key collision). |
{- "database": "string",
- "results": [
- {
- "name": "string",
- "scope": [ ],
- "status": "string",
- "id": "string",
- "version": 1,
- "content_type": "string",
- "size": 0,
- "uploaded_at": "2019-08-24T14:15:22Z",
- "metadata_key": "string",
- "custom_metadata": { },
- "detail": "string"
}
], - "ok_count": 0,
- "error_count": 0
}Get the full version history for a specific file lineage. A lineage is identified by name + database + scope (empty scope = a default/database-level file).
| database required | string Database name |
| name required | string File name identifier |
| scope | Array of strings (ScopeSegment) <= 5 items [ items [ 1 .. 128 ] characters ^[A-Za-z0-9_-]+$ ] Ordered scope labels identifying the lineage (same scope used at upload). Labels combined must not exceed 256 characters. Empty = a default/database-level file. |
{- "name": "string",
- "database": "string",
- "scope": [ ],
- "versions": [
- {
- "version": 1,
- "metadata_key": "string"
}
], - "latest_version": 1
}Browse one level of the scope tree. Returns the immediate child scopes
(e.g. the modules in a project) AND the files located exactly at the
given scope — both in the same response (not either/or). On a project
page (scope=[project]) that means modules in children plus any
files uploaded directly to the project in files.
Children come from a per-(database, parent-scope) registry (a single
read); files at the exact scope come from a prefix scan.
| database required | string Database name |
| scope | Array of strings (ScopeSegment) <= 5 items [ items [ 1 .. 128 ] characters ^[A-Za-z0-9_-]+$ ] The scope path to browse (e.g. scope=acme for a project page). Labels combined must not exceed 256 characters. Empty = the database root (lists top-level scopes). |
{- "database": "string",
- "scope": [ ],
- "children": [
- {
- "segment": "string",
- "file_count": 0
}
], - "files": [
- {
- "id": "string",
- "name": "string",
- "database": "string",
- "scope": [ ],
- "content_type": "string",
- "storage_location": "string",
- "size": 0,
- "uploaded_at": "2019-08-24T14:15:22Z",
- "version": 1,
- "safe_to_delete": true,
- "custom_metadata": { }
}
]
}Retrieves metadata and information about a stored RAG input file.
| database required | string Database name |
| id required | string File identifier |
| version | integer >= 1 Version number (default: latest) |
{- "id": "string",
- "name": "string",
- "database": "string",
- "scope": [ ],
- "content_type": "string",
- "storage_location": "string",
- "size": 0,
- "uploaded_at": "2019-08-24T14:15:22Z",
- "version": 1,
- "safe_to_delete": true,
- "custom_metadata": { }
}Set or clear safe_to_delete for a file (the whole lineage — all
versions). Consumer services use this to lock a file while it is in use
(false) and unlock it when it may be removed (true). Delete is gated on
this flag.
| database required | string Database name |
| id required | string File identifier |
| safe_to_delete required | boolean Whether the file may be deleted (true = unlocked) |
{- "safe_to_delete": true
}{- "id": "string",
- "name": "string",
- "database": "string",
- "scope": [ ],
- "content_type": "string",
- "storage_location": "string",
- "size": 0,
- "uploaded_at": "2019-08-24T14:15:22Z",
- "version": 1,
- "safe_to_delete": true,
- "custom_metadata": { }
}Deletes a RAG input file from StorageSidecar and removes its metadata from MetadataStoreSidecar.
| database required | string Database name |
| id required | string File identifier |
| version | integer >= 1 Version number (default: latest) |
{- "id": "string",
- "database": "string",
- "status": "deleted"
}Delete several files in one request, each given by its file id. Each id
deletes the WHOLE file (all versions). Only files with
safe_to_delete=true are removed; locked files are reported and left
untouched. Per-file results.
| database required | string Database name |
| ids required | Array of strings [ 1 .. 100 ] items File ids to delete (each removes the whole file) |
{- "ids": [
- "string"
]
}{- "database": "string",
- "results": [
- {
- "id": "string",
- "status": "string",
- "detail": "string"
}
], - "deleted_count": 0,
- "locked_count": 0,
- "error_count": 0
}Delete every file at the given scope AND below it (subtree) — e.g. a
whole module. Only files with safe_to_delete=true are removed; locked
files are reported and left untouched. An empty scope is rejected so the
whole database cannot be wiped by accident.
| database required | string Database name |
| scope required | Array of strings (ScopeSegment) <= 5 items [ items [ 1 .. 128 ] characters ^[A-Za-z0-9_-]+$ ] Non-empty scope whose files and sub-scopes to delete; labels combined must not exceed 256 characters |
{- "scope": [
- "string"
]
}{- "database": "string",
- "scope": [
- "string"
], - "deleted": [
- "string"
], - "locked": [
- "string"
], - "failed": [
- "string"
], - "deleted_count": 0,
- "locked_count": 0
}Set safe_to_delete (the whole lineage — all versions) for several
files in one request. Consumer services use this to lock files while in
use (false) and unlock them (true). Unknown ids are reported as
not_found.
| database required | string Database name |
| ids required | Array of strings [ 1 .. 100 ] items File ids whose safe_to_delete flag to set (whole lineage each) |
| safe_to_delete required | boolean New flag value (false = lock, true = unlock) |
{- "ids": [
- "string"
], - "safe_to_delete": true
}{- "database": "string",
- "results": [
- {
- "id": "string",
- "status": "string"
}
], - "updated_count": 0,
- "error_count": 0
}Set safe_to_delete for every file at the given scope AND below it
(subtree) — e.g. a whole module. An empty scope is rejected so the whole
database cannot be toggled by accident.
| database required | string Database name |
| scope required | Array of strings (ScopeSegment) <= 5 items [ items [ 1 .. 128 ] characters ^[A-Za-z0-9_-]+$ ] Non-empty scope whose files and sub-scopes to update; labels combined must not exceed 256 characters |
| safe_to_delete required | boolean New flag value (false = lock, true = unlock) |
{- "scope": [
- "string"
], - "safe_to_delete": true
}{- "database": "string",
- "scope": [
- "string"
], - "updated": [
- "string"
], - "failed": [
- "string"
], - "updated_count": 0
}Downloads the actual file content as a streaming binary response.
| database required | string Database name |
| id required | string File identifier |
| version | integer >= 1 Version number (default: latest) |
{- "detail": "string"
}