## Upload a file `client.documents.uploadFile(DocumentUploadFileParamsbody, RequestOptionsoptions?): DocumentUploadFileResponse` **post** `/v3/documents/file` Upload a file to be processed ### Parameters - `body: DocumentUploadFileParams` - `file: Uploadable` File to upload and process - `containerTag?: string` Optional container tag (e.g., 'user_123'). Use this for a single tag. - `containerTags?: string` Optional container tags. Can be either a JSON string of an array (e.g., '["user_123", "project_123"]') or a single string (e.g., 'user_123'). Single strings will be automatically converted to an array. - `customId?: string` Optional custom ID of the document. Max 100 characters, alphanumeric with hyphens, underscores, and colons only. - `entityContext?: string` Optional entity context for this container tag. Max 1500 characters. Used during document processing to guide memory extraction. - `filepath?: string` Optional file path for the uploaded file (e.g., '/documents/reports/file.pdf'). Used by supermemoryfs to map documents to filesystem paths. - `fileType?: string` Optional file type override to force specific processing behavior. Valid values: text, pdf, tweet, google_doc, google_slide, google_sheet, image, video, notion_doc, webpage, onedrive - `filterByMetadata?: string` Optional metadata filter as a JSON string. Scopes which existing memories are pulled as context during ingestion. Scalar values match exactly (AND across keys); array values match ANY (OR within key). - `metadata?: string` Optional metadata for the document as a JSON string. This is used to store additional information about the document. Keys must be strings and values can be strings, numbers, or booleans. - `mimeType?: string` Required when fileType is 'image' or 'video'. Specifies the exact MIME type to use (e.g., 'image/png', 'image/jpeg', 'video/mp4', 'video/webm') - `taskType?: "memory" | "superrag"` Task type: "memory" (default) for full context layer with SuperRAG built in, "superrag" for managed RAG as a service. - `"memory"` - `"superrag"` - `useAdvancedProcessing?: string` DEPRECATED: This field is no longer used. Advanced PDF processing is now automatic with our hybrid Mistral OCR + Gemini pipeline. This parameter will be accepted but ignored for backwards compatibility. ### Returns - `DocumentUploadFileResponse` - `id: string` Unique identifier of the document - `status: string` Status of the document ### Example ```typescript import fs from 'fs'; import Supermemory from 'supermemory'; const client = new Supermemory({ apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted }); const response = await client.documents.uploadFile({ file: fs.createReadStream('path/to/file') }); console.log(response.id); ``` #### Response ```json { "id": "id", "status": "status" } ```