> ## 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/{document_id}/segments/{segment_id}
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/{document_id}/segments/{segment_id}:
    get:
      tags:
        - チャンク
      summary: ドキュメント内のチャンク詳細を取得
      description: 特定のチャンクの詳細情報（内容、キーワード、インデックスステータスを含む）を取得します。
      operationId: getSegmentDetail
      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.
      responses:
        '200':
          description: チャンクの詳細です。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Segment'
                  doc_form:
                    type: string
                    description: このドキュメントが使用するドキュメントチャンキングモードです。
              examples:
                success:
                  summary: レスポンス例
                  value:
                    data:
                      id: f3d1c7be-9f3a-40d8-8eb8-3a1ef9c3f2c1
                      position: 1
                      document_id: a8e0e5b5-78c6-4130-a5ce-25feb0e0b4ac
                      content: Dify is an open-source LLM app development platform.
                      sign_content: ''
                      answer: ''
                      word_count: 9
                      tokens: 12
                      keywords:
                        - dify
                        - platform
                        - llm
                      index_node_id: a1b2c3d4-e5f6-7890-abcd-000000000001
                      index_node_hash: abc123def456
                      hit_count: 0
                      enabled: true
                      disabled_at: null
                      disabled_by: null
                      status: completed
                      created_by: ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4
                      created_at: 1741267200
                      updated_at: 1741267200
                      updated_by: ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4
                      indexing_at: 1741267200
                      completed_at: 1741267200
                      error: null
                      stopped_at: null
                      child_chunks: []
                      attachments: []
                      summary: null
                    doc_form: text_model
components:
  schemas:
    Segment:
      type: object
      properties:
        id:
          type: string
          description: チャンクの一意識別子です。
        position:
          type: integer
          description: ドキュメント内のチャンクの位置。
        document_id:
          type: string
          description: このチャンクが属するドキュメントの ID です。
        content:
          type: string
          description: チャンクのテキスト内容です。
        sign_content:
          type: string
          description: 整合性検証用の署名付きコンテンツハッシュです。
        answer:
          type: string
          description: 回答コンテンツです。Q&A モードのドキュメントで使用されます。
        word_count:
          type: integer
          description: チャンク内容の単語数です。
        tokens:
          type: integer
          description: チャンク内容のトークン数です。
        keywords:
          type: array
          description: キーワードベースの検索のためにこのチャンクに関連付けられたキーワードです。
          items:
            type: string
        index_node_id:
          type: string
          description: ベクトルストア内のインデックスノードの ID です。
        index_node_hash:
          type: string
          description: インデックスされたコンテンツのハッシュです。変更の検出に使用されます。
        hit_count:
          type: integer
          description: このチャンクが検索クエリでマッチした回数です。
        enabled:
          type: boolean
          description: このチャンクが検索に対して有効かどうかです。
        disabled_at:
          type: number
          nullable: true
          description: チャンクが無効化されたタイムスタンプです。有効な場合は `null` です。
        disabled_by:
          type: string
          nullable: true
          description: チャンクを無効化したユーザーの ID です。有効な場合は `null` です。
        status:
          type: string
          description: チャンクの現在のインデックスステータスです（例：`completed`、`indexing`、`error`）。
        created_by:
          type: string
          description: チャンクを作成したユーザーの ID です。
        created_at:
          type: number
          description: 作成タイムスタンプ（Unix エポック、秒単位）です。
        updated_at:
          type: number
          description: 最終更新タイムスタンプ（Unix エポック、秒単位）です。
        updated_by:
          type: string
          description: このチャンクを最後に更新したユーザーの ID です。
        indexing_at:
          type: number
          nullable: true
          description: インデックス作成が開始されたタイムスタンプです。まだ開始されていない場合は `null` です。
        completed_at:
          type: number
          nullable: true
          description: インデックス作成が完了したタイムスタンプです。まだ完了していない場合は `null` です。
        error:
          type: string
          nullable: true
          description: インデックス作成が失敗した場合のエラーメッセージです。エラーなしの場合は `null` です。
        stopped_at:
          type: number
          nullable: true
          description: インデックス作成が停止されたタイムスタンプです。停止されていない場合は `null` です。
        child_chunks:
          type: array
          description: このチャンクに属する子チャンクです。階層モードのドキュメントにのみ存在します。
          items:
            $ref: '#/components/schemas/ChildChunk'
        attachments:
          type: array
          description: このチャンクに添付されたファイルです。
          items:
            type: object
            properties:
              id:
                type: string
                description: 添付ファイルの識別子です。
              name:
                type: string
                description: 元のファイル名です。
              size:
                type: integer
                description: ファイルサイズ（バイト）。
              extension:
                type: string
                description: ファイル拡張子。
              mime_type:
                type: string
                description: ファイルの MIME タイプ。
              source_url:
                type: string
                description: 添付ファイルにアクセスする URL です。
        summary:
          type: string
          nullable: true
          description: AI が生成したチャンクコンテンツの要約です。要約インデックスが有効でない場合は `null` です。
    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: 子チャンクの作成方法です。システム生成の場合は `automatic`、手動作成の場合は `custom` です。
        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
        の漏洩は深刻な結果につながる可能性があります。**

````