field¶
Operations for defining custom metadata fields, querying field facets, inspecting extraction coverage and reader failures, checking where a field is referenced, cleaning up unindexed values and rescanning files. All operations target a library.
field.list¶
Return every custom, built-in reader and plugin-declared metadata field defined in the library.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns Field[].
Example request
Example response
[
{
"id": 1,
"key": "camera",
"label": "Camera",
"type": "text",
"description": "",
"defaultValue": null,
"options": [],
"validation": { "required": false },
"format": "",
"widget": "row",
"owner": "builtin.format.image",
"visible": true,
"sortOrder": 0,
"ownFilter": false,
"filterKind": "",
"indexed": true,
"pair": null,
"filterGroup": null,
"readers": ["builtin.format.image/exif"],
"needsScan": false
}
]
Events and errors Read-only. Returns 403 not_allowed without metadata.read, 404 unknown_library or 409 library_closed / library_offline.
field.get¶
Fetch a single metadata field definition by its key.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
key |
string |
Yes | — | Field key (e.g. "camera", "steps"). |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns Field.
Example request
Example response
{
"id": 1,
"key": "camera",
"label": "Camera",
"type": "text",
"description": "",
"defaultValue": null,
"options": [],
"validation": { "required": false },
"format": "",
"widget": "row",
"owner": "builtin.format.image",
"visible": true,
"sortOrder": 0,
"ownFilter": false,
"filterKind": "",
"indexed": true,
"pair": null,
"filterGroup": null,
"readers": ["builtin.format.image/exif"],
"needsScan": false
}
Events and errors Read-only. Returns 403 not_allowed without metadata.read, 404 not_found if no field has key, 404 unknown_library or 409 library_closed / library_offline.
field.define¶
Create a new custom field or update an existing field's settings. Omitted properties keep their current values. A field's type cannot be changed once items hold values for it.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
key |
string |
Yes | — | Lowercase machine key used in queries (e.g. client_project). |
type |
string |
For new fields | — | text, integer, float, boolean, date, datetime, single_select, multi_select, json, url or file_ref. |
label |
string |
No | key |
Display label. |
description |
string |
No | "" |
Help text. |
defaultValue |
string |
No | null |
Default value. |
options |
string[] |
No | [] |
Choices for single_select or multi_select. |
validation |
object |
No | {} |
{ min?, max?, maxLength?, pattern?, required? }. |
format |
string |
No | "" |
Display format hint. |
widget |
string |
No | "row" |
Editor widget style: row, block or code (multi_select renders as chips automatically). |
visible |
boolean |
No | true |
Show in Inspector and List column picker. |
sortOrder |
number |
No | 0 |
Display order. |
ownFilter |
boolean |
No | false |
Expose as a standalone Filter bar chip and Smart Folder rule. |
filterKind |
string |
No | "" |
list, range, text, has or "" (auto by type). |
indexed |
boolean |
No | true |
Enable/disable indexing and storage (switching a paired field switches its pair too). |
pair |
string |
No | — | Key of the primary field this one pairs with (e.g. lora_strength → lora). |
filterGroup |
string |
No | — | Shared numeric filter group name; empty string removes from group. |
needsScan |
boolean |
No | false |
Mark as switched on without having scanned existing files yet. |
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 fields.changed. Returns 400 bad_request if type is missing on a new field, type is unknown, validation is invalid or changing a plugin-owned field's type; 403 not_allowed without organize; 404 unknown_library; or 409 library_closed / library_offline.
field.delete¶
Delete a user-defined custom field (owner === "user") along with all of its stored values. Built-in and plugin-owned fields cannot be deleted (hide or turn off indexing via field.define instead).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
key |
string |
Yes | — | Key of the user field to delete. |
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 fields.changed. Returns 400 bad_request for built-in or plugin-owned fields, 403 not_allowed without organize, 404 not_found if no field has key, 404 unknown_library or 409 library_closed / library_offline.
field.facets¶
Count distinct values of a field across items matching an optional query and scope. For built-in property histograms (rating, shape, kind, extension) see query.facets; for item counts and byte totals by kind, extension, folder, tag or month see library.stats.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
key |
string |
Yes | — | Indexed field key. |
query |
string |
No | "" |
Restrict counts to items matching this query. |
scope |
string |
No | "all" |
all, uncategorized, untagged, recent, trash or missing. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns FieldFacets.
Example request
Example response
Events and errors Read-only. Returns 400 bad_request on invalid query syntax or unknown scope, 403 not_allowed without metadata.read, 404 not_found if no field has key, 404 unknown_library or 409 library_closed / library_offline.
field.coverage¶
Report extraction coverage (withValue, applies, waiting, failed) for file-reading fields.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
keys |
string[] |
No | All file-reading fields | Restrict report to specific field keys. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { fields: FieldCoverage[] } (FieldCoverage).
Example request
Example response
Events and errors Read-only. Returns 403 not_allowed without metadata.read, 404 unknown_library or 409 library_closed / library_offline.
field.failures¶
List files on which metadata readers failed, newest first.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
keys |
string[] |
No | All | Filter by field keys. |
plugin |
string |
No | All | Filter by plugin ID. |
limit |
number |
No | 200 |
Maximum entries (1–2000). |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { failures: { id: string; name: string; reader: string; error: string; at: number }[] }:
failures[].id(string): Item UUID.failures[].name(string): Item display name.failures[].reader(string): Reader identifier (for example"curio.models/models").failures[].error(string): Error message reported by the reader.failures[].at(number): Failure timestamp in milliseconds since the Unix epoch.
Example request
Example response
{
"failures": [
{ "id": "0194b7a2-...", "name": "broken.gltf", "reader": "curio.models/models", "error": "Unexpected EOF", "at": 1763940500000 }
]
}
Events and errors Read-only. Returns 403 not_allowed without metadata.read, 404 unknown_library or 409 library_closed / library_offline.
field.usedBy¶
Find every smart folder, plugin filter and plugin sort that references a field key (useful before disabling or deleting a field).
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
key |
string |
Yes | — | Field key to inspect. |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { smartFolders: { id: number; name: string }[]; filters: { plugin: string; label: string }[]; sorts: { plugin: string; label: string }[] }:
smartFolders({ id: number; name: string }[]): Smart folders whose query referenceskey.filters({ plugin: string; label: string }[]): Plugin filters (and panel filters, labeled as"<panel> › <filter>") whose query referenceskey.sorts({ plugin: string; label: string }[]): Plugin sorts ordered bykey.
Example request
Example response
{
"smartFolders": [{ "id": 5, "name": "Fast renders" }],
"filters": [{ "plugin": "curio.ai-generated", "label": "≤ 12 steps" }],
"sorts": [{ "plugin": "curio.ai-generated", "label": "Steps" }]
}
Events and errors Read-only. Returns 403 not_allowed without metadata.read, 404 unknown_library or 409 library_closed / library_offline.
field.cleanup¶
Delete stored values belonging to unindexed file-reading fields (excluding manual hand-edited overrides). Field definitions and smart-folder references stay intact.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
dryRun |
boolean |
No | false |
When true, only counts eligible values without deleting anything. |
keys |
string[] |
No | All unindexed fields whose plugin is still present | Restrict cleanup to specific keys (required to clean fields whose plugin is gone). |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { fields: { key: string; values: number; pluginGone: boolean }[]; removed: number }:
fields[].key(string): Eligible unindexed field key.fields[].values(number): Count of removable reader-extracted values found for that field.fields[].pluginGone(boolean):truewhen no installed reader fills the field anymore.removed(number): Total stored values deleted (0whendryRunistrue).
Example request
Example response
Events and errors Emits no library events. Returns 403 not_allowed without metadata.write, 404 unknown_library or 409 library_closed / library_offline.
field.rescan¶
Re-run metadata readers as a background job for specific fields, a plugin's readers or specific items. Manual overrides are always preserved.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
keys |
string[] |
No | — | Field keys to re-extract. |
plugin |
string |
No | — | Plugin ID whose readers should run. |
items |
(string \| number)[] |
No | All matching files | Restrict extraction to specific items. |
mode |
string |
No | "all" |
missing (only files with none of the readers' fields) or all (re-read and replace prior reader values). |
library |
string |
No | Default library | Target library (ID, path or unique name). Not allowed for plugin callers. |
Returns { job: string | null; files: number }: background job ID (null when files === 0) and count of queued files.
Example request
Example response
Events and errors Emits job.started, job.progress, job.finished and items.changed. Returns 400 bad_request for an unknown mode or when no enabled reader matches keys/plugin, 403 not_allowed without metadata.write, 404 not_found for an unknown item ID, 404 unknown_library or 409 library_closed / library_offline.