> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ナレッジベースのドキュメントリストを取得

> ナレッジベース内のドキュメントのページネーションされた一覧を返します。キーワードやインデックスステータスによるフィルタリングをサポートしています。



## OpenAPI

````yaml /ja/api-reference/openapi_knowledge.json get /datasets/{dataset_id}/documents
openapi: 3.0.1
info:
  title: ナレッジAPI
  description: >-
    ナレッジベース、ドキュメント、チャンク、メタデータ、タグの管理（作成、取得、設定を含む）のための API です。**注意：**単一のナレッジベース
    API キーは、同じアカウント配下のすべての可視ナレッジベースを操作する権限を持ちます。データセキュリティにご注意ください。
  version: 1.0.0
servers:
  - url: https://{api_base_url}
    description: Knowledge API のベース URL です。セルフホスト環境では、独自の API ベース URL に置き換えてください。
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API ベース URL のホストとパス（`https://` を除く）。
security:
  - ApiKeyAuth: []
tags:
  - name: データセット
    description: ナレッジベースの作成、設定、取得を含むナレッジベース管理の操作です。
  - name: ドキュメント
    description: ナレッジベース内のドキュメントの作成、更新、管理のための操作です。
  - name: チャンク
    description: ドキュメントチャンクと子チャンクの管理のための操作です。
  - name: メタデータ
    description: ナレッジベースのメタデータフィールドとドキュメントメタデータ値の管理のための操作です。
  - name: タグ管理
    description: ナレッジベースタグとタグバインディングの管理のための操作です。
  - name: モデル
    description: 利用可能なモデルを取得するための操作です。
  - name: ナレッジパイプライン
    description: データソースプラグインとパイプライン実行を含むナレッジパイプラインの管理と実行のための操作です。
paths:
  /datasets/{dataset_id}/documents:
    get:
      tags:
        - ドキュメント
      summary: ナレッジベースのドキュメントリストを取得
      description: >-
        ナレッジベース内のドキュメントのページネーションされた一覧を返します。キーワードやインデックスステータスによるフィルタリングをサポートしています。
      operationId: listDocuments
      parameters:
        - name: dataset_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: ナレッジベース ID です。
        - name: page
          in: query
          schema:
            type: integer
            default: 1
          description: 取得するページ番号。
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
          description: 1 ページあたりの項目数です。サーバーの上限は `100` です。
        - name: keyword
          in: query
          schema:
            type: string
          description: ドキュメント名でフィルタリングするための検索キーワードです。
        - name: status
          in: query
          schema:
            type: string
            enum:
              - queuing
              - indexing
              - paused
              - error
              - available
              - disabled
              - archived
          description: 表示ステータスでフィルタリングします。
      responses:
        '200':
          description: ドキュメントのリストです。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    description: ナレッジベースオブジェクトの配列です。
                    items:
                      $ref: '#/components/schemas/Document'
                  has_more:
                    type: boolean
                    description: 次のページにさらに項目が存在するかどうかです。
                  limit:
                    type: integer
                    description: 1 ページあたりの件数です。
                  total:
                    type: integer
                    description: 一致する項目の合計数です。
                  page:
                    type: integer
                    description: 現在のページ番号です。
              examples:
                success:
                  summary: レスポンス例
                  value:
                    data:
                      - 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: 512
                        indexing_status: completed
                        error: null
                        enabled: true
                        disabled_at: null
                        disabled_by: null
                        archived: false
                        display_status: available
                        word_count: 350
                        hit_count: 0
                        doc_form: text_model
                        doc_metadata: []
                        summary_index_status: null
                        need_summary: false
                    has_more: false
                    limit: 20
                    total: 1
                    page: 1
        '404':
          description: '`not_found` : ナレッジベースが見つかりません。'
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: Dataset not found.
components:
  schemas:
    Document:
      type: object
      properties:
        id:
          type: string
          description: ドキュメントの一意識別子です。
        position:
          type: integer
          description: リスト内のドキュメントの表示位置です。
        data_source_type:
          type: string
          description: >-
            ドキュメントの作成方法です。ファイルアップロードの場合は `upload_file`、Notion インポートの場合は
            `notion_import` です。
        data_source_info:
          type: object
          description: 生のデータソース情報です。`data_source_type` によって異なります。
        data_source_detail_dict:
          type: object
          description: ファイル詳細を含む詳細なデータソース情報です。
        dataset_process_rule_id:
          type: string
          description: このドキュメントに適用された処理ルールの ID です。
        name:
          type: string
          description: ドキュメント名です。
        created_from:
          type: string
          description: ドキュメントの作成元です。API で作成した場合は `api`、UI で作成した場合は `web` です。
        created_by:
          type: string
          description: ドキュメントを作成したユーザーの ID です。
        created_at:
          type: number
          description: 作成タイムスタンプ（Unix エポック、秒単位）です。
        tokens:
          type: integer
          description: ドキュメント内の合計トークン数です。
        indexing_status:
          type: string
          description: >-
            現在のインデックスステータスです。`waiting` はキュー待ち、`parsing` はコンテンツ抽出中、`cleaning`
            はノイズ除去中、`splitting` はチャンキング中、`indexing` はベクトル構築中、`completed`
            は準備完了、`error` は失敗、`paused` は手動一時停止を示します。
        error:
          type: string
          nullable: true
          description: インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。
        enabled:
          type: boolean
          description: このドキュメントが検索に対して有効かどうかです。
        disabled_at:
          type: number
          nullable: true
          description: ドキュメントが無効化されたタイムスタンプです。有効な場合は `null` です。
        disabled_by:
          type: string
          nullable: true
          description: ドキュメントを無効化したユーザーの ID です。有効な場合は `null` です。
        archived:
          type: boolean
          description: ドキュメントがアーカイブ済みかどうかです。
        display_status:
          type: string
          description: '`indexing_status` と `enabled` 状態から導出されたユーザー向け表示ステータスです。'
        word_count:
          type: integer
          description: ドキュメントの合計単語数です。
        hit_count:
          type: integer
          description: ドキュメントが検索クエリでマッチした回数です。
        doc_form:
          type: string
          description: >-
            ドキュメントのチャンキングモードです。`text_model` は標準テキストチャンキング、`hierarchical_model`
            は親子構造、`qa_model` は QA ペア抽出を示します。
        doc_metadata:
          type: array
          description: このドキュメントに割り当てられたメタデータ値です。
          items:
            type: object
            properties:
              id:
                type: string
                description: メタデータフィールドの識別子です。
              name:
                type: string
                description: メタデータフィールド名です。
              type:
                type: string
                description: メタデータフィールドの値の種類です。
              value:
                type: string
                description: このドキュメントのメタデータ値。
        summary_index_status:
          type: string
          nullable: true
          description: このドキュメントの要約インデックスのステータスです。要約インデックスが設定されていない場合は `null` です。
        need_summary:
          type: boolean
          description: このドキュメントに要約を生成する必要があるかどうかです。
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API_KEY
      description: >-
        API Key 認証です。すべての API リクエストにおいて、`Authorization` HTTP ヘッダーに `Bearer `
        プレフィックスを付けた API Key を含めてください。例：`Authorization: Bearer {API_KEY}`。**API
        Key はサーバーサイドに保存し、クライアントサイドで共有・保存しないことを強く推奨します。API Key
        の漏洩は深刻な結果につながる可能性があります。**

````