Skip to main content
GET
Get Chunk

Authorizations

Authorization
string
header
required

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

knowledge_base_id
string<uuid>
required

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.

document_id
string<uuid>
required

The document ID, from List Documents or from the address bar of the open document (/datasets/new/<knowledge base ID>/documents/<document ID>).

revision
integer
required

Revision number. From List Document Revisions.

Required range: x >= 1
chunk_id
string<uuid>
required

Chunk ID. From List Chunks.

Response

The chunk.

Offsets refer to the parsed document text. They are not positions in the original file.

created_at
string

When the chunk was created, ISO 8601.

document_id
string

Document ID: the id of Get Document.

document_revision
integer

Revision the chunk belongs to. Each revision has its own chunks. A chunk ID is addressable only through its own revision.

enabled
boolean

Whether the chunk takes part in retrieval. No operation in this API changes it.

end_offset
integer | null

Zero-based UTF-8 byte offset in the parsed document text. Exclusive end. null when unknown.

id
string

Chunk ID. The chunk_id path value for Get Chunk.

kind
string

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.

knowledge_space_id
string

Internal ID of the knowledge base. Not the knowledge base ID in the path.

ordinal
integer

Position of the chunk within the revision, starting at 0. Sort by it to read chunks in document order.

parent_chunk_id
string | null

ID of the parent chunk for parent-child chunking. null for top-level chunks.

parse_element_ids
string[]

IDs of the parsed elements the chunk was built from.

section_path
string[]

Headings from the document root to the chunk's section.

start_offset
integer | null

Zero-based UTF-8 byte offset in the parsed document text. Inclusive start. null when unknown.

text
string

Chunk content.

token_count
integer

Number of tokens in text.

user_metadata
object

Metadata attached to the chunk. Free-form object.