Drafts

下書きを作る

AI エージェントの用途の API キーで、ナレッジの変更の提案を作る。公開はダッシュボードで人が行う(API からは公開できない)。

operation ごとに必須の欄:create は filename・content・content_type、update は document_id と content(content_type と一緒に)か edits のどちらか一方、delete は document_id。

edits は今の本文に当てた全文として保存する。base_revision_id を渡すと、今の版と違うときに 412 になる。

evidence には、提案の根拠の会話と未回答の ID を入れる(組織に無い ID と、内部の会話の ID は 422)。公開すると根拠の未回答はアーカイブされる。

未処理の下書きは組織で 100 件まで(409 draft_limit_exceeded)。本文は 6 MiB まで。

post/knowledge/drafts

Request

  • Base URL: https://api.leafchat.app/api/v1
  • URL: https://api.leafchat.app/api/v1/knowledge/drafts
  • Auth: HTTP bearer

Request body

OR
OR

Example request

{
  "external_id": "faq/shipping"
}

Response

作った下書き

idstring required
operation'create' | 'update' | 'delete' required
state'open' | 'published' | 'discarded' required
summarystring required
rationalestring required
document_idstring nullable required

更新・削除の対象の文書。作成では null

base_revision_idstring nullable required

下書きを作ったときの、対象の文書の head の版

staleboolean required

下書きを作った後に、対象の文書が変わったか消えた。公開する人が置き換えを選ばないと公開できない

source_idstring nullable required
folder_idstring nullable required
external_idstring nullable required
filenamestring nullable required

提案のファイル名。削除では null

mimestring nullable required
sizeinteger nullable required
content_sha256string nullable required
published_document_idstring nullable required
published_revision_idstring nullable required
created_atstring date-time required
decided_atstring date-time nullable required

Example response

{
  "created_at": "2026-09-29T02:31:07.000Z",
  "decided_at": "2026-09-29T02:31:07.000Z"
}

Changes

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