Chunks

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

get/datasets/{dataset_id}/documents/{document_id}/segments

Request

  • Base URL
    https://api.dify.ai/v1
  • URL
    https://api.dify.ai/v1/datasets/{dataset_id}/documents/{document_id}/segments
  • Auth
    HTTP bearer

Path parameters

dataset_idstring uuid required

Knowledge base ID, from List Knowledge Bases. For a scoped key, copy the ID from the Dify URL.

document_idstring uuid required

Document ID. Obtain it from List Documents.

Query parameters

pageinteger

Page number.

limitinteger

Number of items per page. Server caps at 100.

statusstring[]

Filter chunks by indexing status, e.g. completed, indexing, error.

keywordstring

Search keyword.

Response

List of chunks.

doc_formstring

Document chunking mode used by this document.

has_moreboolean

Whether more items exist on the next page.

limitinteger

Number of items per page.

pageinteger

Current page number.

totalinteger

Total number of matching chunks.

Changes

    • warning

      for the query request parameter limit, the min was set to 1.00

    • warning

      for the query request parameter page, the min was set to 1.00

    • info

      added the non-success response with the status