API¶
Curio uses one operation registry across every integration surface. HTTP callers, curio.js scripts, MCP AI assistants, browser extensions and plugins call the same operations with the same parameter schemas, permissions and error codes.
The API calls library entries items (matching the item.* namespace); user-facing feature docs refer to the same records as assets.
flowchart LR
HTTP["HTTP / curl / Python<br/>POST /api/v1/<ns>/<method>"] --> Router
JS["curio.js (Browser / Node / Extension)"] --> Router
MCP["MCP Client (AI Assistants)<br/>POST /mcp"] --> Router
PLUG["Plugin Pages & Programs<br/>Bridge / CURIO_API_TOKEN"] --> Router
subgraph Router["Curio API Router (127.0.0.1:41733)"]
REG["Unified Operation Registry<br/>164 operations · 11 permissions"]
SSE["Event Hub & SSE Stream<br/>POST /api/v1/events"]
end
Router --> W1["Open Library Window(s)"]
Router --> BG["Background Library Holder(s)"]
Transports¶
| Caller | Transport | Authentication | Best for |
|---|---|---|---|
| HTTP scripts & backends | POST http://127.0.0.1:41733/api/v1/<namespace>/<method> |
Authorization: Bearer curio_... token from Settings › API |
Python, PowerShell, curl, Rust, shell pipelines and custom integrations. See Web API and service discovery. |
| JavaScript / TypeScript | Served client /api/v1/curio.js + /api/v1/curio.d.ts |
Token (or automatic in plugin pages and plugin Node programs) | Browser extensions, Node.js tools and web apps. See JavaScript and TypeScript client. |
| MCP clients (AI assistants) | Streamable HTTP JSON-RPC at POST http://127.0.0.1:41733/mcp |
Bearer token + tool allowlist in Settings › MCP | Claude Desktop, IDEs and agents querying or organizing libraries. See Connect an MCP client. |
| Plugins (pages & programs) | Sandboxed postMessage bridge (pages) or loopback HTTP (CURIO_API_TOKEN) |
Plugin manifest permissions granted per library (implicit library.read, never library.manage) |
Extending Curio's UI, viewers, metadata readers, actions and URL handlers. See Plugins. |
Quick start¶
- Open Settings › API in Curio and turn on Enable API (default port
41733). - Create a token (for example with the Read only preset) and copy its secret (
curio_...). - Call
app.infooritem.query:
Operations¶
Every operation has a dotted name (item.add.fromUrls), an HTTP path (POST /api/v1/item/add/fromUrls), a curio.js method (curio.item.add.fromUrls(...)) and, where exposed to MCP, an underscored tool name (item_add_fromUrls).
| Task area | Namespace(s) | Reference page |
|---|---|---|
| App version, theme, fonts, caller capabilities, open URL | app.*, token.* |
Application · Current token |
| List, open, create, rename, style, stats, switch libraries | library.* |
Libraries and statistics |
| Inspect, survey, apply or split file-grouping rules | library.grouping.* |
Library grouping rules |
| Search, count, fetch items, EXIF, PNG text, visual similarity | item.* |
Find and read items |
| Import from paths, URLs, base64 bytes, bookmarks or beside an item | item.add.* |
Add files and links |
| Update title, notes, URL, rating, favorite, explicit, fields, tags, folders | item.* |
Edit items and membership |
| Download/stream files, thumbnails, previews, rotate, replace, write URLs | item.* |
Files, covers and derived previews |
| Manually group, split, detach, forget or re-allow grouping | item.* |
Group files into items |
| Duplicate, copy/move across libraries, export, trash, restore, purge | item.* |
Transfer, export and remove items |
| Open item in Curio/external app or reveal in file manager | item.* |
Open and reveal items |
| Manage folders, smart folders, tags, tag groups, fields, locations | folder.*, smartFolder.*, tag.*, tagGroup.*, field.*, location.* |
Folders · Smart folders · Tags · Tag groups · Fields · Locations |
| Validate queries, count facets, read/create archives, find/resolve duplicates | query.*, archive.*, duplicates.* |
Query · Archive · Duplicates |
| Control window selection, scope, search, filters, viewer, dialogs, clipboard | selection.*, view.*, viewer.*, ui.*, dialog.*, clipboard.* |
Selection · View · Viewer · UI · Dialogs · Clipboard |
| Plugin state/settings/logging, background jobs, external processes & tools | plugin.*, job.*, process.*, tool.* |
Plugin · Jobs · Process · Tools |
Events & types¶
- Query syntax & searchable fields: Learn the expression grammar in Query language and look up built-in fields in Searchable field dictionary.
- Resource shapes & TypeScript types: Start at Resource and type index, then see Items and pages, Libraries, storage and theme, Folders, tags and metadata, Views, operations and jobs and Client and event types.
- Real-time event stream: See how
POST /api/v1/eventsfilters, replays and reconnects in Subscribe to the event stream, then inspect all 24 public events across Libraries, Items & organization, Locations & scans, Selection, view & viewer and Jobs.
Capabilities¶
Any authenticated caller can discover its permitted operations and JSON Schemas at runtime by calling app.operations (requires only library.read):
For MCP clients, tools/list returns the exact subset of operations permitted by both the caller's token and the toggles enabled in Settings › MCP.
Versioning and compatibility¶
- Strict request parameters: Every operation rejects unknown top-level parameters with
bad_requestso newer client options are never silently ignored. Feature-detect newer parameters withapp.operations. - Additive responses and events: Operation responses and SSE event payloads grow by adding fields; clients should ignore unrecognized fields. Removing a field or changing its meaning introduces a new operation or API version (
/api/v2/).