{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tale-dev/json-schema/tale-dev-knowledge-entry-schema.json",
  "title": "KnowledgeEntry",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tale-dev-knowledge-api-openapi.yml#/components/schemas/KnowledgeEntry",
  "type": "object",
  "required": [
    "id",
    "topic",
    "content",
    "status",
    "source",
    "createdBy",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "topic": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "superseded"
      ]
    },
    "source": {
      "type": "string",
      "enum": [
        "chat",
        "manual",
        "api",
        "agent"
      ],
      "description": "The lane the fact came through: `chat` (the assistant captured it), `manual` (typed into the Knowledge entries form), `api` (this door — a create or supersede over REST) or `agent` (a project agent or an automation’s agent step granted `knowledge_entry_write`; `createdBy` then names the agent — a project agent’s id or `automation:<name>` — not a user)"
    },
    "documentId": {
      "type": "string",
      "description": "The indexed Hub document the topic’s versions are stored in (`sourceProvider: knowledge`): `GET /api/v1/documents/{id}` reads its metadata and `indexing` state, `GET /api/v1/documents/{id}/content` its bytes — the active version’s text. A direct delete or content edit of that document is refused — this entry is the way to change it"
    },
    "supersededBy": {
      "type": "string",
      "description": "The row that replaced this one"
    },
    "supersededAt": {
      "type": "integer",
      "minimum": 0,
      "description": "When this row was replaced — present on a superseded row only"
    },
    "createdBy": {
      "type": "string"
    },
    "createdAt": {
      "type": "integer",
      "minimum": 0,
      "description": "Epoch milliseconds"
    }
  }
}