Skip to main content
POST
/
documents
/
{document_id}
/
update_text
JavaScript
import Morphik from 'morphik';

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

const document = await client.documents.updateText('document_id', { content: 'content' });

console.log(document.app_id);
{
  "content_type": "<string>",
  "external_id": "<string>",
  "filename": "<string>",
  "metadata": {},
  "metadata_types": {},
  "storage_info": {},
  "system_metadata": {},
  "additional_metadata": {},
  "chunk_ids": [
    "<string>"
  ],
  "summary_storage_key": "<string>",
  "summary_version": 123,
  "summary_bucket": "<string>",
  "summary_updated_at": "<string>",
  "folder_name": "<string>",
  "end_user_id": "<string>",
  "app_id": "<string>",
  "folder_path": "<string>",
  "folder_id": "<string>"
}

Headers

authorization
string

Path Parameters

document_id
string
required

Body

application/json

Request model for ingesting text content

content
string
required

Raw text content to store as a document.

filename
string | null

Optional filename hint used when inferring MIME type or displaying the document.

metadata
Metadata · object

User-defined metadata stored with the document (JSON-serializable).

metadata_types
Metadata Types · object

Optional per-field type hints: 'string', 'number', 'decimal', 'datetime', 'date', 'boolean', 'array', 'object'. Enables typed comparisons with $eq, $gt, etc. Types are inferred if omitted.

use_colpali
boolean | null

When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval).

folder_name
string | null

Optional folder scope for the operation

end_user_id
string | null

Optional end-user scope for the operation

Response

Successful Response

Represents a document stored in the database documents collection

content_type
string
required
external_id
string
filename
string | null
metadata
Metadata · object
metadata_types
Metadata Types · object
storage_info
Storage Info · object
system_metadata
System Metadata · object
additional_metadata
Additional Metadata · object
chunk_ids
string[]
summary_storage_key
string | null
summary_version
integer | null
summary_bucket
string | null
summary_updated_at
string | null
folder_name
string | null
end_user_id
string | null
app_id
string | null
folder_path
string | null
folder_id
string | null