---
title: "Update Document Text"
method: POST
path: "/documents/{document_id}/update_text"
tags: ["Documents"]
---

# Update Document Text

`POST /documents/{document_id}/update_text`

Update a document by replacing its text content and queueing re-ingestion.

## Path parameters

- `document_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- IngestTextRequest — Request model for ingesting text content
  - `content` string, required — Raw text content to store as a document.
  - `filename` string, nullable — Optional filename hint used when inferring MIME type or displaying the document.
  - `metadata` object — User-defined metadata stored with the document (JSON-serializable).
  - `metadata_types` object, nullable — 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, nullable — When provided, uses Morphik's finetuned ColPali style embeddings (recommended to be True for high quality retrieval).
  - `folder_name` string, nullable — Optional folder scope for the operation
  - `end_user_id` string, nullable — Optional end-user scope for the operation

## Response `200`

Successful Response

- Document — Represents a document stored in the database documents collection
  - `external_id` string
  - `content_type` string, required
  - `filename` string, nullable
  - `metadata` object
  - `metadata_types` object
  - `storage_info` object
  - `system_metadata` object
  - `additional_metadata` object
  - `chunk_ids` string[]
  - `summary_storage_key` string, nullable
  - `summary_version` integer, nullable
  - `summary_bucket` string, nullable
  - `summary_updated_at` string, nullable
  - `folder_name` string, nullable
  - `end_user_id` string, nullable
  - `app_id` string, nullable
  - `folder_path` string, nullable
  - `folder_id` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/morphik-org/apis/fastapi.md) · [All operations](https://skmtc.net/morphik-org/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/morphik-org/fastapi/versions/2d9291c3821d/schema)
