> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-fix-template-upload-size-guidance.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ドキュメント内のチャンク詳細を取得

> 1 つのチャンクの詳細をすべて取得します。



## OpenAPI

````yaml /ja/api-reference/openapi_service.json get /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}
openapi: 3.0.1
info:
  description: >-
    Dify アプリケーションとナレッジベースのための REST API です。アプリケーション系エンドポイントはアプリの API
    キーで、ナレッジ系エンドポイントはナレッジベースの API キーで認証します。
  title: Dify サービス API
  version: 1.0.0
servers:
  - description: Dify サービス API のベース URL です。セルフホスト環境では、独自の API ベース URL に置き換えてください。
    url: https://{api_base_url}
    variables:
      api_base_url:
        default: api.dify.ai/v1
        description: API ベース URL のホストとパス（`https://` を除く）。
security:
  - ApiKeyAuth: []
tags:
  - 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: データソースプラグインとパイプライン実行を含むナレッジパイプラインの管理と実行のための操作です。
    name: ナレッジパイプライン
paths:
  /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}:
    get:
      tags:
        - チャンク
      summary: ドキュメント内のチャンク詳細を取得
      description: 1 つのチャンクの詳細をすべて取得します。
      operationId: getSegmentDetail
      parameters:
        - description: >-
            ナレッジベース ID
            です。[ナレッジベースリストを取得](/ja/api-reference/knowledge-bases/list-knowledge-bases)
            から取得します。
          in: path
          name: dataset_id
          required: true
          schema:
            format: uuid
            type: string
        - description: >-
            ドキュメント ID
            です。[ナレッジベースのドキュメントリストを取得](/ja/api-reference/documents/list-documents)
            から取得します。
          in: path
          name: document_id
          required: true
          schema:
            format: uuid
            type: string
        - description: >-
            チャンク ID です。[チャンク一覧を取得](/ja/api-reference/chunks/list-chunks)
            から取得します。
          in: path
          name: segment_id
          required: true
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                success:
                  summary: レスポンス例
                  value:
                    data:
                      answer: ''
                      attachments: []
                      child_chunks: []
                      completed_at: 1741267200
                      content: Dify is an open-source LLM app development platform.
                      created_at: 1741267200
                      created_by: ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4
                      disabled_at: null
                      disabled_by: null
                      document_id: a8e0e5b5-78c6-4130-a5ce-25feb0e0b4ac
                      enabled: true
                      error: null
                      hit_count: 0
                      id: f3d1c7be-9f3a-40d8-8eb8-3a1ef9c3f2c1
                      index_node_hash: abc123def456
                      index_node_id: a1b2c3d4-e5f6-7890-abcd-000000000001
                      indexing_at: 1741267200
                      keywords:
                        - dify
                        - platform
                        - llm
                      position: 1
                      sign_content: ''
                      status: completed
                      stopped_at: null
                      summary: null
                      tokens: 12
                      updated_at: 1741267200
                      updated_by: ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4
                      word_count: 9
                    doc_form: text_model
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Segment'
                  doc_form:
                    description: このドキュメントが使用するドキュメントチャンキングモードです。
                    type: string
                type: object
          description: チャンクの詳細です。
        '400':
          content:
            application/json:
              examples:
                invalid_param:
                  summary: invalid_param
                  value:
                    code: invalid_param
                    message: >-
                      No Embedding Model available. Please configure a valid
                      provider in the Settings -> Model Provider.
                    status: 400
          description: >-
            `invalid_param` :
            ナレッジベースは高品質インデックスを使用していますが、埋め込みモデルが未設定または誤って設定されています。
        '403':
          content:
            application/json:
              examples:
                forbidden:
                  summary: forbidden (api access)
                  value:
                    code: forbidden
                    message: Dataset api access is not enabled.
                    status: 403
          description: '`forbidden` : このナレッジベースでは API アクセスが有効になっていません。'
        '404':
          content:
            application/json:
              examples:
                not_found_1:
                  summary: not_found
                  value:
                    code: not_found
                    message: Dataset not found.
                    status: 404
                not_found_2:
                  summary: not_found
                  value:
                    code: not_found
                    message: Document not found.
                    status: 404
                not_found_3:
                  summary: not_found
                  value:
                    code: not_found
                    message: Segment not found.
                    status: 404
          description: |-
            - `not_found` : ナレッジベースが見つかりません。
            - `not_found` : ドキュメントが見つかりません。
            - `not_found` : チャンクが見つかりません。
