DOCUMENT_VERSION or another SECTION) and is ordered within its siblings via a linked-list structure (prev_sibling_path_id, next_sibling_path_id).
Create section
POST https://api-staging.knowledgestack.ai/v1/sections
Create a new section as a child of a document version or an existing section.
Request body
Section name. 1–255 characters. Can contain any characters.
path_part_id of the parent. Must be a DOCUMENT_VERSION or SECTION type path part.The page in the source document where this section begins. Must be > 0.
Insert this section after the specified sibling
path_part_id. If null or omitted, the section is appended to the end of the sibling list.Response 200
Returns a SectionResponse.
Section ID.
Underlying path part ID.
Section name.
Source document page number.
Parent path part ID.
Previous sibling path part ID in the ordered list.
Next sibling path part ID in the ordered list.
Full path from root.
Whether this section is system-managed.
System-managed metadata, including aggregate statistics (
information_statistics).Owning tenant.
Creation timestamp (ISO 8601).
Last update timestamp (ISO 8601).
Example
Get sections (bulk)
GET https://api-staging.knowledgestack.ai/v1/sections/bulk
Fetch multiple sections by ID in a single request.
Non-existent IDs are silently skipped. The maximum number of IDs per request is 200.
Query parameters
Comma-separated list of section IDs to retrieve.
Response 200
Returns an array of SectionResponse objects. See Create section for field descriptions.
Example
Get section
GET https://api-staging.knowledgestack.ai/v1/sections/{section_id}
Get a single section by its ID.
Path parameters
The section ID.
Response 200
Returns a SectionResponse. See Create section for field descriptions.
Example
Update section
PATCH https://api-staging.knowledgestack.ai/v1/sections/{section_id}
Update a section’s name, page number, or position within its siblings. All fields are optional.
To reorder: provide prev_sibling_path_id to insert after a specific sibling, or set move_to_head: true to move to the front of the sibling list. Do not provide both.
Path parameters
The section ID to update.
Request body
New section name. 1–255 characters.
Updated page number. Must be > 0.
Move after this sibling path part ID.
Set to
true to move this section to the beginning of the sibling list. Defaults to false.Reparent to a new parent path part. Must be a
DOCUMENT_VERSION or SECTION within the same document version.Response 200
Returns the updated SectionResponse.
Example
Delete section
DELETE https://api-staging.knowledgestack.ai/v1/sections/{section_id}
Delete a section and all of its child sections and chunks.
This is a cascading delete. All nested sections and their chunks are permanently removed.
Path parameters
The section ID to delete.
Response 200
Returns an empty {} on success.
Example
Dissolve section
POST https://api-staging.knowledgestack.ai/v1/sections/{section_id}/dissolve
Dissolve a section by converting it to a TEXT chunk and reparenting its children. Specifically:
- The section’s name becomes the content of a new
TEXTchunk at the section’s position. - All children of the section are reparented to the section’s parent.
- The section itself is deleted.
Path parameters
The section to dissolve.
Response 200
Returns a DissolveSectionResponse.
ID of the newly created
TEXT chunk containing the section’s name.Number of children that were reparented to the section’s former parent.