{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vaquill-ai/json-schema/vaquill-ai-page-fact-schema.json",
  "title": "Page[Fact]",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vaquill-ai-facts-api-openapi.yml#/components/schemas/Page_Fact_",
  "properties": {
    "data": {
      "items": {
        "$ref": "#/$defs/Fact"
      },
      "type": "array",
      "title": "Data",
      "description": "The rows in this window, in the collection's default order."
    },
    "pagination": {
      "$ref": "#/$defs/Pagination",
      "description": "Where this window sits in the full result set."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "data",
    "pagination"
  ],
  "$defs": {
    "Fact": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id",
          "description": "`fac_` identifier, stable for the life of this fact set."
        },
        "section": {
          "type": "string",
          "title": "Section",
          "description": "Which part of the ledger this fact was clustered into, for example `key_fact`, `party` or `chronology`. Publisher-controlled and open: read it, do not switch on an exhaustive list of it."
        },
        "factType": {
          "type": "string",
          "title": "Facttype",
          "description": "What kind of statement this is, for example `party`, `date`, `amount` or `obligation`. Open, for the same reason as `section`."
        },
        "canonicalText": {
          "type": "string",
          "title": "Canonicaltext",
          "description": "The fact as one sentence, merged across its sources."
        },
        "shortLabel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Shortlabel",
          "description": "A compact label for a table cell."
        },
        "explanation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Explanation",
          "description": "Rarely populated; the reducer leaves it empty by design."
        },
        "eventDate": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Eventdate",
          "description": "The date this fact is about, when it has one."
        },
        "eventDateEnd": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Eventdateend",
          "description": "The end of a date range, when the fact spans one."
        },
        "amountValue": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Amountvalue",
          "description": "The monetary amount, when the fact carries one."
        },
        "amountCurrency": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Amountcurrency",
          "description": "ISO code for `amountValue`."
        },
        "issueLabel": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Issuelabel",
          "description": "The issue this fact bears on."
        },
        "entities": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Entities",
          "description": "Party and entity names named by this fact."
        },
        "citations": {
          "items": {
            "$ref": "#/$defs/FactCitation"
          },
          "type": "array",
          "title": "Citations",
          "description": "Every passage behind the fact, `primary` first. Never empty on a generated fact."
        },
        "confidence": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Confidence",
          "description": "0 to 1, the strongest supporting passage's confidence."
        },
        "supportCount": {
          "type": "integer",
          "title": "Supportcount",
          "description": "How many passages support this fact."
        },
        "contradictionCount": {
          "type": "integer",
          "title": "Contradictioncount",
          "description": "How many rival statements of the same thing were found in the matter."
        },
        "isConflicted": {
          "type": "boolean",
          "title": "Isconflicted",
          "description": "True when the matter's documents state this fact more than one way. The rival statements are separate facts; this flags that they exist."
        },
        "position": {
          "type": "integer",
          "title": "Position",
          "description": "Ordering within the set: section first, then dated facts ascending, then the best-supported. It is a reading order, not a chronology."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "section",
        "factType",
        "canonicalText",
        "supportCount",
        "contradictionCount",
        "isConflicted",
        "position"
      ],
      "title": "Fact",
      "description": "One clustered statement, with every passage that supports it."
    },
    "FactCitation": {
      "properties": {
        "documentId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Documentid",
          "description": "The `doc_` document this passage came from, or null when the citation predates a document that has since been deleted."
        },
        "documentName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Documentname",
          "description": "The document's filename at the moment the set was generated."
        },
        "quote": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Quote",
          "description": "The verbatim passage. This is the citation's anchor: locate it in the document's text rather than relying on any offset."
        },
        "pageStart": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pagestart",
          "description": "First page the quote appears on."
        },
        "pageEnd": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pageend",
          "description": "Last page the quote appears on."
        },
        "citationRole": {
          "type": "string",
          "title": "Citationrole",
          "description": "`primary` for the strongest passage behind the fact, `support` for the others that were clustered with it.",
          "default": "support"
        },
        "sourceAvailable": {
          "type": "boolean",
          "title": "Sourceavailable",
          "description": "False when the document this quote came from is no longer in the workspace. The quote is still accurate (it is a snapshot), but there is nothing to fetch and nothing to highlight it in."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "sourceAvailable"
      ],
      "title": "FactCitation",
      "description": "One verified passage behind a fact.\n\nAn immutable snapshot taken when the set was generated, so it survives the\ndocument being deleted and the evidence being re-extracted. Resolve it by\nsearching for `quote` inside `GET /v1/matters/{matterId}/documents/{id}/text`;\nthat is the durable mechanism, and it is what the product's own verifier\nuses."
    },
    "Pagination": {
      "properties": {
        "limit": {
          "type": "integer",
          "title": "Limit",
          "description": "The `limit` that was applied to this request."
        },
        "offset": {
          "type": "integer",
          "title": "Offset",
          "description": "The `offset` that was applied to this request."
        },
        "total": {
          "type": "integer",
          "title": "Total",
          "description": "Total rows matching the filter, not the number returned in `data`. Use it to size a job before running it."
        },
        "hasMore": {
          "type": "boolean",
          "title": "Hasmore",
          "description": "True when rows remain beyond this window. Derived from `offset + len(data) < total`, so a full final page correctly reports `false` rather than sending you after an empty page."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "limit",
        "offset",
        "total",
        "hasMore"
      ],
      "title": "Pagination",
      "description": "Where the caller is, and whether there is more.\n\n`total` is the count of rows matching the filter, not the count returned,\nso a caller can size a job before running it."
    }
  }
}