Skip to main content
See Library for the conceptual overview.

GET /documents

Tree listing — metadata only, no bodies.
appId: null means every app’s briefings read it. An id means only that app’s do. This is the owner’s own view, so private documents are included. Retrieval and every agent-facing path exclude them.

GET /documents/search

Semantic search (pgvector) with an ilike fallback. Returns snippets, not bodies — a five-result search shouldn’t cost five full documents.
limit defaults to 6, max 20. Snippets cut at 600 characters. Matching is cross-lingual — a Turkish query can hit an English document.

GET /documents/content

Full body plus the last 10 revisions (metadata only).
404 when there’s no document at that path.

PUT /documents

Create or overwrite by path. Writes a revision authored user.
Content is re-embedded only when it actually changed, so renaming a title doesn’t cost an embedding call.

PATCH /documents

Metadata only — scope, visibility, pin, title. Never touches the body and doesn’t bump the revision.
Use this rather than PUT when you’re only flipping a flag. PUT would need the body, and sending a stale one overwrites whatever was typed since you read it.

DELETE /documents

Removes the document and its revisions. Facts the agent already derived from it stay in the Vault.

POST /documents/seed

Idempotent. Creates business_context.md (pinned, as a heading skeleton) and AGENTS.md if they don’t exist.
seeded: false means both already existed.

Protected paths

business_context.md and AGENTS.md are read-only to the agent’s write_document tool — it has to propose a patch. Over this REST API and over MCP (behind confirm_owner_document) they’re writable, since the caller is you.