Folders

/api/v1 operations for folders. See HTTP API for authentication, the error envelope, and rate limits.

Operations

GET /api/v1/folders

List folders

Returns every active folder in the organization as a flat list with id, name, parent id, and path. Reconstruct the hierarchy from parentId, or address folders by path on the file endpoints.

Auth: API key required.

Operation ID: listFolders

Responses:

CLI: khotan folders list

POST /api/v1/folders

Create a folder

Creates a folder under the root, a parentId, or a parentPath (mutually exclusive; the parent must already exist). Sibling folder names are unique case-insensitively — a duplicate name responds 409.

Auth: API key required.

Operation ID: createFolder

Request body (application/json, required):

Responses:

CLI: khotan folders create

PATCH /api/v1/folders/{folderId}

Rename a folder

Renames the folder. Descendant folder paths update automatically; previously stored paths into the subtree stop resolving, so store folder ids rather than paths. Sibling name conflicts respond 409.

Auth: API key required.

Operation ID: renameFolder

Path parameters:

Request body (application/json, required):

Responses:

CLI: khotan folders rename

DELETE /api/v1/folders/{folderId}

Delete a folder

Soft-deletes an empty folder. A folder containing active child folders, ready files, or live pending uploads responds 409 with code folder_not_empty; when live pending uploads block deletion, error.details.pendingFileIds lists those file ids. Pending uploads past their upload expiry window do not block deletion. Move, cancel, or wait for expiry, then retry.

Auth: API key required.

Operation ID: deleteFolder

Path parameters:

Responses:

CLI: khotan folders delete