---
title: "Update a knowledge base document"
method: PATCH
path: "/companies/{company}/knowledge-base/documents/{documentId}"
tags: ["Knowledge Base"]
---

# Update a knowledge base document

`PATCH /companies/{company}/knowledge-base/documents/{documentId}`

## Path parameters

- `company` integer, required
- `documentId` integer, required

## Request body

- object
  - `name` string — The new name for the document
  - `text` string — New content for text documents (recreates the upstream document)
  - `items` object[] — New items for json_array documents (recreates the upstream document with re-rendered Markdown)
  - `identifierKey` string, nullable — Stable identifier for the document. Pass null to clear.

## Response `200`

Successful response

- AppHttpResourcesApiKnowledgeBaseDocumentResource — unresolved $ref

## Other responses

- `404` — Document not found
- `422` — Validation error

---

[API](https://skmtc.dev/800/apis/public-api.md) · [All operations](https://skmtc.dev/800/apis/public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/800/public-api/revisions/aab9efc97342/schema)
