> ## 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 /zh/api-reference/openapi_knowledge.json get /datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}/child_chunks
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}/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: 文档 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: 每页的项目数量。服务器上限为 `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: 每页条目数。
              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: automatic
                        created_at: 1741267200
                        updated_at: 1741267200
                    total: 1
                    total_pages: 1
                    page: 1
                    limit: 20
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: 子分段的创建方式。系统生成为 `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 头中包含您的 API Key，并加上
        `Bearer ` 前缀。示例：`Authorization: Bearer {API_KEY}`。**强烈建议将 API Key
        存储在服务端，不要在客户端共享或存储，以避免 API Key 泄漏导致严重后果。**

````