---
title: "List Chunks"
method: GET
path: "/datasets/{dataset_id}/documents/{document_id}/segments"
tags: ["Chunks"]
---

# List Chunks

`GET /datasets/{dataset_id}/documents/{document_id}/segments`

Returns a paginated list of chunks within a document, optionally filtered by keyword or indexing status.

## Path parameters

- `dataset_id` string, uuid, required
- `document_id` string, uuid, required

## Query parameters

- `page` integer
- `limit` integer
- `status` string[]
- `keyword` string

## Response `200`

List of chunks.

- object
  - `data` Segment[] — List of chunks.
    - `id` string — Unique identifier of the chunk.
    - `position` integer — Position of the chunk within the document.
    - `document_id` string — ID of the document this chunk belongs to.
    - `content` string — Text content of the chunk.
    - `sign_content` string — Signed content hash for integrity verification.
    - `answer` string — Answer content, used in Q&A mode documents.
    - `word_count` integer — Word count of the chunk content.
    - `tokens` integer — Token count of the chunk content.
    - `keywords` string[] — Keywords associated with this chunk for keyword-based retrieval.
    - `index_node_id` string — ID of the index node in the vector store.
    - `index_node_hash` string — Hash of the indexed content, used to detect changes.
    - `hit_count` integer — Number of times this chunk has been matched in retrieval queries.
    - `enabled` boolean — Whether the chunk is enabled for retrieval.
    - `disabled_at` number, nullable — Timestamp when the chunk was disabled. `null` if enabled.
    - `disabled_by` string, nullable — ID of the user who disabled the chunk. `null` if enabled.
    - `status` string — Current indexing status of the chunk, e.g. `completed`, `indexing`, `error`.
    - `created_by` string — ID of the user who created the chunk.
    - `created_at` number — Creation timestamp (Unix epoch in seconds).
    - `updated_at` number — Last update timestamp (Unix epoch in seconds).
    - `updated_by` string — ID of the user who last updated the chunk.
    - `indexing_at` number, nullable — Timestamp when indexing started. `null` if not yet started.
    - `completed_at` number, nullable — Timestamp when indexing completed. `null` if not yet completed.
    - `error` string, nullable — Error message if indexing failed. `null` when no error.
    - `stopped_at` number, nullable — Timestamp when indexing was stopped. `null` if not stopped.
    - `child_chunks` ChildChunk[] — Child chunks belonging to this chunk. Only present for hierarchical mode documents.
      - `id` string — Unique identifier of the child chunk.
      - `segment_id` string — ID of the parent chunk this child chunk belongs to.
      - `content` string — Text content of the child chunk.
      - `position` integer — Position of the child chunk within the parent chunk.
      - `word_count` integer — Word count of the child chunk content.
      - `type` string — How the child chunk was created. Child chunks created or updated through the API are always `customized`. System-generated child chunks are `automatic`.
      - `created_at` number — Creation timestamp (Unix epoch in seconds).
      - `updated_at` number — Last update timestamp (Unix epoch in seconds).
    - `attachments` object[] — Files attached to this chunk.
      - `id` string — Attachment file identifier.
      - `name` string — Original file name.
      - `size` integer — File size in bytes.
      - `extension` string — File extension.
      - `mime_type` string — MIME type of the file.
      - `source_url` string — URL to access the attachment.
    - `summary` string, nullable — AI-generated summary of the chunk content. `null` if summary indexing is not enabled.
  - `doc_form` string — Document chunking mode used by this document.
  - `total` integer — Total number of matching chunks.
  - `has_more` boolean — Whether more items exist on the next page.
  - `limit` integer — Number of items per page.
  - `page` integer — Current page number.

## Other responses

- `400` — `provider_not_initialize` : The knowledge base uses high-quality indexing but its embedding model is missing or misconfigured.
- `403` — `forbidden` : Dataset api access is not enabled.
- `404` — - `not_found` : Dataset not found. - `not_found` : Document not found.

---

[API](https://skmtc.net/langgenius/apis/dify-service-api.md) · [All operations](https://skmtc.net/langgenius/apis/dify-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/langgenius/dify-service-api/versions/361dc12484f4/schema)
