Skip to content
Get started

Update document

client.documents.update(stringid, DocumentUpdateParams { containerTag, containerTags, content, 5 more } body, RequestOptionsoptions?): DocumentUpdateResponse { id, status }
PATCH/v3/documents/{id}

Update a document with any content type (text, url, file, etc.) and metadata

ParametersExpand Collapse
id: string
body: DocumentUpdateParams { containerTag, containerTags, content, 5 more }
containerTag?: string

Optional tag this document should be containerized by. This can be an ID for your user, a project ID, or any other identifier you wish to use to group documents.

maxLength100
DeprecatedcontainerTags?: Array<string>

(DEPRECATED: Use containerTag instead) Optional tags this document should be containerized by. This can be an ID for your user, a project ID, or any other identifier you wish to use to group documents.

content?: string

The content to extract and process into a document. This can be a URL to a website, a PDF, an image, or a video.

Plaintext: Any plaintext format

URL: A URL to a website, PDF, image, or video

We automatically detect the content type from the url’s response format.

customId?: string

Optional custom ID of the document. This could be an ID from your database that will uniquely identify this document.

filepath?: string

Optional file path for the document (e.g., ‘/documents/reports/file.pdf’). Used by supermemoryfs to map documents to filesystem paths.

filterByMetadata?: Record<string, string | number | boolean | Array<string>>

Optional metadata filter scoping which existing memories are pulled as context during ingestion. Scalar values match exactly (AND across keys); array values match ANY (OR within key). Only memories whose source documents match this filter are used as context.

One of the following:
string
number
boolean
Array<string>
metadata?: Record<string, string | number | boolean | Array<string>>

Optional metadata for the document. This is used to store additional information about the document. You can use this to store any additional information you need about the document. Metadata can be filtered through. Keys must be strings and are case sensitive. Values can be strings, numbers, or booleans. You cannot nest objects.

One of the following:
string
number
boolean
Array<string>
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"
ReturnsExpand Collapse
DocumentUpdateResponse { id, status }
id: string

Unique identifier of the document

status: string

Status of the document

Update document

import Supermemory from 'supermemory';

const client = new Supermemory({
  apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted
});

const document = await client.documents.update('id');

console.log(document.id);
{
  "id": "id",
  "status": "status"
}
Returns Examples
{
  "id": "id",
  "status": "status"
}