{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getoneprofile-ai/json-schema/getoneprofile-ai-ai-context-qa-entry-schema-schema.json",
  "title": "AiContextQaEntrySchema",
  "description": "One question the workspace answered once, which every reply the agents write reads.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getoneprofile-ai-ai-context-api-openapi.yml#/components/schemas/AiContextQaEntrySchema",
  "properties": {
    "answer": {
      "description": "The answer the agents state when a reply asks it.",
      "title": "Answer",
      "type": "string"
    },
    "created_at": {
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "created_by_user_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Who first wrote it, or null for an API key.",
      "title": "Created By User Id"
    },
    "id": {
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "in_prompt": {
      "default": true,
      "description": "Whether the agents read this answer: the newest answers that fit `max_qa_context_chars` (GET /ai-context/) in each prompt it reaches do. Computed on the list; a single entry reports true.",
      "title": "In Prompt",
      "type": "boolean"
    },
    "previous_answer": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The answer this one replaced, or null when it was never changed.",
      "title": "Previous Answer"
    },
    "question": {
      "description": "The question, as last worded.",
      "title": "Question",
      "type": "string"
    },
    "sequence_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The one sequence whose agent reads this answer, or null for every sequence. Where a sequence's own answer and the one for every sequence answer the same question, that sequence's agent reads its own.",
      "title": "Sequence Id"
    },
    "sequence_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The name of `sequence_id`'s sequence; null for every sequence, or when that sequence is gone.",
      "title": "Sequence Name"
    },
    "source_thread_id": {
      "anyOf": [
        {
          "format": "uuid",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "The inbox conversation whose question it answered, or null when it was written on the Q&A list or that conversation was deleted.",
      "title": "Source Thread Id"
    },
    "updated_at": {
      "format": "date-time",
      "title": "Updated At",
      "type": "string"
    },
    "updated_by_user_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Who wrote the answer as it stands, or null for an API key.",
      "title": "Updated By User Id"
    },
    "via": {
      "$ref": "#/$defs/QaVia",
      "description": "How the answer as it stands was written: `person` on the dashboard, `assistant` by the AI Assistant or an MCP client for a person, `api` by an API key."
    }
  },
  "required": [
    "id",
    "question",
    "answer",
    "previous_answer",
    "created_by_user_id",
    "created_at",
    "updated_by_user_id",
    "updated_at",
    "via",
    "source_thread_id",
    "sequence_id"
  ],
  "type": "object",
  "$defs": {
    "QaVia": {
      "description": "How a Q&A entry's answer, as it stands, was written (G5/G6, 2026-10-19).\n\nA person on the dashboard, an AI assistant working for one (the in-product Assistant\nor an MCP client), or an API key with nobody behind it.",
      "enum": [
        "person",
        "assistant",
        "api"
      ],
      "title": "QaVia",
      "type": "string"
    }
  }
}