{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/athenahq-ai/json-schema/athenahq-ai-brand-fact-ingest-outcome-schema.json",
  "title": "BrandFactIngestOutcome",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/athenahq-ai-knowledge-base-api-openapi.yml#/components/schemas/BrandFactIngestOutcome",
  "type": "object",
  "properties": {
    "index": {
      "type": "integer",
      "description": "Position of the fact in the request's facts array."
    },
    "outcome": {
      "type": "string",
      "enum": [
        "approved",
        "pending",
        "duplicate"
      ],
      "description": "What the ingestion pipeline decided. Extensible: new outcome values may be added as the pipeline evolves — treat unknown values as non-terminal."
    },
    "fact_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The created fact's id; null for duplicates (nothing was inserted)."
    },
    "pillar_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The pillar the fact was filed under (pinned or auto-routed); null when unfiled."
    },
    "matches": {
      "type": "array",
      "description": "Present when the fact was not added because facts already in the Knowledge Base say something similar (outcome is `duplicate`). Review them and resolve with a second call.",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved"
            ]
          },
          "source_type": {
            "type": "string",
            "enum": [
              "research",
              "upload",
              "content_hub"
            ],
            "description": "How the fact entered the Knowledge Base: found by research, uploaded, or taken from your content."
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "first_party": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The source is on your own domains; null when the fact has no source."
          },
          "pillar_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "pillar_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "text",
          "status",
          "source_type",
          "source_url",
          "first_party",
          "pillar_id",
          "pillar_name",
          "created_at"
        ]
      }
    }
  },
  "required": [
    "index",
    "outcome",
    "fact_id",
    "pillar_id"
  ]
}