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 anilike 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).PUT /documents
Create or overwrite by path. Writes a revision authoreduser.
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.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
POST /documents/seed
Idempotent. Createsbusiness_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.
Related
- Library — scope, pinning, retrieval, and the agent’s tools
- Company API — the structured profile fields
- Knowledge Patches API — proposed changes to protected documents

