path_part_id — the underlying tree node — and a parent_path_part_id pointing to its parent folder. The root of each tenant’s shared space is a system-managed folder.
Create folder
POST https://api-staging.knowledgestack.ai/v1/folders
Create a new folder as a child of an existing folder.
Request body
Folder name. 1–255 characters.
path_part_id of the parent folder. Must reference a FOLDER type path part.Response 200
Returns a FolderResponse.
Folder ID.
Underlying path part ID used for tree traversal and permissions.
Folder name.
Parent path part ID.
null for the root folder.Full path from root (e.g.
/tenant-root/engineering/docs).Whether this folder is managed by the system and cannot be deleted directly.
Tenant that owns this folder.
Creation timestamp (ISO 8601).
Last update timestamp (ISO 8601).
Tags attached to this folder (if requested).
Example
List folders
GET https://api-staging.knowledgestack.ai/v1/folders
List direct child folders of a parent folder (depth = 1).
Query parameters
Filter to children of this folder. Defaults to the tenant’s shared root.
Sort order. One of
NAME, UPDATED_AT, CREATED_AT.Include tag data in each folder response. Defaults to
false.Page size.
Pagination offset.
Response 200
Returns a paginated list of FolderResponse objects.
Example
Search items
GET https://api-staging.knowledgestack.ai/v1/folders/search
Search for folders and documents by name using a case-insensitive trigram partial match.
Query parameters
Partial name to search for.
Filter by item type. One of
FOLDER, DOCUMENT.Restrict search to descendants of this folder.
Sort order. One of
NAME, UPDATED_AT, CREATED_AT.Include tags in results. Defaults to
false.Page size.
Pagination offset.
Response 200
Returns a paginated discriminated union of FolderResponse and DocumentResponse objects.
Example
Get folder
GET https://api-staging.knowledgestack.ai/v1/folders/{folder_id}
Get a single folder by its folder ID.
Path parameters
The folder ID (not the
path_part_id).Query parameters
Include tags in the response. Defaults to
false.Response 200
Returns a FolderResponse. See Create folder for field descriptions.
Example
Update folder
PATCH https://api-staging.knowledgestack.ai/v1/folders/{folder_id}
Rename a folder, move it to a new parent, or both. All fields are optional — supply only the ones you want to change.
Path parameters
The folder ID to update.
Request body
New folder name. 1–255 characters.
path_part_id of the new parent folder. Provide this to move the folder.Response 200
Returns the updated FolderResponse.
Example
Delete folder
DELETE https://api-staging.knowledgestack.ai/v1/folders/{folder_id}
Delete a folder and all of its contents.
This is a cascading delete. All child folders, documents, document versions, sections, and chunks inside this folder will be permanently removed. This action cannot be undone.
Path parameters
The folder ID to delete.
Response 200
Returns an empty {} on success.
Example
Folder action
POST https://api-staging.knowledgestack.ai/v1/folders/{folder_id}
Perform an action on a folder. Currently the only supported action is reembed, which re-embeds all documents in the folder.
Path parameters
The folder to act on.
Query parameters
The action to perform. Currently supported:
reembed.Response 200
Returns a FolderActionResponse.
The folder ID the action was applied to.
The action performed (e.g.
reembed).ID of the background workflow that was triggered.
Example
List folder contents
GET https://api-staging.knowledgestack.ai/v1/folders/{folder_id}/contents
List all items (folders and documents) under a folder up to a specified depth. Returns a paginated discriminated union — each item includes a part_type field (FOLDER or DOCUMENT) so you can distinguish between them.
Path parameters
The folder whose contents to list.
Query parameters
Maximum depth to traverse below the specified folder.
1 returns only direct children.Sort order. One of
NAME, UPDATED_AT, CREATED_AT.Include tag data in each item. Defaults to
false.Page size.
Pagination offset.
Response 200
Returns a paginated list. Each item is either a FolderResponse or DocumentResponse, discriminated by the part_type field.