item (Lifecycle)¶
Operations for duplicating items, transferring items across libraries, exporting files to disk and moving items through Trash, Restore and Purge.
item.duplicate¶
Create independent duplicate items with their own copied file bytes and identical tags, folders, ratings, notes, source URLs and custom fields.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Yes | — | Item IDs to duplicate. |
library |
string |
No | Default library | Routing parameter: library ID from library.list, folder path or name. Not allowed for plugin callers. |
Returns { success: true; ids: string[] } — UUIDs of the new duplicate items.
Example request
Example response
Events and errors Emits items.added (how: "duplicate").
item.copyToLibrary¶
Copy items (and their grouped companions, tags, ratings, notes and matching custom fields) into another open or closed library on this computer. The caller must also be permitted to access the destination library.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Yes | — | Source item IDs. |
to |
string |
Yes | — | Destination library ID from library.list, folder path or name. |
library |
string |
No | Default library | Source library ID from library.list, folder path or name. Not allowed for plugin callers. |
Returns { success: true; count: number }.
Example request
Example response
Events and errors Emits items.added on the destination library. Returns 404 unknown_library or 409 library_offline if destination cannot be reached; 403 not_allowed if token cannot reach to.
item.moveToLibrary¶
Copy items to another library (identically to item.copyToLibrary) and then move the source items into the source library's Trash.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Yes | — | Source item IDs. |
to |
string |
Yes | — | Destination library ID from library.list, folder path or name. |
library |
string |
No | Default library | Source library ID from library.list, folder path or name. Not allowed for plugin callers. |
Returns { success: true; count: number }.
Example request
Example response
Events and errors Emits items.added on destination and items.removed (purged: false) on source.
item.export¶
Copy items' files into a folder on disk (creating the folder if missing and appending numeric suffixes rather than overwriting existing files).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Yes | — | Item IDs to export. |
folder |
string |
Yes | — | Destination directory path on disk. |
members |
boolean |
No | true |
Also export companion/grouped member files. |
library |
string |
No | Default library | Routing parameter: library ID from library.list, folder path or name. Not allowed for plugin callers. |
Returns { success: true; count: number }.
Example request
Example response
Events and errors Read-only in the database; writes only to folder. Returns 403 not_allowed without files.outside.
item.trash¶
Move items to the library Trash. Original files remain intact until item.purge empties the Trash.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Yes | — | Item IDs to trash. |
library |
string |
No | Default library | Routing parameter: library ID from library.list, folder path or name. Not allowed for plugin callers. |
Returns Done.
Example request
Example response
Events and errors Emits items.removed (purged: false).
item.restore¶
Restore trashed items back to the library and their previous folders.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Yes | — | Trashed item IDs to restore. |
library |
string |
No | Default library | Routing parameter: library ID from library.list, folder path or name. Not allowed for plugin callers. |
Returns Done.
Example request
Example response
Events and errors Emits items.added (how: "restore").
item.purge¶
Permanently remove trashed items from the library (or empty the entire Trash). Managed copies owned by Curio are sent to the system trash / Recycle Bin; linked location originals on disk are never deleted.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
ids |
(string \| number)[] |
Unless all: true |
— | Specific trashed item IDs to purge. |
all |
boolean |
No | false |
Empty the entire Trash. |
library |
string |
No | Default library | Routing parameter: library ID from library.list, folder path or name. Not allowed for plugin callers. |
Returns Done.
Example request
Example response
Events and errors Emits items.removed (purged: true).