v51

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-01206322659.2 KB
k2

Insert a new chunk into a knowledge base file.

post/orgs/{org_id}/k2/{kb_id}/files/{file_id}/chunks

Path parameters

org_idstring required
kb_idstring required
file_idstring required

Request body

after_uidstring uuid nullable

Place the new chunk immediately after this chunk_uid. Mutually exclusive with before_uid. If neither is set, the chunk is appended at the end of the file.

before_uidstring uuid nullable

Place the new chunk immediately before this chunk_uid. Mutually exclusive with after_uid.

contentstring required
embedstring nullable

Text used for vector / full-text indexing. Defaults to content when omitted; provide an explicit value to keep an indexing-optimized variant distinct from the user-visible text.

page_endinteger nullable
page_startinteger nullable

Response

Chunk inserted

blocksobject required

Source-document layout metadata (e.g. bounding boxes, page coords) when available. null for chunks created or edited by the user.

contentstring required
created_atstring date-time required
embedstring required
index_errorstring nullable
index_statusstring required

Indexing state for search (pending, indexing, indexed, or failed).

indexed_atstring date-time nullable
kb_file_idstring required
ordinalstring required

Ordering key within the file.

page_endinteger nullable
page_startinteger nullable
revisionstring required

Revision token for optimistic concurrency on update and delete.

sourcestring required

Origin of the chunk: parser, user_edit, or insert.

uidstring uuid required

Stable per-chunk identity.

updated_atstring date-time required