location¶
Operations for indexing existing disk folders in place, controlling file access policies, rescanning, customizing sidebar appearance and relocating moved directories. All operations target a library.
Locations are watched disk directories indexed in place without copying files; for Curio's library folder hierarchy, see folder.
location.list¶
Return all listed in-place locations in the library. Location.path is omitted unless the caller holds files.read.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns Location[].
Example request
Example response
[
{ "id": 2, "name": "Stock Photos", "online": true, "watch": true, "access": "full", "count": 1520, "lastScan": 1763940100000, "icon": null, "color": null }
]
Events and errors Read-only. Returns 403 not_allowed without metadata.read, 404 unknown_library or 409 library_closed / library_offline.
location.add¶
Add an existing directory on disk as an in-place location and start scanning it. Passing an Eagle .library folder indexes it as an Eagle library (with its folders and tags); other options do not apply to Eagle libraries.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string |
Yes | — | Absolute path to an existing directory on disk. |
label |
string |
No | Folder basename | Sidebar display label. |
access |
string |
No | "full" |
read_only, full (edit files in place) or organize (edit, rename and move). |
watch |
boolean |
No | true |
Watch filesystem events automatically. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { success: true; id: number }.
Example request
Example response
Events and errors Emits locations.changed, scan.progress, scan.done and items.added. Returns 400 bad_request if path is not an existing directory, lies inside a library store, access is invalid or label exceeds 100 characters; 403 not_allowed without files.outside; 404 unknown_library; or 409 library_closed / library_offline.
location.remove¶
Stop indexing a location and remove its entries from the library database. Files on disk are untouched.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Location ID from location.list. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns Done.
Example request
Example response
Events and errors Emits locations.changed and items.removed (purged: true). Returns 403 not_allowed without organize, 404 not_found if no location has id, 404 unknown_library or 409 library_closed / library_offline.
location.rescan¶
Queue a full directory walk of a location to detect new, modified, moved or missing files.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Location ID. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { success: true; queued: true }.
Example request
Example response
Events and errors Emits scan.progress and scan.done. Returns 403 not_allowed without organize, 404 not_found if no location has id, 404 unknown_library or 409 library_closed / library_offline.
location.setAccess¶
Change Curio's disk write policy for an indexed location.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Location ID. |
access |
string |
Yes | — | read_only, full or organize. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns Done.
Example request
Example response
Events and errors Emits locations.changed. Returns 400 bad_request for an invalid access, 403 not_allowed without organize, 404 not_found if no location has id, 404 unknown_library or 409 library_closed / library_offline.
location.setLook¶
Set or clear a location's sidebar icon and color swatch.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Location ID. |
icon |
string |
No | — | Tabler icon name; "" clears back to drive-type icon. |
color |
string |
No | — | CSS color (#rrggbb or var(--accent)); "" clears. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns Done.
Example request
Example response
Events and errors Emits locations.changed. Returns 403 not_allowed without organize, 404 not_found if no location has id, 404 unknown_library or 409 library_closed / library_offline.
location.relocate¶
Update a location's root path after its directory was moved on disk (or mounted under a new drive letter) while preserving every item's UUID and metadata.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id |
number |
Yes | — | Location ID. |
path |
string |
Yes | — | New absolute directory path. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns Done.
Example request
Example response
Events and errors Emits locations.changed, then queues a rescan (scan.progress and scan.done). Returns 400 bad_request if path is not an existing directory, 403 not_allowed without organize, 404 not_found if no location has id, 404 unknown_library or 409 library_closed / library_offline.