Skip to content

Reference

API Reference

The @sizls/pluck-api package ships a Hono-based REST API that wraps @sizls/pluck. Every route is typed, auth-protected (dual-mode: API key or JWT), policy-gated on mutations, and audit-logged.


When to use the API vs the CLI vs MCP

  • CLI – local scripts and one-off work. Lowest setup cost.
  • MCP – agents calling Pluck through Claude Desktop / Cursor / Continue. Stdio transport.
  • REST API – remote callers, hosted usage, languages other than TypeScript. Bearer-token auth, rate-limited, JSON in/out.

All three share the same @sizls/pluck runtime. Behaviour is identical; the transport differs.


Base URL + authentication

Hosted

https://api.pluck.run

Every /v1/* route requires one of:

Authorization: Bearer <api-key>          # API keys, programmatic
Authorization: Bearer <jwt>              # JWT, dashboard sessions

Public unauthenticated routes: /health, /v1/auth/*.

Self-hosted

Run the server locally:

Shell
npx @sizls/pluck-api serve --port 8787
# or, from source:
pnpm --filter @sizls/pluck-api dev

Route reference

Every route is versioned under /v1/.

Health

MethodPathDescription
GET/healthLiveness + uptime + version. No auth.

Response:

JSON
{ "status": "ok", "uptime": 1234.56, "version": "0.1.0" }

Pipeline phases

Wrappers around the core pipeline. Each returns a PluckResult serialised to JSON.

MethodPathBodyDescription
POST/v1/extract{ uri, format?, mode? }Run the full connect → navigate → extract pipeline.
POST/v1/act{ uri, action, input?, dryRun?, idempotencyKey?, confirm? }Run an action. Default dryRun: true – callers must pass dryRun: false to execute.
POST/v1/sense{ uri, detect?, resolution? }Run the sense phase on an audio/video URI.
POST/v1/snitch{ url, signed? }Privacy audit. When signed: true and a signing key is configured, the report is Ed25519-signed.

Monitors (drift detection)

Persistent URL watchers – poll on a schedule, emit an event on change, optionally fire a webhook.

MethodPathBodyDescription
GET/v1/monitorsList the caller's monitors.
POST/v1/monitors{ uri, checkInterval?, baselineHash?, webhookUrl? }Create a monitor.
GET/v1/monitors/:idFetch a monitor.
GET/v1/monitors/:id/diffsDrift history – every check that detected a change.
POST/v1/monitors/:id/baselineReset the baseline hash to the current content.
PATCH/v1/monitors/:idPartial monitorUpdate a monitor's config.
DELETE/v1/monitors/:idDelete a monitor.

Schedules (cron-driven runs)

Register a pipeline to run on a cron schedule.

MethodPathBodyDescription
GET/v1/schedulesList schedules.
POST/v1/schedules{ cronExpr, operation, config, isActive? }Create a schedule.
GET/v1/schedules/:idFetch a schedule.
PATCH/v1/schedules/:idPartial scheduleUpdate.
DELETE/v1/schedules/:idDelete.
POST/v1/schedules/:id/runManually trigger a scheduled run.

Recipes

Authoring surface for reusable pipelines.

MethodPathBodyDescription
GET/v1/recipesList the caller's recipes.
POST/v1/recipes{ name, matchPattern, options, isPublic? }Create.
GET/v1/recipes/:idFetch.
PATCH/v1/recipes/:idUpdate.
DELETE/v1/recipes/:idDelete.

Traces (Studio-backed pipeline replay)

Every pipeline run produces a trace. Traces can be inspected, shared, and replayed.

MethodPathBodyDescription
GET/v1/tracesList recent traces (paginated).
POST/v1/traces{ uri, durationMs, storageKey }Register a trace (internal; CLI uses this).
GET/v1/traces/:idFetch a trace.
GET/v1/traces/:id/shareGenerate a one-time share URL for the trace.
DELETE/v1/traces/:idDelete a trace.

Jobs (async work queue)

Long-running extract / act / sense operations run as jobs.

MethodPathBodyDescription
GET/v1/jobs?status=&type=&limit=List jobs.
GET/v1/jobs/:idFetch a job and its current status.

API keys

Programmatic management of API keys – dashboard-authenticated users call these with a JWT.

MethodPathBodyDescription
GET/v1/keysList keys (redacted).
POST/v1/keys{ name, rateLimit? }Create a new key. Returns the full key once.
DELETE/v1/keys/:idRevoke a key.

Auth

MethodPathBodyDescription
POST/v1/auth/signup{ email, password }Create an account. No auth.
POST/v1/auth/login{ email, password }Exchange credentials for a JWT. No auth.
GET/v1/auth/meReturn the authenticated user profile.

Dashboard

Aggregated reads for the hosted dashboard (/v1/dashboard/*). Not public API surface – subject to change.

MethodPathDescription
GET/v1/dashboard/statsUsage overview.
GET/v1/dashboard/usageTime-series credit usage.

Common patterns

Rate limiting

Every API key has a requestsPerMinute ceiling. When you exceed it, the server returns 429 Too Many Requests with a Retry-After header.

Idempotency

Mutation routes (/v1/act) honour an optional Idempotency-Key header. When two requests share the same key, the second returns the cached receipt from the first – no re-execution.

Errors

Errors follow a consistent shape:

JSON
{
  "error": {
    "code": "POLICY_DENIED",
    "message": "Action blocked by policy rule 'No destructive ops on prod'.",
    "phase": "act"
  }
}

HTTP status codes match REST conventions: 400 for bad input, 401 for missing auth, 403 for auth-present-but-denied, 404 for missing resources, 409 for conflicts, 422 for validation, 429 for rate limits, 500 for server errors.


OpenAPI

The full OpenAPI 3.1 spec is served at /openapi.json (backlog – see IDEAS.md under the Page 2 + Page 3 backlog for the auto-gen story). Until it lands, this page is the authoritative reference.


What's next

Edit this page on GitHub
Previous
CLI
Next
Errors

Ready to build?

Install Pluck and follow the Quick Start guide to wire MCP-first data pipelines into your agents and fleets in minutes.

Get started →