folder¶
Folder operations read and organize a library's hierarchical folder tree and list the items inside a folder. Library folders are managed collections inside the library; for watched in-place disk directories, see Locations. Every operation in this namespace targets a single library; pass library to address a specific library, or omit it to target the library in the most recently focused window (see Choose a library or window).
| Operation | HTTP Endpoint | Permission | MCP Tool | Summary |
|---|---|---|---|---|
folder.list |
POST /api/v1/folder/list |
metadata.read |
folder_list |
List all folders as a flat array with parent links and item counts. |
folder.get |
POST /api/v1/folder/get |
metadata.read |
folder_get |
Fetch one folder with its direct subfolder IDs. |
folder.recent |
POST /api/v1/folder/recent |
metadata.read |
folder_recent |
List folders most recently used in the library's window. |
folder.items |
POST /api/v1/folder/items |
metadata.read |
folder_items |
Paginate items in a folder, optionally including subfolders. |
folder.create |
POST /api/v1/folder/create |
organize |
folder_create |
Create a new folder at the top level or under a parent folder. |
folder.rename |
POST /api/v1/folder/rename |
organize |
folder_rename |
Rename an existing folder. |
folder.move |
POST /api/v1/folder/move |
organize |
folder_move |
Move a folder under another parent or to the top level. |
folder.update |
POST /api/v1/folder/update |
organize |
folder_update |
Update a folder's color, icon or automatic tags. |
folder.delete |
POST /api/v1/folder/delete |
organize |
folder_delete |
Delete a folder and its subfolders recursively. |
folder.list¶
Returns every folder in the library as a flat array ordered by sortOrder and then case-insensitive name. Reconstruct the folder tree on the client using each folder's parentId (null for top-level folders). Each folder's count reports non-trashed top-level items directly inside that folder, excluding subfolder totals and grouped member files.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Folder[] — flat array of folder objects.
Example request
Example response
[
{
"id": 1,
"parentId": null,
"name": "Reference",
"color": "#3b9160",
"sortOrder": 1,
"count": 42,
"icon": "palette",
"autoTags": ["reference"],
"createdAt": 1732400100000
},
{
"id": 2,
"parentId": 1,
"name": "Lighting",
"color": null,
"sortOrder": 1,
"count": 18,
"icon": null,
"autoTags": [],
"createdAt": 1732400200000
}
]
Events and errors
- Events emitted: None (read-only). Subscribe to
folders.changedto know when to re-read the folder list. - Errors:
unauthorized,not_allowed(missingmetadata.read),unknown_library,library_offline(see Error reference). - Related:
folder.get,folder.recent,folder.create.
folder.get¶
Returns a single folder record together with the IDs of its direct child subfolders.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Integer folder ID. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Folder & { children: number[] } — all fields of Folder plus:
| Field | Type | Description |
|---|---|---|
children |
number[] |
Direct child folder IDs in their folder.list sort order. Empty array if the folder has no subfolders. |
Example request
Example response
{
"id": 1,
"parentId": null,
"name": "Reference",
"color": "#3b9160",
"sortOrder": 1,
"count": 42,
"icon": "palette",
"autoTags": ["reference"],
"createdAt": 1732400100000,
"children": [2, 5]
}
Events and errors
- Events emitted: None (read-only).
- Errors:
not_found(There is no folder <id>),bad_request(missing or non-integerid),not_allowed(missingmetadata.read). - Related:
folder.list,folder.items.
folder.recent¶
Returns the folders most recently used in this library's window, ordered newest first. Folders that were subsequently deleted are omitted automatically. If the library is held by a background process without a window or no folders have been used in the current session, returns an empty array.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Folder[] — array of recently used folders, newest first.
Example request
Example response
[
{
"id": 2,
"parentId": 1,
"name": "Lighting",
"color": null,
"sortOrder": 1,
"count": 18,
"icon": null,
"autoTags": [],
"createdAt": 1732400200000
}
]
Events and errors
- Events emitted: None (read-only).
- Errors:
unauthorized,not_allowed(missingmetadata.read),unknown_library,library_offline. - Related:
folder.list,item.addToFolders.
folder.items¶
Returns a paginated slice of non-trashed top-level items in a folder. By default, items in descendant subfolders are included (subfolders: true). Items include their filesystem path only when the caller also holds files.read.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Folder ID to read. |
subfolders |
boolean |
No | true |
When true, includes items from all descendant subfolders; when false, returns only direct members of the folder. |
sort |
string |
No | "imported" |
Sort key: imported, modified, created, name, size, rating, resolution, duration or field:<key> for an indexed sortable custom field. |
descending |
boolean |
No | true |
Sort newest, largest or highest first when true; ascending when false. |
offset |
number |
No | 0 |
Zero-based starting index into the sorted results. |
limit |
number |
No | 50 |
Maximum items to return; clamped to 1000. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Page<Item> — paginated list of Item objects.
| Field | Type | Description |
|---|---|---|
total |
number |
Total matching items across all pages. |
offset |
number |
Offset used for this page. |
items |
Item[] |
Items in the requested page. |
Example request
Example response
{
"total": 60,
"offset": 0,
"items": [
{
"id": "8e1d7f4e-9b25-4c0f-a824-1b7e6b21a301",
"name": "Studio Key Light",
"fileName": "studio_key_light.png",
"ext": "png",
"kind": "image",
"size": 1842910,
"width": 2048,
"height": 1365,
"duration": null,
"rating": 5,
"favorite": false,
"explicit": false,
"annotation": "Warm bounce fill on left",
"url": "",
"tags": ["reference", "lighting"],
"folders": [{"id": 2, "name": "Lighting"}],
"status": "Available",
"imported": 1732401500000,
"modified": 1732399000000,
"parts": 0
}
]
}
Events and errors
- Events emitted: None (read-only).
- Errors:
not_found(folderiddoes not exist),bad_request(unknownsortvalue),not_allowed(missingmetadata.read). - Related:
item.query,smartFolder.items,folder.get.
folder.create¶
Creates a new folder at the top level or under an existing parent folder, appended after existing siblings (sortOrder = max + 1). Leading and trailing whitespace is trimmed from name. Because folders mirror directories in the managed store, sibling names are compared case-insensitively: if a sibling with the same name already exists, Curio automatically appends a numeric suffix according to the library's duplicate-name style (for example, Lighting (2)).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string |
Yes | — | Folder name; trimmed, must not be blank. |
parent |
number |
No | null |
Parent folder ID; omit or pass null to create a top-level folder. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
{ success: true; id: number }
| Field | Type | Description |
|---|---|---|
success |
true |
Confirms the folder was created. |
id |
number |
Integer ID of the newly created folder. |
Example request
Example response
Events and errors
- Events emitted:
folders.changed. - Errors:
bad_request(Give it a namewhennameis empty or whitespace),not_found(parentfolder does not exist),not_allowed(missingorganize),failed(write timeout or database error). - Related:
folder.rename,folder.move,folder.update.
folder.rename¶
Renames an existing folder. Leading and trailing whitespace is trimmed. Unlike folder.create, renaming refuses a case-insensitive collision with an existing sibling folder under the same parent. In a managed store, Curio reconciles the mirrored directory name on disk asynchronously.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Folder ID to rename. |
name |
string |
Yes | — | New folder name; trimmed, must not be blank or collide with a sibling. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
folders.changed. - Errors:
bad_request(Give it a namewhennameis blank),failed(folderiddoes not exist or sibling name collisionThere is already a folder called "..." here),not_allowed(missingorganize). - Related:
folder.create,folder.move.
folder.move¶
Moves a folder (with its entire subtree) under another folder or to the top level. Moving a folder into itself or into one of its own descendants is rejected. If a folder with the same name (case-insensitive) already exists under the new parent, Curio automatically appends a duplicate-name suffix to the moved folder's name. If the folder is already under parent, the call succeeds as a no-op.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Folder ID to move. |
parent |
number |
No | null |
Destination parent folder ID; pass null or omit to move to the top level. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
folders.changed. - Errors:
failed(folderiddoes not exist, cycle detectedA folder can't be moved into itselfor nonexistentparentfolder ID),not_allowed(missingorganize). - Related:
folder.rename,item.moveToFolder.
folder.update¶
Updates a folder's visual styling (color, icon) and/or its automatic tags (autoTags). Omitted properties are left unchanged. Passing an empty string "" for color or icon clears that property; passing an empty array [] for autoTags clears all automatic tags. Note that autoTags are joined with commas internally, so individual tag names must not contain commas; automatic tags apply to items added to the folder afterward and do not retroactively tag existing items.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Folder ID to update. |
color |
string |
No | Unchanged | CSS color value (for example "#3b9160"); pass "" to clear. Folder colors can be queried with folder_color. |
icon |
string |
No | Unchanged | Tabler icon name (for example "palette"); pass "" to clear. |
autoTags |
string[] |
No | Unchanged | Tag names automatically applied whenever an item is added to this folder; pass [] to clear. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
folders.changed. - Errors:
bad_request(invalid parameter types),not_allowed(missingorganize),failed(database error). - Related:
folder.rename,folder.get.
folder.setCover¶
Sets a custom cover image for a folder from an existing library item's thumbnail, a picture file on disk, or base64-encoded image bytes, or clears the custom cover so the folder uses an automatic cover again. Covers are resized to fit 512 px and stored in the library's thumbnail cache. Passing path also requires files.outside, unless the file was created by a plugin program run.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Folder ID to update. |
item |
string \| number |
No | — | Item UID or row ID whose thumbnail becomes the folder's cover. |
path |
string |
No | — | Path to a picture file on this computer. Requires files.outside. |
data |
string |
No | — | Picture bytes as base64 or a data: URL. |
clear |
boolean |
No | false |
When true, removes the custom cover so the folder falls back to its automatic cover. |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
folders.changed. - Errors:
bad_request(missing or conflicting cover source, unreadable image, or item without thumbnail),not_found(unknown folder or item),not_allowed(missingorganize, or missingfiles.outsideforpath),failed(database or I/O error). - Related:
folder.update,folder.get,item.setThumbnail.
folder.delete¶
Deletes a folder and all of its descendant subfolders recursively, with the covers set on any of them (folder.setCover). Items that also belong to a folder outside the deleted subtree remain active and only lose their memberships in the deleted folders.
Items whose only folder memberships were inside the deleted subtree move to the library's Trash without deleting files on disk, and their former folder paths are remembered so item.restore can recreate the folders. To keep those items active as uncategorized items instead, remove them with item.removeFromFolders before deleting the folder.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Folder ID to delete (along with all descendant subfolders). |
library |
string |
No | Active window's library | Library ID from library.list, folder path or library name. |
Returns
Done — { success: true }.
Example request
Example response
Events and errors
- Events emitted:
folders.changed, anditems.removed(purged: false) for any items moved to the Trash. - Errors:
bad_request(missing or invalidid),not_allowed(missingorganize),failed(database error). - Related:
item.removeFromFolders,item.restore.