Folders
Folder CRUD plus hierarchical listing and move. Folders group files and subfolders inside a share.
Base path: /api/v1/folders/
Folder metadata shape#
1 2 3 4 5 6 7 8 9 10 11 | |
parent_id: null means the folder is at the share root.
Get folder metadata#
1 2 | |
Requires READ on the folder.
List folder contents#
1 2 3 | |
1 2 3 4 5 6 7 8 | |
1 2 3 4 5 6 | |
Response:
1 2 3 4 5 6 7 8 | |
Query parameters:
| Param | Default | Notes |
|---|---|---|
share_id |
required | The share this folder is in |
include_deleted |
false |
Include soft-deleted items (for trash views) |
Items are a mixed array of files and folders. Distinguish by type.
Listing the share root#
To list the root of a share (top-level folders and files):
1 2 3 | |
The special folder ID root refers to the share root.
Create a folder#
1 2 3 4 5 6 7 8 | |
Omit parent_id to create at the share root.
Requires CREATE on the parent folder (or share, for root).
Folder names are unique within their parent. A second folder called Drafts in the same parent returns 409 NAME_CONFLICT.
Rename a folder#
1 2 3 4 | |
Requires WRITE. The path of the folder and all descendants is recomputed; children all get renamed change-log entries propagated.
Delete a folder#
1 2 | |
Soft delete. Descendants (subfolders and files) are recursively soft-deleted.
Permanent delete:
1 2 | |
Requires DELETE on the folder and all its descendants. If the caller lacks DELETE on any descendant, the operation fails atomically — partial deletion is never left behind.
Move a folder#
1 2 3 4 | |
Or move to another share:
1 | |
Moving a folder moves everything inside. Requires DELETE on source, CREATE on target, plus READ on the entire subtree. Cross-share moves trigger a permission re-evaluation for descendants — ACLs inherited from the old parent are replaced by ACLs inherited from the new parent.
Walking a tree#
To list an entire subtree, traverse recursively. There's no single-call "give me everything under this folder" endpoint on purpose — large subtrees would produce unbounded responses and time out. Instead:
1 2 3 4 5 6 7 8 9 | |
If you need the whole share for caching/indexing, consume the sync changelog from cursor 0 — it yields every resource in order, once, with no pagination issues. See Sync Model.
Error cases#
| Code | When |
|---|---|
NOT_FOUND |
Folder doesn't exist or caller can't see it |
NAME_CONFLICT |
Sibling with same name exists |
AUTHZ_PERMISSION_DENIED |
Missing required permission (including on descendants during delete/move) |
INVALID_PATH |
Name contains disallowed characters (/, \0, leading/trailing whitespace) |
RESOURCE_DELETED |
Folder is soft-deleted |
What's next#
- Files — file operations inside folders.
- Uploads and Downloads — bulk content transfer.
- Permissions and ACLs — folder ACL inheritance.