Skip to content
Download

HTTP API

The Imprint container runs a FastAPI server on port 8420. Everything the built-in dashboard does — search, ingest, retag, graph walks, sync, chat — is available over plain HTTP for any external client: a backend service pushing data, a CI job retagging after a merge, your own UI, or a quick curl to see what’s in memory.

Terminal window
# 1. Confirm the server is up
curl -s http://localhost:8420/api/version
# 2. Search the corpus
curl -s "http://localhost:8420/api/search?q=chunking+system&limit=5"
# 3. Enqueue an ingest job — returns {job_id, position}
curl -s -X POST http://localhost:8420/api/commands/ingest \
-H "Content-Type: application/json" \
-d '{"args": ["/workspace"], "project": "my-project"}'
# 4. Tail job output live (Server-Sent Events)
curl -N http://localhost:8420/api/jobs/<job_id>/stream

If you’re running in Docker, swap localhost:8420 for your container or proxy host — the base URL is the only thing that changes.

Endpoints are grouped by responsibility. The Postman collection mirrors this structure folder-for-folder so you can scan the reference and the collection side by side.

MethodPathPurpose
GET/api/versionInstalled imprint CLI version — cheap healthcheck.
GET/api/statsAggregate counts per project, type, and language.
GET/api/overviewBubble-chart overview. Repeat ?type= for multi-filter.
GET/api/timelineRecent activity feed. ?project=, ?limit=.
GET/api/cross-projectProject-to-project similarity matrix.
MethodPathPurpose
GET/api/searchSemantic search. Filters: q, project, type, limit.
GET/api/neighborsKNN over embeddings. ?id=<memory_id>&k=10.
GET/api/memory/{id}Full payload for a single memory.
GET/api/nodesGraph node list (positions + clusters) for visualization.
Terminal window
# Search only decisions in one project
curl -s "http://localhost:8420/api/search?q=chunking&project=imprint&type=decision&limit=10"
MethodPathPurpose
GET/api/sourcesAll indexed files with chunk counts.
GET/api/sources/summary/{source_key}Summary metadata for one source.
GET/api/source/{source_key}Chunks + tags + neighbors for one source.
MethodPathPurpose
GET/api/project/{name}Stats + top sources + top topics per project.
GET/api/topicsTopic facet counts.
GET/api/topic/{name}Projects + memories tagged with one topic.
GET/api/graphGraph walk. ?scope=root|project:X|topic:X|source:X|chunk:X&depth=1..3.
MethodPathPurpose
GET/api/kgFacts list. ?subject= partial match.
GET/api/kg/entity/{entity}Facts about one entity.
MethodPathPurpose
GET/api/workspacesList all workspaces + active one.
POST/api/workspace/switchSwitch active workspace. Body: {"name": "..."}.
POST/api/workspace/createCreate a new workspace. Body: {"name": "..."}.

Every queue-safe imprint CLI command is reachable here. The endpoint enqueues a background job, returns {job_id, position} immediately, and the job runs through the same single-slot queue the dashboard uses.

MethodPathPurpose
POST/api/commands/{command}Enqueue a command. See below for the allowlist.
GET/api/queueActive + queued + recent jobs.
GET/api/jobs/{id}Job status + exit code.
GET/api/jobs/{id}/streamSSE stream of live stdout/stderr.
POST/api/jobs/{id}/cancelSIGTERM the job (SIGKILL after 3 s).

Allowlisted commands: status, ingest, ingest-url, refresh, refresh-urls, retag, learn, config, wipe, sync, migrate, workspace.

Terminal window
# Ingest a URL in the "docs" project
curl -s -X POST http://localhost:8420/api/commands/ingest-url \
-H "Content-Type: application/json" \
-d '{"args": ["https://example.com/article"], "project": "docs"}'
MethodPathPurpose
POST/api/sync/exportWrite a snapshot bundle to a server-side path.
POST/api/sync/importRestore from a server-side bundle path.
GET/api/sync/export/downloadStream a zipped snapshot to the browser.
POST/api/sync/import/uploadMultipart upload of a zip bundle.
POST/api/sync/cancelCancel an active peer-sync session by session_id.
POST/api/sync/approveResolve the provider-side [y/n/t] prompt. Body: {"session_id": "...", "decision": "accept" | "trust" | "reject"}.
GET/api/desktop-learn/historyPreviously-indexed Claude Desktop / ChatGPT Desktop export zips (SHA-keyed).
POST/api/desktop-learn/scanOne-shot Downloads scan for new desktop-app conversation exports. Body (optional): {"paths": ["/extra/dir", ...]}. Returns the structured scan result used by the dashboard.

Peer sync between two machines still uses the CLI’s imprint sync command — see sync. The HTTP endpoints above cover snapshot-based sync (export → transfer zip → import) for cases where a direct WS connection isn’t available.

MethodPathPurpose
GET/api/configAll resolved config values + their source.
PUT/api/config/{key}Set a config key. Body: {"value": ...}.
Terminal window
# Turn on LLM tagging
curl -s -X PUT http://localhost:8420/api/config/tagger.llm \
-H "Content-Type: application/json" \
-d '{"value": true}'
MethodPathPurpose
GET/api/chat/statusConfigured provider + model + readiness.
GET/api/chat/sessionsList chat sessions.
POST/api/chat/sessionsCreate a new session.
GET/api/chat/sessions/{sid}Session transcript.
POST/api/chat/sessions/{sid}/renameRename session.
DELETE/api/chat/sessions/{sid}Delete session.
POST/api/chatSend a message. Returns an SSE stream of tokens + tool calls.

Three endpoints return Server-Sent Events:

  • /api/jobs/{id}/stream — live stdout/stderr for a background job
  • /api/chat — agent tokens + tool call events
  • /api/sync/serve and /api/sync/receive — peer-sync progress events

Use EventSource in the browser, sseclient in Python, or curl -N to consume. Postman shows raw bytes — useful for inspecting events but not for interactive streaming.

The HTTP API and the MCP server expose similar capabilities through different transports. Pick the one that matches your integration:

MCP (stdio)HTTP API
ConsumerCoding agents (Claude Code, Cursor, Copilot, Cline, OpenClaw)Anything that speaks HTTP
TransportJSON-RPC over stdioREST + SSE
AuthNone (local process)None by default — terminate TLS + auth at a proxy
Ingest contentingest_contentPOST /api/commands/ingest* (job queue)
SearchsearchGET /api/search
StreamingNativeSSE
Best forAgent integrationsExternal services, CI, dashboards

The API follows the same release channel as the rest of Imprint — see installation. The Postman collection in this repo is versioned alongside the code; the live OpenAPI schema at /openapi.json always matches the running container.