Documents

文書の変更

次の 3 つの組のうち 1 つだけを送る。組を混ぜると 400。

  • 本文:content と content_type、または edits(どちらか一方)。filename は任意。If-Match が必須(無ければ 428)

  • フォルダ:folder_id

  • ソース:source_id(同期のソースへ移すときは external_id も)

patch/knowledge/documents/{document_id}

Request

  • Base URL: https://api.leafchat.app/api/v1
  • URL: https://api.leafchat.app/api/v1/knowledge/documents/{document_id}
  • Auth: HTTP bearer

Path parameters

document_idstring required
Example:p3l8n1b6v9c2x5z7m0q4w8e1

Headers

if-matchstring
Example:"r7t2y5u8i1o4p6a9s3d0f2g5"

GET で受け取った ETag("<版の ID>")。強い比較の 1 つの値だけを受ける

Request body

contentstring
content_type'text/markdown' | 'text/plain' | 'application/json'
filenamestring
folder_idstring
source_idstring
external_idstring nullable

外部 ID は、ソースの中で一意の文字列です。UTF-8 で 512 バイトまで、Unicode の NFC にそろえ、/ で区切れます。空の区切り・.・..・区切りの前後の空白・制御文字・\ は使えません。例:faq/shipping、渋谷店/営業時間.md

Example request

{
  "external_id": "faq/shipping"
}

Response

フォルダ・ソースを変えた(文書を返す)。本文が同じで版を作らなかったときは DocumentAccepted(created: false)

OR

Example response

{
  "current_revision": {
    "created_at": "2026-09-29T02:31:07.000Z"
  },
  "head_revision": {
    "created_at": "2026-09-29T02:31:07.000Z"
  },
  "created_at": "2026-09-29T02:31:07.000Z",
  "updated_at": "2026-09-29T02:31:07.000Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.