{
  "info": {
    "name": "Imprint API",
    "description": "Postman collection for the Imprint dashboard API (FastAPI, default port 8420).\n\nThe same HTTP surface that powers the built-in dashboard is exposed for any external client: browse and search memories, enqueue CLI jobs (ingest, retag, wipe), export/import snapshots, drive peer sync, and manage workspaces + config.\n\n**Base URL:** set the `base_url` collection variable. Default is `http://localhost:8420`. For a remote deployment behind TLS, use `https://imprint.yourdomain.com`.\n\n**Authentication:** none by default — the API is designed to run on localhost or behind a reverse proxy that handles auth. Don't expose it to the public internet without one.\n\n**Companion docs:** https://imprintmcp.alexandruleca.com/api\n**OpenAPI schema:** `GET {{base_url}}/openapi.json` (auto-generated by FastAPI; import into any OpenAPI-aware tool).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_postman_id": "imprint-api-v1"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "http://localhost:8420",
      "type": "string",
      "description": "Imprint API root. Change for remote deployments."
    },
    {
      "key": "workspace",
      "value": "default",
      "type": "string",
      "description": "Active workspace name. Used by endpoints that accept a ?workspace= filter."
    }
  ],
  "item": [
    {
      "name": "Overview & stats",
      "description": "Entry-point endpoints for dashboards and health checks.",
      "item": [
        {
          "name": "Version",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/version",
              "host": ["{{base_url}}"],
              "path": ["api", "version"]
            },
            "description": "Installed imprint CLI version. Cheap — use for healthchecks and deploy verification."
          }
        },
        {
          "name": "Stats",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/stats",
              "host": ["{{base_url}}"],
              "path": ["api", "stats"]
            },
            "description": "Aggregate counts: memories, chunks, sources, facts per project/type/language."
          }
        },
        {
          "name": "Overview",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/overview?type=decision&type=pattern&limit=100",
              "host": ["{{base_url}}"],
              "path": ["api", "overview"],
              "query": [
                { "key": "type", "value": "decision", "description": "Repeat to filter multiple types." },
                { "key": "type", "value": "pattern" },
                { "key": "limit", "value": "100" }
              ]
            },
            "description": "Bubble-chart overview of projects sized by memory count, grouped by type."
          }
        },
        {
          "name": "Timeline",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/timeline?project=&limit=500",
              "host": ["{{base_url}}"],
              "path": ["api", "timeline"],
              "query": [
                { "key": "project", "value": "", "description": "Empty = all projects." },
                { "key": "limit", "value": "500" }
              ]
            },
            "description": "Recent activity feed: memories + facts, newest first."
          }
        },
        {
          "name": "Cross-project similarity",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/cross-project",
              "host": ["{{base_url}}"],
              "path": ["api", "cross-project"]
            },
            "description": "Similarity matrix between projects — shared concepts / overlapping topics."
          }
        }
      ]
    },
    {
      "name": "Search & retrieval",
      "item": [
        {
          "name": "Semantic search",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/search?q=chunking system&limit=10&project=&type=",
              "host": ["{{base_url}}"],
              "path": ["api", "search"],
              "query": [
                { "key": "q", "value": "chunking system" },
                { "key": "limit", "value": "10" },
                { "key": "project", "value": "", "description": "Filter (empty = all)." },
                { "key": "type", "value": "", "description": "decision | pattern | bug | architecture | finding" }
              ]
            },
            "description": "Vector search across all memories. Filters compose with AND."
          }
        },
        {
          "name": "Neighbors (KNN)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/neighbors?id=&k=10",
              "host": ["{{base_url}}"],
              "path": ["api", "neighbors"],
              "query": [
                { "key": "id", "value": "", "description": "Memory id (from search results)." },
                { "key": "k", "value": "10" }
              ]
            },
            "description": "K-nearest neighbors over the embedding space for a given memory."
          }
        },
        {
          "name": "Memory by id",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/memory/:mid",
              "host": ["{{base_url}}"],
              "path": ["api", "memory", ":mid"],
              "variable": [
                { "key": "mid", "value": "", "description": "Full memory id, URL-encoded." }
              ]
            },
            "description": "Fetch a single memory's full payload."
          }
        },
        {
          "name": "Nodes (graph shape)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/nodes?project=&limit=500",
              "host": ["{{base_url}}"],
              "path": ["api", "nodes"],
              "query": [
                { "key": "project", "value": "" },
                { "key": "limit", "value": "500" }
              ]
            },
            "description": "Graph node list for visualization — memory + cluster coordinates."
          }
        }
      ]
    },
    {
      "name": "Projects & topics",
      "item": [
        {
          "name": "Project detail",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/project/:name",
              "host": ["{{base_url}}"],
              "path": ["api", "project", ":name"],
              "variable": [
                { "key": "name", "value": "imprint", "description": "URL-encoded project name." }
              ]
            },
            "description": "Stats + top sources + top topics for one project."
          }
        },
        {
          "name": "Topics",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/topics?type=decision&limit=100",
              "host": ["{{base_url}}"],
              "path": ["api", "topics"],
              "query": [
                { "key": "type", "value": "decision" },
                { "key": "limit", "value": "100" }
              ]
            },
            "description": "Topic facets across the corpus. Repeat `type` for multi-select."
          }
        },
        {
          "name": "Topic detail",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/topic/:name",
              "host": ["{{base_url}}"],
              "path": ["api", "topic", ":name"],
              "variable": [
                { "key": "name", "value": "caching" }
              ]
            },
            "description": "Projects + memories tagged with a specific topic."
          }
        },
        {
          "name": "Graph scope",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/graph?scope=root&depth=1",
              "host": ["{{base_url}}"],
              "path": ["api", "graph"],
              "query": [
                { "key": "scope", "value": "root", "description": "root | project:<name> | topic:<name> | source:<path> | chunk:<id>" },
                { "key": "depth", "value": "1", "description": "1–3" }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Sources",
      "item": [
        {
          "name": "List sources",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/sources?project=&limit=500",
              "host": ["{{base_url}}"],
              "path": ["api", "sources"],
              "query": [
                { "key": "project", "value": "" },
                { "key": "limit", "value": "500" }
              ]
            },
            "description": "All indexed source files + chunk counts."
          }
        },
        {
          "name": "Source summary",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/sources/summary/:source_key?project=",
              "host": ["{{base_url}}"],
              "path": ["api", "sources", "summary", ":source_key"],
              "variable": [
                { "key": "source_key", "value": "", "description": "URL-encoded source key (path or URL)." }
              ],
              "query": [
                { "key": "project", "value": "" }
              ]
            }
          }
        },
        {
          "name": "Source lineage",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/source/:source_key",
              "host": ["{{base_url}}"],
              "path": ["api", "source", ":source_key"],
              "variable": [
                { "key": "source_key", "value": "" }
              ]
            },
            "description": "Full chunk list + tags + neighbors for one source."
          }
        }
      ]
    },
    {
      "name": "Knowledge graph",
      "item": [
        {
          "name": "Facts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/kg?subject=&limit=200",
              "host": ["{{base_url}}"],
              "path": ["api", "kg"],
              "query": [
                { "key": "subject", "value": "" },
                { "key": "limit", "value": "200" }
              ]
            }
          }
        },
        {
          "name": "Entity facts",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/kg/entity/:entity",
              "host": ["{{base_url}}"],
              "path": ["api", "kg", "entity", ":entity"],
              "variable": [
                { "key": "entity", "value": "ingestion" }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Workspaces",
      "item": [
        {
          "name": "List workspaces",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/workspaces",
              "host": ["{{base_url}}"],
              "path": ["api", "workspaces"]
            }
          }
        },
        {
          "name": "Switch active workspace",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"{{workspace}}\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/workspace/switch",
              "host": ["{{base_url}}"],
              "path": ["api", "workspace", "switch"]
            }
          }
        },
        {
          "name": "Create workspace",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"my-workspace\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/workspace/create",
              "host": ["{{base_url}}"],
              "path": ["api", "workspace", "create"]
            }
          }
        }
      ]
    },
    {
      "name": "CLI commands (enqueue)",
      "description": "Run CLI commands as background jobs. Each returns a `{job_id, position}`; stream live output from `/api/jobs/{job_id}/stream` and cancel with `/api/jobs/{job_id}/cancel`.\n\nAllowed commands: `status`, `ingest`, `ingest-url`, `refresh`, `refresh-urls`, `retag`, `learn`, `config`, `wipe`, `sync`, `migrate`, `workspace`.",
      "item": [
        {
          "name": "Enqueue: ingest",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"args\": [\"/workspace\"],\n  \"project\": \"my-project\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/commands/ingest",
              "host": ["{{base_url}}"],
              "path": ["api", "commands", "ingest"]
            },
            "description": "Ingest a directory. `args[0]` is the target path as seen from the server."
          }
        },
        {
          "name": "Enqueue: ingest-url",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"args\": [\"https://example.com/docs\"],\n  \"project\": \"docs\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/commands/ingest-url",
              "host": ["{{base_url}}"],
              "path": ["api", "commands", "ingest-url"]
            }
          }
        },
        {
          "name": "Enqueue: retag",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"args\": [\"--project\", \"my-project\"]\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/commands/retag",
              "host": ["{{base_url}}"],
              "path": ["api", "commands", "retag"]
            }
          }
        },
        {
          "name": "Queue snapshot",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/queue?recent_limit=20",
              "host": ["{{base_url}}"],
              "path": ["api", "queue"],
              "query": [
                { "key": "recent_limit", "value": "20" }
              ]
            },
            "description": "Active + queued + recent jobs."
          }
        },
        {
          "name": "Job detail",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/jobs/:job_id",
              "host": ["{{base_url}}"],
              "path": ["api", "jobs", ":job_id"],
              "variable": [
                { "key": "job_id", "value": "" }
              ]
            }
          }
        },
        {
          "name": "Job stream (SSE)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/jobs/:job_id/stream",
              "host": ["{{base_url}}"],
              "path": ["api", "jobs", ":job_id", "stream"],
              "variable": [
                { "key": "job_id", "value": "" }
              ]
            },
            "description": "Server-Sent Events stream of live stdout/stderr. Postman shows raw bytes — use curl or EventSource for interactive streaming."
          }
        },
        {
          "name": "Cancel job",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/jobs/:job_id/cancel",
              "host": ["{{base_url}}"],
              "path": ["api", "jobs", ":job_id", "cancel"],
              "variable": [
                { "key": "job_id", "value": "" }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Sync",
      "description": "Snapshot export/import and peer-sync session control.",
      "item": [
        {
          "name": "Export snapshot (server-side)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"workspace\": \"default\",\n  \"output\": \"/tmp/imprint-snapshot\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/sync/export",
              "host": ["{{base_url}}"],
              "path": ["api", "sync", "export"]
            },
            "description": "Create a snapshot bundle on the server filesystem."
          }
        },
        {
          "name": "Import snapshot (server-side)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"path\": \"/tmp/imprint-snapshot\",\n  \"workspace\": \"default\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/sync/import",
              "host": ["{{base_url}}"],
              "path": ["api", "sync", "import"]
            }
          }
        },
        {
          "name": "Download snapshot (browser)",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/sync/export/download",
              "host": ["{{base_url}}"],
              "path": ["api", "sync", "export", "download"]
            },
            "description": "Create + zip snapshot and stream to client."
          }
        },
        {
          "name": "Upload snapshot (browser)",
          "request": {
            "method": "POST",
            "header": [],
            "body": {
              "mode": "formdata",
              "formdata": [
                { "key": "file", "type": "file", "src": "" }
              ]
            },
            "url": {
              "raw": "{{base_url}}/api/sync/import/upload",
              "host": ["{{base_url}}"],
              "path": ["api", "sync", "import", "upload"]
            },
            "description": "Multipart upload: attach a zip bundle previously created by `export/download`."
          }
        },
        {
          "name": "Cancel sync session",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"session_id\": \"\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/sync/cancel",
              "host": ["{{base_url}}"],
              "path": ["api", "sync", "cancel"]
            }
          }
        },
        {
          "name": "Approve sync session (provider-side [y/n/t])",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"session_id\": \"\",\n  \"decision\": \"accept\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/sync/approve",
              "host": ["{{base_url}}"],
              "path": ["api", "sync", "approve"]
            },
            "description": "Resolve a pending provider-side approval after /api/sync/serve emits `approval_required`. `decision` must be one of `accept` (one-time), `trust` (accept + persist fingerprint), or `reject`. 404 if no approval is pending (already decided, cancelled, or auto-accepted because the peer fingerprint is already trusted)."
          }
        },
        {
          "name": "Desktop exports history",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/desktop-learn/history",
              "host": ["{{base_url}}"],
              "path": ["api", "desktop-learn", "history"]
            },
            "description": "Previously-indexed Claude Desktop / ChatGPT Desktop export zips, keyed by SHA. Used by the dashboard to render the 'Indexed exports' list."
          }
        },
        {
          "name": "Scan Downloads for desktop exports",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"paths\": []\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/desktop-learn/scan",
              "host": ["{{base_url}}"],
              "path": ["api", "desktop-learn", "scan"]
            },
            "description": "One-shot scan of the user's Downloads folder(s) for Claude / ChatGPT Desktop conversation exports. WSL-aware — probes both the Linux home and /mnt/c/Users/<user>/Downloads. `paths` adds extra scan roots. Dedups by SHA-256, so re-runs are cheap."
          }
        }
      ]
    },
    {
      "name": "Config",
      "item": [
        {
          "name": "Get all config",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/config",
              "host": ["{{base_url}}"],
              "path": ["api", "config"]
            },
            "description": "Resolved config values + source (default / env / config.json)."
          }
        },
        {
          "name": "Set config key",
          "request": {
            "method": "PUT",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"value\": true\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/config/:key",
              "host": ["{{base_url}}"],
              "path": ["api", "config", ":key"],
              "variable": [
                { "key": "key", "value": "tagger.llm", "description": "Dotted config key, e.g. tagger.llm" }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Chat",
      "item": [
        {
          "name": "Chat status",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/chat/status",
              "host": ["{{base_url}}"],
              "path": ["api", "chat", "status"]
            },
            "description": "Configured provider + model + whether it's ready."
          }
        },
        {
          "name": "List sessions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/chat/sessions",
              "host": ["{{base_url}}"],
              "path": ["api", "chat", "sessions"]
            }
          }
        },
        {
          "name": "Create session",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/chat/sessions",
              "host": ["{{base_url}}"],
              "path": ["api", "chat", "sessions"]
            }
          }
        },
        {
          "name": "Send message (streamed)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"session_id\": \"\",\n  \"message\": \"What projects touch the ingestion pipeline?\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/chat",
              "host": ["{{base_url}}"],
              "path": ["api", "chat"]
            },
            "description": "Returns an SSE stream of agent tokens + tool calls. Consume via EventSource for best UX."
          }
        },
        {
          "name": "Rename session",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Ingestion deep-dive\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/chat/sessions/:sid/rename",
              "host": ["{{base_url}}"],
              "path": ["api", "chat", "sessions", ":sid", "rename"],
              "variable": [{ "key": "sid", "value": "" }]
            }
          }
        },
        {
          "name": "Delete session",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{base_url}}/api/chat/sessions/:sid",
              "host": ["{{base_url}}"],
              "path": ["api", "chat", "sessions", ":sid"],
              "variable": [{ "key": "sid", "value": "" }]
            }
          }
        }
      ]
    }
  ]
}
