Skip to main content
POST
/
v3
/
documents
/
file
Upload a file
const url = 'https://api.supermemory.ai/v3/documents/file';
const form = new FormData();
form.append('file', '{}');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "id": "<string>",
  "status": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data

File upload form data schema

file
file
required

File to upload and process

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.

Example:

"[\"user_123\", \"project_123\"]"

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

Example:

"image"

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')

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.

Example:

"{\"category\": \"technology\", \"isPublic\": true, \"readingTime\": 5}"

Response

Successfully uploaded file

id
string
required
status
string
required
I