Skip to content
Get started

Upload a file

client.documents.uploadFile(DocumentUploadFileParams { file, containerTag, containerTags, 9 more } body, RequestOptionsoptions?): DocumentUploadFileResponse { id, status }
POST/v3/documents/file

Upload a file to be processed

ParametersExpand Collapse
body: DocumentUploadFileParams { file, containerTag, containerTags, 9 more }

File to upload and process

containerTag?: string

Optional container tag (e.g., ‘user_123’). Use this for a single tag.

DeprecatedcontainerTags?: 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.

maxLength100
entityContext?: string

Optional entity context for this container tag. Max 1500 characters. Used during document processing to guide memory extraction.

maxLength1500
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.

One of the following:
"memory"
"superrag"
DeprecateduseAdvancedProcessing?: 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.

ReturnsExpand Collapse
DocumentUploadFileResponse { id, status }
id: string

Unique identifier of the document

status: string

Status of the document

Upload a file

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);
{
  "id": "id",
  "status": "status"
}
Returns Examples
{
  "id": "id",
  "status": "status"
}