---
title: "Replace Document Route"
method: PUT
path: "/api/v1/knowledge/documents/{doc_id}"
tags: ["knowledge"]
---

# Replace Document Route

`PUT /api/v1/knowledge/documents/{doc_id}`

Replace an existing knowledge document (atomic backup/restore on failure).

## Path parameters

- `doc_id` string, required

## Response `200`

Successful Response

- SuccessEnvelopeDocumentCreateResponse
  - `request_id` string, required
  - `data` DocumentCreateResponse, required — Response for POST/PUT /documents.
    - `doc_id` string, required
    - `category_id` string, required
    - `topic_count` integer, required
    - `source_name` string, nullable, required
    - `md_path` string, required
    - `original_file_path` string, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/evermind-ai/apis/everos.md) · [All operations](https://skmtc.net/evermind-ai/apis/everos/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/evermind-ai/everos/versions/67efe20bff24/schema)
