Skip to main content
get/datasets/{dataset_id}/documents/{document_id}/segments
Request example
Response
get/datasets/{dataset_id}/documents/{document_id}/segments

Authorization

Authorizationstringheaderrequired#

Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).

Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).

Path parameters

dataset_idstringrequired#
Knowledge base ID, from List Knowledge Bases. For a scoped key, copy the ID from the Dify URL.
document_idstringrequired#
Document ID. Obtain it from List Documents.

Query parameters

pageinteger#
Page number.

Default: 1

Range: >= 1

limitinteger#
Number of items per page. Server caps at 100.

Default: 20

Range: >= 1

statusstring[]#
Filter chunks by indexing status, e.g. completed, indexing, error.
keywordstring#
Search keyword.

Responses

application/json
List of chunks.
dataobject[]#
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.