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

Get document chunk details

Retrieves the full details of a single chunk in a document in a knowledge base. Use the identifiers to select the knowledge base, document, and chunk whose details you need. The response includes the chunk details and the document’s chunking mode.

3 parameters
dataset_idstringrequired
The UUID of the knowledge base containing the document.
document_idstringrequired
The UUID of the document containing the chunk.
segment_idstringrequired
The UUID of the chunk to retrieve.

4 status codes
200Returns the chunk’s full details and the document’s chunking mode.
dataobjectoptional
doc_formstringoptional
Document chunking mode used by this document.
400Returned when the embedding model is missing or misconfigured.

One documented failure

  • invalid_param

    No Embedding Model available. Please configure a valid provider in the Settings -> Model Provider.

    invalid_param

403Returned when dataset API access is disabled or the API key is not scoped to the knowledge base.

One documented failure

  • forbidden

    Dataset api access is not enabled.

    forbidden (api access)

404Returned when the knowledge base, document, or chunk does not exist.

One documented failure

  • not_found

    Dataset not found.

    not_found

Error handling

A 400 is returned when the embedding model is missing or misconfigured; a 403 is returned when dataset API access is disabled or the API key is not scoped to the knowledge base. A 404 is returned when the knowledge base, document, or chunk cannot be found. The dataset_id path parameter, document_id path parameter, and segment_id path parameter must be UUIDs.