Skip to main content

Files Module

The Files module provides file upload, download, metadata management, and deletion through a local filesystem storage backend. Files are stored in a configurable directory and tracked in PostgreSQL.

Overview

Files are associated with a project and stored at {FILES_STORAGE_DIR}/{id}{ext} on the server's local filesystem. Every file record exposes an id — the internal database primary key is never returned.

Configuration

Environment VariableRequiredDescription
FILES_STORAGE_DIRYesAbsolute path to the directory where uploaded files are stored. Must be writable by the server process.

When running via Docker, mount a volume at this path to persist files across container restarts:

services:
server:
image: soat-server
environment:
FILES_STORAGE_DIR: /data/files
volumes:
- files-data:/data/files

volumes:
files-data:

Data Model

FieldTypeDescription
idstringPublic identifier
filenamestringOriginal filename
contentTypestringMIME type
sizenumberFile size in bytes
storageTypelocal | s3 | gcsStorage backend (currently local)
storagePathstringAbsolute path on disk
metadatastringArbitrary JSON string for custom metadata
projectIdstringID of the owning project
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last-updated timestamp

Permissions

File operations are governed by per-project policies. Grant the following permissions to allow a user to perform each action:

ActionPermissionREST EndpointMCP Tool
List filesfiles:GetFileGET /api/v1/fileslist-files
Get file metadatafiles:GetFileGET /api/v1/files/:idget-file
Create a metadata-only recordfiles:CreateFilePOST /api/v1/filescreate-file
Upload a filefiles:UploadFilePOST /api/v1/files/uploadupload-file
Download file contentfiles:DownloadFileGET /api/v1/files/:id/downloaddownload-file
Update metadatafiles:UpdateFileMetadataPATCH /api/v1/files/:id/metadataupdate-file-metadata
Delete a filefiles:DeleteFileDELETE /api/v1/files/:iddelete-file

See the API Reference for full endpoint details, request/response schemas, and status codes.