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 JSON string of container tags array. This can be an ID for your user, a project ID, or any other identifier you wish to use to group documents.

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

Example:

"image/png"

Response

Successfully uploaded file

id
string
required
status
string
required