---
title: "Replace document content and re-index"
method: PUT
path: "/api/v1/knowledge-base/documents/{document_uuid}/content"
tags: ["main", "knowledge-base"]
---

# Replace document content and re-index

`PUT /api/v1/knowledge-base/documents/{document_uuid}/content`

## Request

- Base URL: `https://app.dograh.com`
- URL: `https://app.dograh.com/api/v1/knowledge-base/documents/{document_uuid}/content`
- Auth: none declared

Replace the text of a .txt or .md document and re-process it.

The stored file is overwritten and the document is re-indexed in the
background. Agents keep using the previous version until that succeeds.

Access Control:
* Users can only edit documents from their organization.

## Path parameters

- `document_uuid` string, required

## Headers

- `authorization` string, nullable
- `X-API-Key` string, nullable

## Request body

- DocumentContentUpdateRequestSchema: Request schema for replacing an editable document's text.
  - `content` string, required: New full text of the document
  - `expected_file_hash` string, required: file_hash returned when the content was loaded. The save is rejected if the document has changed since.

## Response `200`

Successful Response

- DocumentResponseSchema: Response schema for document metadata.
  - `id` integer, required
  - `document_uuid` string, required
  - `filename` string, required
  - `file_size_bytes` integer, required
  - `file_hash` string, required
  - `mime_type` string, required
  - `processing_status` string, required
  - `processing_error` string, nullable
  - `total_chunks` integer, required
  - `retrieval_mode` string
  - `custom_metadata` object, required
  - `docling_metadata` object, required
  - `source_url` string, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `organization_id` integer, required
  - `created_by` integer, required
  - `is_active` boolean, required
  - `has_live_content` boolean: Whether agents can currently retrieve this document's content. Stays true while an edited document is re-indexed or after its re-index fails, because the previous version keeps serving until a new one succeeds.

## Other responses

- `404`: Not found
- `422`: Validation Error

## Changes

- **2026-11-03** `faa00cf76fcb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/dograh/apis/dograh-api/changes/api/v1/knowledge-base/documents/:document_uuid/content/put.md)

---

[API](https://skmtc.dev/dograh/apis/dograh-api.md) - [All operations](https://skmtc.dev/dograh/apis/dograh-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dograh/apis/dograh-api/revisions/faa00cf76fcb?raw)
