Skip to content

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/&lt;ns&gt;/&lt;method&gt;"] --> 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

  1. Open Settings › API in Curio and turn on Enable API (default port 41733).
  2. Create a token (for example with the Read only preset) and copy its secret (curio_...).
  3. Call app.info or item.query:
curl -s http://127.0.0.1:41733/api/v1/item/query \
  -H "Authorization: Bearer curio_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{"query":"rating >= 4","limit":5}'
// Load Curio from http://127.0.0.1:41733/api/v1/curio.js (or require/import it in Node)
const curio = Curio.connect({ token: 'curio_your_token_here' })
const page = await curio.item.query({ query: 'rating >= 4', limit: 5 })
console.log(page.total, page.items)
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "item_query",
    "arguments": {
      "query": "rating >= 4",
      "limit": 5
    }
  }
}

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

Capabilities

Any authenticated caller can discover its permitted operations and JSON Schemas at runtime by calling app.operations (requires only library.read):

const ops = await curio.app.operations()
console.log(ops.map((o) => `${o.name} (${o.permission})`))

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_request so newer client options are never silently ignored. Feature-detect newer parameters with app.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/).