Get Chunk
Returns one chunk of one revision of a document. Takes the document ID from List Documents, not the document file ID, plus the revision number and the chunk ID.
The chunk must belong to that revision.
1 min read
get/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}
Request example
Response
get/knowledge-fs/spaces/{knowledge_base_id}/documents/{document_id}/revisions/{revision}/chunks/{chunk_id}
Authorization
Path parameters
Knowledge base ID: the last segment of the Service API endpoint shown in the knowledge base's API Access dialog (
…/knowledge-fs/spaces/<knowledge base ID>), and the segment after /datasets/new/ in the address bar.The document ID, from List Documents or from the address bar of the open document (
/datasets/new/<knowledge base ID>/documents/<document ID>).Chunk ID. From List Chunks.
Responses
application/json
The chunk.
When the chunk was created, ISO 8601.
Document ID: the
id of Get Document.Revision the chunk belongs to. Each revision has its own chunks. A chunk ID is addressable only through its own revision.
Whether the chunk takes part in retrieval. No operation in this API changes it.
Zero-based UTF-8 byte offset in the parsed document text. Exclusive end.
null when unknown.What the chunk was built from:
chunk for a run of body text (the default), section for a heading section, table for a table, image for an image, summary for a generated summary.Internal ID of the knowledge base. Not the knowledge base ID in the path.
Position of the chunk within the revision, starting at
0. Sort by it to read chunks in document order.ID of the parent chunk for parent-child chunking.
null for top-level chunks.IDs of the parsed elements the chunk was built from.
Headings from the document root to the chunk's section.
Zero-based UTF-8 byte offset in the parsed document text. Inclusive start.
null when unknown.Chunk content.
Number of tokens in
text.Metadata attached to the chunk. Free-form object.