HeadlessOps
API Reference

Knowledge Base API

REST API reference for workspace knowledge base documents

Knowledge Base API

Knowledge base endpoints use session authentication and are scoped to a workspace.

Endpoints

GET /api/workspaces/:workspaceId/knowledge-docs

List knowledge base documents.

Auth: Session | Min Role: VIEWER | MCP: mcp:tools

Query: search (full-text on title + content), label (filter by label)

Response: [{ id, title, labels, snippet, createdAt, updatedAt, createdByEmail }]


GET /api/workspaces/:workspaceId/knowledge-docs/labels/all

List all labels used across knowledge base documents.

Auth: Session | Min Role: VIEWER | MCP: mcp:tools

Response: ["architecture", "conventions", "crm", ...]


GET /api/workspaces/:workspaceId/knowledge-docs/:id

Get a single document with full Markdown content.

Auth: Session | Min Role: VIEWER | MCP: mcp:tools

Response: { id, title, content, labels, createdAt, updatedAt, createdByEmail }


POST /api/workspaces/:workspaceId/knowledge-docs

Create a new knowledge base document.

Auth: Session | Min Role: DEVELOPER | MCP: mcp:tools

Body:

{
  "title": "Airtable CRM Schema",
  "content": "# Airtable CRM\n\nBase ID: appXXX",
  "labels": ["data-sources", "crm"]
}

Response: 201 document object


PUT /api/workspaces/:workspaceId/knowledge-docs/:id

Update a knowledge base document.

Auth: Session | Min Role: DEVELOPER | MCP: mcp:tools

Body: { "title"?, "content"?, "labels"? }

Response: Updated document object


DELETE /api/workspaces/:workspaceId/knowledge-docs/:id

Delete a knowledge base document.

Auth: Session | Min Role: DEVELOPER | MCP: mcp:tools

Response: { "success": true }