メインコンテンツへスキップ
POST
/
datasets
/
{dataset_id}
/
document
/
create-by-file
Error
A valid request URL is required to generate request examples
{ "document": { "id": "a8e0e5b5-78c6-4130-a5ce-25feb0e0b4ac", "position": 1, "data_source_type": "upload_file", "data_source_info": { "upload_file_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, "data_source_detail_dict": { "upload_file": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "guide.txt", "size": 2048, "extension": "txt", "mime_type": "text/plain", "created_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4", "created_at": 1741267200 } }, "dataset_process_rule_id": "e1f2a3b4-c5d6-7890-ef12-345678901234", "name": "guide.txt", "created_from": "api", "created_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4", "created_at": 1741267200, "tokens": 0, "indexing_status": "indexing", "error": null, "enabled": true, "disabled_at": null, "disabled_by": null, "archived": false, "display_status": "indexing", "word_count": 0, "hit_count": 0, "doc_form": "text_model", "doc_metadata": [], "summary_index_status": null, "need_summary": false }, "batch": "20250306150245647595" }

Documentation Index

Fetch the complete documentation index at: https://dify-6c0370d8-docs-sync-pr-768.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

承認

Authorization
string
header
必須

API Key 認証です。すべての API リクエストにおいて、Authorization HTTP ヘッダーに Bearer プレフィックスを付けた API Key を含めてください。例:Authorization: Bearer {API_KEY}API Key はサーバーサイドに保存し、クライアントサイドで共有・保存しないことを強く推奨します。API Key の漏洩は深刻な結果につながる可能性があります。

パスパラメータ

dataset_id
string<uuid>
必須

ナレッジベース ID です。

ボディ

multipart/form-data
file
file
必須

アップロードするファイルです。

data
string

設定情報を含む JSON 文字列です。テキストからドキュメントを作成 と同じフィールド(indexing_techniquedoc_formdoc_languageprocess_ruleretrieval_modelembedding_modelembedding_model_provider)を受け付けますが、nametext は除きます。

:

"{\"indexing_technique\":\"high_quality\",\"doc_form\":\"text_model\",\"doc_language\":\"English\",\"process_rule\":{\"mode\":\"automatic\"}}"

レスポンス

ドキュメントが正常に作成されました。

document
object
batch
string

インデックス進捗を追跡するためのバッチ ID です。