> ## 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_service.json get /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks
openapi: 3.0.1
info:
  title: Dify サービス API
  description: >-
    Dify アプリケーションとナレッジベースのための REST API です。アプリケーション系エンドポイントはアプリの API
    キーで、ナレッジ系エンドポイントはナレッジベースの API キーで認証します。
  version: 1.0.0
servers:
  - url: https://{api_base_url}
    description: Dify サービス 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: アプリケーション設定と情報を取得する操作です。
  - name: アノテーション管理
    description: ダイレクト返信用のアノテーション管理に関連する操作です。
  - name: 人間の入力
    description: 人間の入力を要する一時停止中のワークフローの再開操作です。
  - name: ワークフロー実行
    description: ワークフローの実行と管理のための操作です。
  - name: 完了メッセージ
    description: テキスト生成に関連する操作です。
  - name: ナレッジベース
    description: ナレッジベースの作成、設定、取得を含むナレッジベース管理の操作です。
  - name: ドキュメント
    description: ナレッジベース内のドキュメントの作成、更新、管理のための操作です。
  - name: チャンク
    description: ドキュメントチャンクと子チャンクの管理のための操作です。
  - name: メタデータ
    description: ナレッジベースのメタデータフィールドとドキュメントメタデータ値の管理のための操作です。
  - name: タグ管理
    description: ナレッジベースタグとタグバインディングの管理のための操作です。
  - name: モデル
    description: 利用可能なモデルを取得するための操作です。
  - name: ナレッジパイプライン
    description: データソースプラグインとパイプライン実行を含むナレッジパイプラインの管理と実行のための操作です。
paths:
  /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks:
    get:
      tags:
        - チャンク
      summary: 子チャンク一覧を取得
      description: 特定の親チャンク配下の子チャンクのページネーションリストを返します。
      operationId: getChildChunks
      parameters:
        - name: dataset_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: ナレッジベース ID です。
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Document ID.
        - name: segment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Chunk ID.
        - name: page
          in: query
          schema:
            type: integer
            default: 1
            minimum: 1
          description: 取得するページ番号。
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
            minimum: 1
          description: 1 ページあたりの項目数です。サーバーの上限は `100` です。
        - name: keyword
          in: query
          schema:
            type: string
          description: 検索キーワードです。
      responses:
        '200':
          description: 子チャンクのリストです。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ChildChunk'
                    description: 子チャンクのリスト。
                  total:
                    type: integer
                    description: 子チャンクの合計数です。
                  total_pages:
                    type: integer
                    description: 合計ページ数です。
                  page:
                    type: integer
                    description: 現在のページ番号です。
                  limit:
                    type: integer
                    description: 1 ページあたりの件数です。
              examples:
                success:
                  summary: レスポンス例
                  value:
                    data:
                      - id: d7e8f9a0-1b2c-3d4e-5f6a-7b8c9d0e1f2a
                        segment_id: f3d1c7be-9f3a-40d8-8eb8-3a1ef9c3f2c1
                        content: Dify is an open-source platform.
                        position: 1
                        word_count: 6
                        type: customized
                        created_at: 1741267200
                        updated_at: 1741267200
                    total: 1
                    total_pages: 1
                    page: 1
                    limit: 20
        '403':
          description: '`forbidden` : このナレッジベースでは API アクセスが有効になっていません。'
          content:
            application/json:
              examples:
                forbidden:
                  summary: forbidden (api access)
                  value:
                    status: 403
                    code: forbidden
                    message: Dataset api access is not enabled.
        '404':
          description: |-
            - `not_found` : ナレッジベースが見つかりません。
            - `not_found` : ドキュメントが見つかりません。
            - `not_found` : チャンクが見つかりません。
          content:
            application/json:
              examples:
                not_found_1:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: Dataset not found.
                not_found_2:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: Document not found.
                not_found_3:
                  summary: not_found
                  value:
                    status: 404
                    code: not_found
                    message: Segment not found.
components:
  schemas:
    ChildChunk:
      type: object
      properties:
        id:
          type: string
          description: 子チャンクの一意識別子です。
        segment_id:
          type: string
          description: この子チャンクが属する親チャンクの ID です。
        content:
          type: string
          description: 子チャンクのテキスト内容です。
        position:
          type: integer
          description: 親チャンク内の子チャンクの位置です。
        word_count:
          type: integer
          description: 子チャンク内容の単語数です。
        type:
          type: string
          description: >-
            子チャンクの作成方法です。API から作成または更新された子チャンクは常に `customized` です。システム生成の子チャンクは
            `automatic` です。
        created_at:
          type: number
          description: 作成タイムスタンプ（Unix エポック、秒単位）です。
        updated_at:
          type: number
          description: 最終更新タイムスタンプ（Unix エポック、秒単位）です。
  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
        の漏洩は深刻な結果につながる可能性があります。**API Key が欠落または無効な場合、HTTP `401` とエラーコード
        `unauthorized` が返されます。

````