Skip to content

Search docs

Find pages, headings, and concepts. Press ⌘K or Ctrl+K to toggle.

Files

Upload, list, download, preview, and delete files in org and project storage.

Files are stored in object storage and indexed in PostgreSQL. Each file lives in a folder (parentId) and may be attached to a project. Two upload modes are supported: a JSON pre-signed URL flow and a direct multipart upload. Soft-deleted files are removed from listings; their object-storage blobs are deleted only when no other file references the same storageKey.

Endpoints

MethodPathDescription
GET/api/v1/filesList files in a folder or project.
POST/api/v1/filesUpload a file, create a folder, or create a link to an existing file.
GET/api/v1/files/:idFile metadata, signed download URL, or inline stream.
PATCH/api/v1/files/:idRename, move, or retag a file.
DELETE/api/v1/files/:idSoft-delete a file or folder.
GET/api/v1/files/:id/previewServer-rendered preview for supported types.

Maximum upload size is 100 MB. Allowed MIME types are gated by the platform's stored-file allowlist.

List files

GET /api/v1/files

QueryTypeDescription
limitnumber1–100, default 50.
pagenumber1-based, default 1.
searchstringCase-insensitive name match.
parentIdstringFolder ID. Defaults to the org root.
projectIdstringWhen set, scopes listing under the project's protected folder.

Response:

{
  "success": true,
  "data": {
    "items": [ { "id": "uuid", "name": "...", "mimeType": "...", "size": 123, "..." } ],
    "page": 1,
    "limit": 50
  }
}

Upload (JSON, pre-signed URL)

POST /api/v1/files with Content-Type: application/json.

FieldTypeRequiredDescription
namestringyes (except for link source)1–255 chars, no NUL/CR/LF.
mimeTypestringyes (file uploads)Must be in the allowed MIME list.
sizeintegeryes (file uploads)0 to 100 MB.
parentIdstring | nullnoTarget folder. Validated to be inside the org root.
projectIdstringnoRoutes the upload into the project folder.
source"upload" | "folder" | "link"noDefaults to upload.
targetFileIdstringonly when source: "link"The file this link points to.

Response (201, upload):

{
  "success": true,
  "data": {
    "file": { "id": "uuid", "name": "...", "mimeType": "...", "size": 123, "storageUrl": "..." },
    "uploadUrl": "https://..."
  }
}

PUT the bytes to uploadUrl with the same Content-Type to complete the upload.

When source: "folder", the call only creates a folder record (no uploadUrl). When source: "link", a virtual link is created pointing at targetFileId; folders cannot be linked.

Upload (multipart)

POST /api/v1/files with Content-Type: multipart/form-data. Form fields: file (required), parentId, projectId. The server reads the bytes, validates size and MIME, and stores the object in one step. Returns the file record.

bash
Sign in to fill in your org and key
curl -X POST https://alumia.com/api/v1/files \
-H "Authorization: Bearer alm_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "file=@./report.pdf"

Get / download / preview

GET /api/v1/files/:id — Returns file metadata.

QueryEffect
download=trueRedirects (302) to a signed download URL.
download=true&inline=trueStreams the bytes inline with a hardened CSP and Content-Disposition: inline.

GET /api/v1/files/:id/preview returns a server-rendered preview payload for spreadsheets, documents, and text files (up to 25 MB / 512 KB text cap).

Update

PATCH /api/v1/files/:id

FieldTypeDescription
namestringRename.
parentIdstring | nullMove to a different folder (still within org root).
tagsstring[]Replace the tag list.

Protected folders cannot be renamed or moved.

Delete

DELETE /api/v1/files/:id soft-deletes the record and, if no other live file references the canonical storageKey, removes the object from storage. Protected folders return 403 FORBIDDEN.

Errors

CodeWhen
UNAUTHORIZEDNo valid key.
BAD_REQUESTMissing/oversized name, missing mimeType, disallowed MIME, oversized file, invalid parentId, invalid targetFileId, no fields to update.
FORBIDDENAttempt to rename, move, or delete a protected folder.
NOT_FOUNDFile or target file missing, soft-deleted, or in another org.