ナレッジパイプライン
パイプラインを実行
1 つ以上のデータソースに対して完全なナレッジパイプラインを実行します。response_mode でストリーミングまたはブロッキングのレスポンスを選択します。
POST
/
datasets
/
{dataset_id}
/
pipeline
/
run
curl --request POST \
--url https://{api_base_url}/datasets/{dataset_id}/pipeline/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"datasource_info_list": [
{
"name": "quarterly-report.pdf",
"reference": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
],
"datasource_type": "local_file",
"inputs": {},
"is_published": true,
"response_mode": "blocking",
"start_node_id": "1719288585006"
}
'{
"data": {
"created_at": 1741267200,
"finished_at": 1741267210,
"id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321",
"outputs": {},
"status": "succeeded"
},
"task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"workflow_run_id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321"
}Authorizations
すべてのリクエストは、Authorization: Bearer {API_KEY} ヘッダーに指定した API キーで認証します。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API キーを使用します(Dify API クイックスタート)。
キーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーがない、または無効な場合は HTTP 401(unauthorized)が返ります。
Path Parameters
ナレッジベース ID。ナレッジベースリストを取得 で取得します。スコープを限定したキーでは、Dify の URL から ID をコピー してください。
Body
application/json
Response
パイプライン実行結果。フォーマットは response_mode に依存します:ストリーミングは text/event-stream を返し、ブロッキングは完全な JSON 結果を返します。
パイプライン実行の完全な結果です。response_mode が blocking の場合に返されます。
Was this page helpful?
⌘I
curl --request POST \
--url https://{api_base_url}/datasets/{dataset_id}/pipeline/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"datasource_info_list": [
{
"name": "quarterly-report.pdf",
"reference": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
],
"datasource_type": "local_file",
"inputs": {},
"is_published": true,
"response_mode": "blocking",
"start_node_id": "1719288585006"
}
'{
"data": {
"created_at": 1741267200,
"finished_at": 1741267210,
"id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321",
"outputs": {},
"status": "succeeded"
},
"task_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"workflow_run_id": "f1e2d3c4-b5a6-7890-abcd-ef0987654321"
}