{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nexusquantum-legal/json-schema/nexusquantum-legal-analyze-request-schema.json",
  "title": "AnalyzeRequest",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nexusquantum-legal-openapi.json#/components/schemas/AnalyzeRequest",
  "type": "object",
  "required": [
    "text",
    "jurisdiction"
  ],
  "properties": {
    "text": {
      "type": "string",
      "minLength": 50,
      "maxLength": 50000,
      "description": "Legal document text to analyze."
    },
    "jurisdiction": {
      "type": "string",
      "description": "ISO country code. REQUIRED — no jurisdiction is assumed by default (400 MISSING_JURISDICTION if absent). A declared but unserved jurisdiction returns 422 JURISDICTION_NOT_SERVED, and the message lists the served ones. See GET /api/v1/jurisdictions for the full declared list."
    },
    "legalBranch": {
      "type": "string",
      "enum": [
        "adgm",
        "administratif",
        "administrativo",
        "agrario",
        "all",
        "ambiental",
        "amministrativo",
        "amparo",
        "appi",
        "arbeids",
        "arbeitsrecht",
        "arbitraje",
        "arbitration",
        "ayudas",
        "bankruptcy",
        "basic_law",
        "bbbee",
        "belasting",
        "bestuurs",
        "betreibungsrecht",
        "burgerlijk",
        "chiteki",
        "civil",
        "civile",
        "comercial",
        "commercial",
        "commerciale",
        "company",
        "competencia",
        "competition",
        "concursal",
        "constitucional",
        "constitutional",
        "constitutionnel",
        "consumidor",
        "consumo",
        "contract",
        "corporate",
        "costituzionale",
        "criminal",
        "datos",
        "difc",
        "dpdp",
        "employment",
        "empresarial",
        "equity",
        "eu",
        "eu_recht",
        "eu_retained",
        "europeen",
        "europeo",
        "europeu",
        "family",
        "fema",
        "financial",
        "finanzrecht",
        "fiscal",
        "foral",
        "fundamentales",
        "geunlobeop",
        "gyosei",
        "haengjeong",
        "handelsrecht",
        "heonbeop",
        "hyeongbeop",
        "immigration",
        "immobiliare",
        "immobilienrecht",
        "imobiliario",
        "inmobiliario",
        "insolvency",
        "insolvenzrecht",
        "intellectual",
        "intellectueel",
        "internacional",
        "inversiones",
        "investment",
        "jijeokjaesan",
        "keiji",
        "laboral",
        "labour",
        "lavoro",
        "ma",
        "mercado",
        "mercantil",
        "minbeop",
        "minero",
        "minpo",
        "minsa",
        "minso",
        "native_title",
        "obligationenrecht",
        "ondernemings",
        "pdpa",
        "pdpo",
        "penal",
        "penale",
        "pipa",
        "popia",
        "privacy",
        "procesal",
        "processual",
        "processuale",
        "processuel",
        "property",
        "propiedad",
        "propriete",
        "prozessrecht",
        "quebec",
        "rodo",
        "sangbeop",
        "sebeop",
        "sharia",
        "shoho",
        "steuerrecht",
        "straf",
        "strafrecht",
        "tax",
        "tort",
        "trabalho",
        "travail",
        "tributario",
        "verfassungsrecht",
        "verwaltungsrecht",
        "zei",
        "zivilrecht"
      ],
      "default": "civil",
      "description": "Legal branch of the analysis. The enum is the union of the branches of ALL supported jurisdictions — `contract`, `corporate`, `employment`, `property`, `pdpa`, `arbitration`, `financial` and the rest of the common-law ones alongside the continental-law codes — and the server validates against that same union: the branch is NOT restricted per jurisdiction. Send the branch your jurisdiction actually uses.\n\n⚠️ Omitting the field falls back to `civil`, a continental civil-law branch that carries no meaning in a common-law jurisdiction. That default is documented because the server really applies it, not because it is a sensible one — always send `legalBranch` explicitly."
    },
    "language": {
      "type": "string",
      "enum": [
        "es",
        "en"
      ],
      "description": "Response language. Optional — when omitted, the language FOLLOWS the jurisdiction (per-jurisdiction registry: SG→en, ES/CO→es, CH→de, …). An explicit supported value takes precedence."
    },
    "mode": {
      "type": "string",
      "enum": [
        "standard",
        "deep"
      ],
      "default": "standard",
      "description": "Analysis mode.\n\n• `standard` (1 credit): Node A only (Claude Opus 4.7).\n• `deep` (2 credits): Node A + Node B (DeepSeek V4-Pro) audits it adversarially, looking for hallucinations, false citations, omissions and jurisdictional errors. The response includes an `audit` object with structured findings.\n\nAccepted compat aliases: `agil` ⇄ `standard`, `auditoria` ⇄ `deep`."
    },
    "professionalRole": {
      "type": "string",
      "enum": [
        "persona",
        "abogado",
        "fiscal",
        "notario",
        "registrador",
        "juez",
        "asesor"
      ],
      "default": "abogado",
      "description": "Professional role the document is analyzed from. Changes the report's perspective.\n\nThe values are Spanish-language IDENTIFIERS — send them verbatim, they are not display text: Either spelling works: `lawyer`/`solicitor`/`barrister`, `prosecutor`, `notary`, `registrar`, `judge`, `in-house`, `individual` - or the original wire values, which keep working unchanged: `abogado` (lawyer), `fiscal` (prosecutor), `notario` (notary), `registrador` (registrar), `juez` (judge), `asesor` (adviser), `persona` (non-professional individual)."
    },
    "roleVariant": {
      "type": "string",
      "description": "Optional local seat when a jurisdiction splits one function into more than one office. England & Wales splits `abogado` into `solicitor` and `barrister`, which look at different things: the first at client risk, deadlines and SRA conduct duties; the second at the strength of the argument before the court and the overriding duty to it.\n\nAdditive — it never replaces `professionalRole`, which stays the wire value. A variant that does not exist in the active jurisdiction is not an error: that function simply is not split there, and the most common seat is used."
    },
    "proceduralSide": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "demandante",
        "demandado"
      ],
      "description": "Client's procedural position (demandante = claimant, demandado = respondent). Omit or `null` = neutral, no position. Modulates the perspective for the `abogado` and `persona` roles."
    },
    "negotiationProfile": {
      "type": "string",
      "enum": [
        "conservador",
        "equilibrado",
        "agresivo"
      ],
      "default": "equilibrado",
      "description": "Analysis profile. Spanish-language IDENTIFIERS, sent verbatim: `conservador` (conservative — maximizes risk alerts), `equilibrado` (balanced) or `agresivo` (aggressive — filters out non-blocking alerts)."
    },
    "referenceDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "Date of the case FACTS (lex temporis, YYYY-MM-DD). Deterministic citation verification checks that the cited rules were in force on this date, not today. Omit = today."
    }
  }
}