components:
  schemas:
    Segment:
      properties:
        answer:
          description: 回答コンテンツです。Q&A モードのドキュメントで使用されます。
          type: string
        attachments:
          description: このチャンクに添付されたファイルです。
          items:
            properties:
              extension:
                description: ファイル拡張子。
                type: string
              id:
                description: 添付ファイルの識別子です。
                type: string
              mime_type:
                description: ファイルの MIME タイプ。
                type: string
              name:
                description: 元のファイル名です。
                type: string
              size:
                description: ファイルサイズ（バイト）。
                type: integer
              source_url:
                description: 添付ファイルにアクセスする URL です。
                type: string
            type: object
          type: array
        child_chunks:
          description: このチャンクに属する子チャンクです。階層モードのドキュメントにのみ存在します。
          items:
            $ref: '#/components/schemas/ChildChunk'
          type: array
        completed_at:
          description: インデックス作成が完了したタイムスタンプです。まだ完了していない場合は `null` です。
          nullable: true
          type: number
        content:
          description: チャンクのテキスト内容です。
          type: string
        created_at:
          description: 作成タイムスタンプ（Unix エポック、秒単位）です。
          type: number
        created_by:
          description: チャンクを作成したユーザーの ID です。
          type: string
        disabled_at:
          description: チャンクが無効化されたタイムスタンプです。有効な場合は `null` です。
          nullable: true
          type: number
        disabled_by:
          description: チャンクを無効化したユーザーの ID です。有効な場合は `null` です。
          nullable: true
          type: string
        document_id:
          description: このチャンクが属するドキュメントの ID です。
          type: string
        enabled:
          description: このチャンクが検索に対して有効かどうかです。
          type: boolean
        error:
          description: インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。
          nullable: true
          type: string
        hit_count:
          description: このチャンクが検索クエリでマッチした回数です。
          type: integer
        id:
          description: チャンクの一意識別子です。
          type: string
        index_node_hash:
          description: インデックスされたコンテンツのハッシュです。変更の検出に使用されます。
          type: string
        index_node_id:
          description: ベクトルストア内のインデックスノードの ID です。
          type: string
        indexing_at:
          description: インデックス作成が開始されたタイムスタンプです。まだ開始されていない場合は `null` です。
          nullable: true
          type: number
        keywords:
          description: キーワードベースの検索のためにこのチャンクに関連付けられたキーワードです。
          items:
            type: string
          type: array
        position:
          description: ドキュメント内のチャンクの位置。
          type: integer
        sign_content:
          description: 整合性検証用の署名付きコンテンツハッシュです。
          type: string
        status:
          description: チャンクの現在のインデックスステータスです（例：`completed`、`indexing`、`error`）。
          type: string
        stopped_at:
          description: インデックス作成が停止されたタイムスタンプです。停止されていない場合は `null` です。
          nullable: true
          type: number
        summary:
          description: AI が生成したチャンクコンテンツの要約です。要約インデックスが有効でない場合は `null` です。
          nullable: true
          type: string
        tokens:
          description: チャンク内容のトークン数です。
          type: integer
        updated_at:
          description: 最終更新タイムスタンプ（Unix エポック、秒単位）です。
          type: number
        updated_by:
          description: このチャンクを最後に更新したユーザーの ID です。
          type: string
        word_count:
          description: チャンク内容の単語数です。
          type: integer
      type: object
    ChildChunk:
      properties:
        content:
          description: 子チャンクのテキスト内容です。
          type: string
        created_at:
          description: 作成タイムスタンプ（Unix エポック、秒単位）です。
          type: number
        id:
          description: 子チャンクの一意識別子です。
          type: string
        position:
          description: 親チャンク内の子チャンクの位置です。
          type: integer
        segment_id:
          description: この子チャンクが属する親チャンクの ID です。
          type: string
        type:
          description: >-
            子チャンクの作成方法です。API から作成または更新された子チャンクは常に `customized` です。システム生成の子チャンクは
            `automatic` です。
          type: string
        updated_at:
          description: 最終更新タイムスタンプ（Unix エポック、秒単位）です。
          type: number
        word_count:
          description: 子チャンク内容の単語数です。
          type: integer
      type: object
  securitySchemes:
    ApiKeyAuth:
      bearerFormat: API_KEY
      description: >-
        すべてのリクエストは API キーで認証します：`Authorization: Bearer
        {API_KEY}`。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API
        キーを使用します（[Dify API クイックスタート](/ja/api-reference/guides/get-started)）。


        キーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーが欠落または無効なリクエストは HTTP
        `401`（`unauthorized`）で失敗します。
      scheme: bearer
      type: http

````