{
 "openapi": "3.1.0",
 "info": {
  "title": "nautris",
  "version": "0.9.3"
 },
 "paths": {
  "/v1/health": {
   "get": {
    "tags": [
     "System"
    ],
    "summary": "Health",
    "description": "Liveness by default (cheap, always 200). `?deep=true` is readiness:\nit verifies the job DB is writable, disk has headroom, and the RAG\nindex is reachable, returning 503 if any check fails - so a load\nbalancer can evict a degraded node instead of routing into it.",
    "operationId": "health_v1_health_get",
    "parameters": [
     {
      "name": "deep",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Deep"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs": {
   "post": {
    "tags": [
     "Jobs"
    ],
    "summary": "Create Job",
    "operationId": "create_job_v1_jobs_post",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_create_job_v1_jobs_post"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "List Jobs",
    "description": "The caller's jobs, most recent first. Page with `?cursor=`; the next\npage token is returned in the `X-Next-Cursor` header (absent = last page).",
    "operationId": "list_jobs_v1_jobs_get",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 50,
       "title": "Limit"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Cursor"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/Job"
         },
         "title": "Response List Jobs V1 Jobs Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/ingest": {
   "post": {
    "tags": [
     "Jobs"
    ],
    "summary": "Ingest Document",
    "description": "Persist an EXTERNALLY extracted document as a finished job.\n\nThe GPU-burst return path (console-next-work Phase B): the serverless\nworker runs extract -> clean -> analyze off-box and the gateway posts\nthe results here; this deployment stays the system of record (tree,\nsemantics, assets on disk; chunking + indexing + metering local).\nBody: {tree, semantics?, assets? (name -> base64), source_bytes?}.",
    "operationId": "ingest_document_v1_ingest_post",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": true,
        "title": "Payload"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Get Job",
    "operationId": "get_job_v1_jobs__job_id__get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Jobs"
    ],
    "summary": "Delete Job",
    "description": "Data lifecycle (\u00a76): remove a job COMPLETELY - artifacts, stored\noriginals, indexed chunks, and records. GDPR-grade deletion for\nself-hosters and the retention backbone for hosted deployments.\nRunning jobs must finish or dead-letter first (409): a worker\nmid-parse would resurrect files the caller believes are gone.",
    "operationId": "delete_job_v1_jobs__job_id__delete",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/tree": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Get Tree",
    "description": "The canonical tree. ?redacted=true masks PII fail-closed (everything\nnot explicitly rejected in review)\n(\u00a74.4) without mutating the stored original.",
    "operationId": "get_tree_v1_jobs__job_id__documents__document_id__tree_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "redacted",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Redacted"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Get Tree V1 Jobs  Job Id  Documents  Document Id  Tree Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/search": {
   "get": {
    "tags": [
     "Search"
    ],
    "summary": "Search",
    "description": "mode: vector (semantic, default) | fts (BM25 keyword) | hybrid\n(both, RRF-fused). fts/hybrid degrade to vector when no FTS index\nexists yet (pre-upgrade tables).",
    "operationId": "search_v1_search_get",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Q"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 5,
       "title": "Limit"
      }
     },
     {
      "name": "document_id",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Document Id"
      }
     },
     {
      "name": "mode",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "vector",
       "title": "Mode"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "additionalProperties": true
         },
         "title": "Response Search V1 Search Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/dead-letters": {
   "get": {
    "tags": [
     "System"
    ],
    "summary": "Dead Letters",
    "description": "Which of the caller's documents failed, and exactly why (\u00a75).\nPaginated via `?cursor=` / `X-Next-Cursor` (see GET /v1/jobs).",
    "operationId": "dead_letters_v1_dead_letters_get",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 100,
       "title": "Limit"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Cursor"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "additionalProperties": true
         },
         "title": "Response Dead Letters V1 Dead Letters Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/stats": {
   "get": {
    "tags": [
     "System"
    ],
    "summary": "Stats",
    "description": "`queue_tasks` is DEPLOYMENT-WIDE queue depth (counts only, no IDs or\ncontent) - visible to every key, like `/metrics` and the page counter in\n`/v1/license`. `my_jobs` is scoped to the caller.",
    "operationId": "stats_v1_stats_get",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Stats V1 Stats Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/sources": {
   "post": {
    "tags": [
     "Sources"
    ],
    "summary": "Register Source",
    "description": "Register a directory the engine pulls from (\u00a79). The path lives on\nthe server/volume - this is the self-hosted pull model, optionally\nfenced by source_root (NAUTRIS_SOURCE_ROOT).",
    "operationId": "register_source_v1_sources_post",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": true,
        "title": "Body"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Source"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Sources"
    ],
    "summary": "List Sources",
    "operationId": "list_sources_v1_sources_get",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/Source"
         },
         "title": "Response List Sources V1 Sources Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/sources/{source_id}/sync": {
   "post": {
    "tags": [
     "Sources"
    ],
    "summary": "Sync Source",
    "description": "Delta sync: process only new/changed files; un-index removed ones.",
    "operationId": "sync_source_v1_sources__source_id__sync_post",
    "parameters": [
     {
      "name": "source_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Source Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SyncReport"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/export/finetune": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Export Finetune",
    "description": "\u00a78 second output path: the job's chunks as fine-tune JSONL.\nBehavioral adaptation, not knowledge injection - see finetune.py.\n\nOptional training-data gates (all off by default): ?dedup=true drops\nexact + near-duplicate chunks across the whole job; ?min_chars/\n?max_chars/?language filter records; ?split=train|val&val_ratio=0.05\nis a deterministic hash split (same corpus -> same split, anywhere).",
    "operationId": "export_finetune_v1_jobs__job_id__export_finetune_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "style",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "completion",
       "title": "Style"
      }
     },
     {
      "name": "dedup",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Dedup"
      }
     },
     {
      "name": "min_chars",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "title": "Min Chars"
      }
     },
     {
      "name": "max_chars",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer"
        },
        {
         "type": "null"
        }
       ],
       "title": "Max Chars"
      }
     },
     {
      "name": "language",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Language"
      }
     },
     {
      "name": "split",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Split"
      }
     },
     {
      "name": "val_ratio",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "default": 0.05,
       "title": "Val Ratio"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/semantics": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Get Semantics",
    "description": "\u00a714 semantic layer: the analyzers' typed objects over this\ndocument's CDOM, every object traceable to its evidence block IDs.\nPre-\u00a714 documents return an empty semantic document.",
    "operationId": "get_semantics_v1_jobs__job_id__documents__document_id__semantics_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Get Semantics V1 Jobs  Job Id  Documents  Document Id  Semantics Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/fields": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Get Fields",
    "description": "Labelled key-value fields (invoice number, total, supplier, and any\n'Label: value' pair) pulled from the document's semantic layer, each\nresolved to its evidence block's page and bbox. `?keys=a,b` filters\n(case-insensitive) to fields whose key or canonical_key matches;\nomitting it returns every field. Deterministic, model-free.",
    "operationId": "get_fields_v1_jobs__job_id__documents__document_id__fields_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "keys",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Keys"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ExtractedField"
         },
         "title": "Response Get Fields V1 Jobs  Job Id  Documents  Document Id  Fields Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/export/html": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Export Html",
    "description": "The document rendered as one semantic, accessible HTML page (headings,\nlists, tables, figures) in reading order - all text HTML-escaped.\n?redacted=true masks the caller's PII fail-closed first, like the other\nexports. Deterministic and model-free.",
    "operationId": "export_html_v1_jobs__job_id__documents__document_id__export_html_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "redacted",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Redacted"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/assets/{asset_path}": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Get Asset",
    "description": "Serve a persisted binary asset (rendered picture) by its asset_ref\n(\u00a713.2 - refs must RESOLVE for consumers: review display, downstream\napps embedding figures). Tenant-scoped like the tree; asset refs are\nnamespaced by document_id and validated against path traversal.",
    "operationId": "get_asset_v1_jobs__job_id__documents__document_id__assets__asset_path__get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "asset_path",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Asset Path"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/pages/{page}": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Get Page Image",
    "description": "Render a document page to PNG for the review UI's SOURCE OVERLAY (the\ntrust-UX view): a reviewer verifies block boundaries, reading order,\nconfidence, and redaction spans against the actual page. Rendered ON\nDEMAND from the stored original (no page rasters persisted per job). PDF\npages render via pdfium; a standalone image returns itself. Page\ndimensions (points) ride in headers so the client can map the tree's\nbboxes onto the raster. Tenant-scoped like the tree; a foreign document\nis a 404, not a 403.",
    "operationId": "get_page_image_v1_jobs__job_id__documents__document_id__pages__page__get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "page",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "title": "Page"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/export/graph": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Export Graph",
    "description": "\u00a713.4 knowledge-graph export - the CDOM's nodes and typed edges,\npurely structural (no models). format=json (JSON-LD-flavoured) or\nformat=neo4j ({'nodes.csv': ..., 'edges.csv': ...} for bulk import).\n\n?redacted=true masks the caller's PII fail-closed first (pending\nincluded), like the tree/chunks/context exports - without it this\nbulk-import-shaped export would emit raw, unreviewed PII into an\nexternal store (security review 2026-07-17).",
    "operationId": "export_graph_v1_jobs__job_id__documents__document_id__export_graph_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "format",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "json",
       "title": "Format"
      }
     },
     {
      "name": "redacted",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Redacted"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Export Graph V1 Jobs  Job Id  Documents  Document Id  Export Graph Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/export/context": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Export Context",
    "description": "\u00a713.4 LLM-context package - one token-budgeted markdown digest of\nthe document (outline + content in reading order, honest truncation).\n?redacted=true masks the caller's PII fail-closed first (pending included) -\ncontext packages usually leave the trust boundary.",
    "operationId": "export_context_v1_jobs__job_id__documents__document_id__export_context_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "max_tokens",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 4000,
       "title": "Max Tokens"
      }
     },
     {
      "name": "redacted",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Redacted"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Export Context V1 Jobs  Job Id  Documents  Document Id  Export Context Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/chunks": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "summary": "Get Chunks",
    "description": "RAG chunks re-derived deterministically from the stored tree\n(design \u00a74.5) - for callers embedding into their OWN vector store\ninstead of using the built-in LanceDB index. Same chunker as\n/v1/search ingestion: token-aware, section-path'd, flag-filtered,\npage provenance. ?redacted=true masks PII fail-closed (pending included)\nfirst (chunks usually leave the trust boundary).",
    "operationId": "get_chunks_v1_jobs__job_id__documents__document_id__chunks_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "redacted",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false,
       "title": "Redacted"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "additionalProperties": true
         },
         "title": "Response Get Chunks V1 Jobs  Job Id  Documents  Document Id  Chunks Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/parse": {
   "post": {
    "tags": [
     "Jobs"
    ],
    "summary": "Parse Now",
    "description": "\u00a79.3 sync convenience: one small document, parsed now. Sugar over\nthe SAME job pipeline (same queue, record, provenance, metering) -\nnever a second pipeline. On timeout: 202 + job ID, fall back to\npolling.",
    "operationId": "parse_now_v1_parse_post",
    "parameters": [
     {
      "name": "timeout_s",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number",
       "default": 55.0,
       "title": "Timeout S"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_parse_now_v1_parse_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/compare": {
   "post": {
    "tags": [
     "Jobs"
    ],
    "summary": "Compare Documents",
    "description": "Structural diff of two documents: parse both through the SAME\nextraction pipeline /v1/parse uses and report which CDOM blocks were\nadded, removed, modified, or unchanged (design \u00a713.4 compare surface).\nDeterministic and model-free. Ephemeral: both uploads are parsed in a\nscratch dir and deleted immediately, nothing is stored or metered. An\nunsupported file is a 422, consistent with the parse pipeline's intake.",
    "operationId": "compare_documents_v1_compare_post",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_compare_documents_v1_compare_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/DiffReport"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/evaluate": {
   "post": {
    "tags": [
     "Review & audit"
    ],
    "summary": "Evaluate",
    "description": "\u00a71 wedge, \"prove it on YOUR documents\": score a set of documents and\nreturn a QUALITY REPORT (per-document format/status/pages/tables/fields/\nOCR/confidence/flags + an aggregate). Ephemeral by design - the uploads\nare scored in a scratch dir and deleted immediately, nothing is stored in\nthe job record or the RAG index and no chunks are produced, so it is safe\nfor a prospect to try on non-sensitive documents. `format=html` returns\nthe self-contained report page; anything else returns JSON.",
    "operationId": "evaluate_v1_evaluate_post",
    "parameters": [
     {
      "name": "format",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "json",
       "title": "Format"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "$ref": "#/components/schemas/Body_evaluate_v1_evaluate_post"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/review": {
   "get": {
    "tags": [
     "Review & audit"
    ],
    "summary": "Review Queue",
    "description": "Flagged blocks in a job awaiting a human decision (\u00a79.4, \u00a71 wedge).",
    "operationId": "review_queue_v1_jobs__job_id__review_get",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/ReviewItem"
         },
         "title": "Response Review Queue V1 Jobs  Job Id  Review Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/review": {
   "get": {
    "tags": [
     "Review & audit"
    ],
    "summary": "Review Inbox",
    "description": "The caller's \"needs approval\" inbox: every flagged block across ALL\ntheir documents still awaiting a decision (pending PII), newest job\nfirst. Org-scoped like everything else (X-DE-Org). Each item is a\nReviewItem plus `job_id` and `source_file` so the console can link back\nto the document. Page with `?cursor=`; the next page token is returned in\n`X-Next-Cursor` (absent = last page), a job cursor as in GET /v1/jobs.\n\nPages end on a job boundary, so a page may modestly exceed `limit` when a\nsingle document carries many flags.",
    "operationId": "review_inbox_v1_review_get",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 100,
       "title": "Limit"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Cursor"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "additionalProperties": true
         },
         "title": "Response Review Inbox V1 Review Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/blocks/{block_id}/review": {
   "post": {
    "tags": [
     "Review & audit"
    ],
    "summary": "Review Decide",
    "description": "Approve (redact the PII on export) or reject (false positive) a flag.",
    "operationId": "review_decide_v1_jobs__job_id__documents__document_id__blocks__block_id__review_post",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "block_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Block Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": true,
        "title": "Body",
        "required": [
         "flag",
         "decision"
        ],
        "properties": {
         "flag": {
          "type": "string",
          "description": "The flag to decide, e.g. pii:email",
          "examples": [
           "pii:email"
          ]
         },
         "decision": {
          "type": "string",
          "enum": [
           "approved",
           "rejected"
          ],
          "description": "approved = redact on export; rejected = false positive, keep"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Review Decide V1 Jobs  Job Id  Documents  Document Id  Blocks  Block Id  Review Post"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/documents/{document_id}/requeue": {
   "post": {
    "tags": [
     "Jobs"
    ],
    "summary": "Requeue Document",
    "description": "Re-process a document from its stored original (\u00a79.4 re-queue).",
    "operationId": "requeue_document_v1_jobs__job_id__documents__document_id__requeue_post",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Job Id"
      }
     },
     {
      "name": "document_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Document Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Job"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/audit": {
   "get": {
    "tags": [
     "Review & audit"
    ],
    "summary": "Audit Log",
    "description": "The caller's audit trail - who did what, when (\u00a79.6).\nEnterprise-gated when licensed (the 'audit_export' feature).\nPaginated via `?cursor=` / `X-Next-Cursor` (see GET /v1/jobs).",
    "operationId": "audit_log_v1_audit_get",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 200,
       "title": "Limit"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Cursor"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "additionalProperties": true
         },
         "title": "Response Audit Log V1 Audit Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/license": {
   "get": {
    "tags": [
     "Account & licensing"
    ],
    "summary": "License Status",
    "description": "Plan, term, and quota position - the \u00a76 trust-but-audit view.",
    "operationId": "license_status_v1_license_get",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response License Status V1 License Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/token": {
   "get": {
    "tags": [
     "Account & licensing"
    ],
    "summary": "Token Info",
    "description": "The deploy-generated default API token (\u00a79.6), for copying into\nclients from /ui.\n\nAccess model: the default token is a FULL-SCOPE credential, so it is\ndisclosed only to (a) an already-authenticated admin, or (b) a loopback\ncaller bootstrapping /ui on the same host. A remote/anonymous caller is\nrefused: the token is printed at startup and stored 0600 in\napi-token.json, so an operator on another host pastes it once instead of\nthe engine handing its admin credential to any network peer that asks\n(unauthenticated remote disclosure, security review 2026-07-17). 409\nwhen keys are operator-managed and no default token exists.",
    "operationId": "token_info_v1_token_get",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Token Info V1 Token Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/token/rotate": {
   "post": {
    "tags": [
     "Account & licensing"
    ],
    "summary": "Rotate Token",
    "description": "Mint a fresh default token and invalidate the old one, effective\nimmediately - the response is the only place the new secret appears.",
    "operationId": "rotate_token_v1_token_rotate_post",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Rotate Token V1 Token Rotate Post"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/webhooks": {
   "post": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Register Webhook",
    "description": "Register a job.finished webhook. The signing secret is returned\nexactly once - store it; verify X-Nautris-Signature with it.",
    "operationId": "register_webhook_v1_webhooks_post",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": true,
        "title": "Body"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Register Webhook V1 Webhooks Post"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "List Webhooks",
    "operationId": "list_webhooks_v1_webhooks_get",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/Webhook"
         },
         "title": "Response List Webhooks V1 Webhooks Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/webhooks/{webhook_id}": {
   "delete": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Delete Webhook",
    "operationId": "delete_webhook_v1_webhooks__webhook_id__delete",
    "parameters": [
     {
      "name": "webhook_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Webhook Id"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/webhooks/deliveries": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Webhook Deliveries",
    "description": "Delivery log incl. the dead-letter view (\u00a79.4): status=failed.\nPaginated via `?cursor=` / `X-Next-Cursor` (see GET /v1/jobs).",
    "operationId": "webhook_deliveries_v1_webhooks_deliveries_get",
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Status"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer",
       "default": 100,
       "title": "Limit"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Cursor"
      }
     },
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "type": "object",
          "additionalProperties": true
         },
         "title": "Response Webhook Deliveries V1 Webhooks Deliveries Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/usage": {
   "get": {
    "tags": [
     "Account & licensing"
    ],
    "summary": "Usage",
    "description": "Aggregate the caller's metering (\u00a76) - the billing view.",
    "operationId": "usage_v1_usage_get",
    "parameters": [
     {
      "name": "x-api-key",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-Api-Key"
      }
     },
     {
      "name": "x-de-org",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "X-De-Org"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Usage V1 Usage Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "BlockChange": {
    "properties": {
     "op": {
      "type": "string",
      "enum": [
       "added",
       "removed",
       "modified",
       "unchanged"
      ],
      "title": "Op"
     },
     "old_block_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Old Block Id"
     },
     "new_block_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "New Block Id"
     },
     "role": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Role"
     },
     "page": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Page"
     },
     "old_text": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Old Text"
     },
     "new_text": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "New Text"
     },
     "similarity": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Similarity"
     },
     "cell_changes": {
      "anyOf": [
       {
        "items": {
         "additionalProperties": true,
         "type": "object"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Cell Changes"
     }
    },
    "type": "object",
    "required": [
     "op"
    ],
    "title": "BlockChange",
    "description": "One block's fate between the two documents."
   },
   "Body_compare_documents_v1_compare_post": {
    "properties": {
     "old": {
      "type": "string",
      "contentMediaType": "application/octet-stream",
      "title": "Old"
     },
     "new": {
      "type": "string",
      "contentMediaType": "application/octet-stream",
      "title": "New"
     }
    },
    "type": "object",
    "required": [
     "old",
     "new"
    ],
    "title": "Body_compare_documents_v1_compare_post"
   },
   "Body_create_job_v1_jobs_post": {
    "properties": {
     "files": {
      "items": {
       "type": "string",
       "contentMediaType": "application/octet-stream"
      },
      "type": "array",
      "title": "Files"
     }
    },
    "type": "object",
    "required": [
     "files"
    ],
    "title": "Body_create_job_v1_jobs_post"
   },
   "Body_evaluate_v1_evaluate_post": {
    "properties": {
     "files": {
      "items": {
       "type": "string",
       "contentMediaType": "application/octet-stream"
      },
      "type": "array",
      "title": "Files"
     }
    },
    "type": "object",
    "required": [
     "files"
    ],
    "title": "Body_evaluate_v1_evaluate_post"
   },
   "Body_parse_now_v1_parse_post": {
    "properties": {
     "file": {
      "type": "string",
      "contentMediaType": "application/octet-stream",
      "title": "File"
     }
    },
    "type": "object",
    "required": [
     "file"
    ],
    "title": "Body_parse_now_v1_parse_post"
   },
   "CleaningSummary": {
    "properties": {
     "changed_by_nfc": {
      "type": "integer",
      "title": "Changed By Nfc",
      "default": 0
     },
     "flagged_suspect": {
      "type": "integer",
      "title": "Flagged Suspect",
      "default": 0
     },
     "flagged_duplicate": {
      "type": "integer",
      "title": "Flagged Duplicate",
      "default": 0
     },
     "flagged_near_duplicate": {
      "type": "integer",
      "title": "Flagged Near Duplicate",
      "default": 0
     },
     "flagged_boilerplate": {
      "type": "integer",
      "title": "Flagged Boilerplate",
      "default": 0
     },
     "pii_counts": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Pii Counts"
     },
     "languages": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Languages"
     }
    },
    "type": "object",
    "title": "CleaningSummary",
    "description": "What the cleaning stage did to this document (\u00a74.4) - surfaced so a\ncaller sees normalization/flag/PII/language stats without re-deriving\nthem from the tree."
   },
   "DiffReport": {
    "properties": {
     "old_document_id": {
      "type": "string",
      "title": "Old Document Id"
     },
     "new_document_id": {
      "type": "string",
      "title": "New Document Id"
     },
     "summary": {
      "$ref": "#/components/schemas/DiffSummary"
     },
     "changes": {
      "items": {
       "$ref": "#/components/schemas/BlockChange"
      },
      "type": "array",
      "title": "Changes"
     }
    },
    "type": "object",
    "required": [
     "old_document_id",
     "new_document_id",
     "summary"
    ],
    "title": "DiffReport"
   },
   "DiffSummary": {
    "properties": {
     "added": {
      "type": "integer",
      "title": "Added",
      "default": 0
     },
     "removed": {
      "type": "integer",
      "title": "Removed",
      "default": 0
     },
     "modified": {
      "type": "integer",
      "title": "Modified",
      "default": 0
     },
     "unchanged": {
      "type": "integer",
      "title": "Unchanged",
      "default": 0
     }
    },
    "type": "object",
    "title": "DiffSummary"
   },
   "DocumentResult": {
    "properties": {
     "document_id": {
      "type": "string",
      "title": "Document Id"
     },
     "source_file": {
      "type": "string",
      "title": "Source File"
     },
     "status": {
      "type": "string",
      "enum": [
       "succeeded",
       "failed",
       "unsupported"
      ],
      "title": "Status"
     },
     "error": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Error"
     },
     "duration_ms": {
      "type": "integer",
      "title": "Duration Ms",
      "default": 0
     },
     "usage": {
      "$ref": "#/components/schemas/UsageMeter"
     },
     "blocks": {
      "type": "integer",
      "title": "Blocks",
      "default": 0
     },
     "chunks": {
      "type": "integer",
      "title": "Chunks",
      "default": 0
     },
     "flag_counts": {
      "additionalProperties": {
       "type": "integer"
      },
      "type": "object",
      "title": "Flag Counts"
     },
     "cleaning": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/CleaningSummary"
       },
       {
        "type": "null"
       }
      ]
     },
     "semantic_objects": {
      "type": "integer",
      "title": "Semantic Objects",
      "default": 0
     }
    },
    "type": "object",
    "required": [
     "document_id",
     "source_file",
     "status"
    ],
    "title": "DocumentResult"
   },
   "ExtractedField": {
    "properties": {
     "key": {
      "type": "string",
      "title": "Key"
     },
     "value": {
      "type": "string",
      "title": "Value"
     },
     "canonical_key": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Canonical Key"
     },
     "block_id": {
      "type": "string",
      "title": "Block Id"
     },
     "page": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Page"
     },
     "confidence": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Confidence"
     },
     "bbox": {
      "anyOf": [
       {
        "items": {
         "type": "number"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Bbox"
     }
    },
    "type": "object",
    "required": [
     "key",
     "value",
     "block_id"
    ],
    "title": "ExtractedField",
    "description": "One labelled field pulled from the document."
   },
   "HTTPValidationError": {
    "properties": {
     "detail": {
      "items": {
       "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
     }
    },
    "type": "object",
    "title": "HTTPValidationError"
   },
   "Job": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "api_key_id": {
      "type": "string",
      "title": "Api Key Id"
     },
     "status": {
      "type": "string",
      "enum": [
       "queued",
       "running",
       "succeeded",
       "partial",
       "failed"
      ],
      "title": "Status",
      "default": "running"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "finished_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Finished At"
     },
     "documents": {
      "items": {
       "$ref": "#/components/schemas/DocumentResult"
      },
      "type": "array",
      "title": "Documents"
     },
     "usage": {
      "$ref": "#/components/schemas/UsageMeter"
     }
    },
    "type": "object",
    "required": [
     "id",
     "api_key_id",
     "created_at"
    ],
    "title": "Job"
   },
   "ReviewItem": {
    "properties": {
     "document_id": {
      "type": "string",
      "title": "Document Id"
     },
     "block_id": {
      "type": "string",
      "title": "Block Id"
     },
     "page": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Page"
     },
     "flags": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Flags"
     },
     "text": {
      "type": "string",
      "title": "Text"
     },
     "decision": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Decision"
     },
     "decisions": {
      "additionalProperties": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ]
      },
      "type": "object",
      "title": "Decisions",
      "default": {}
     },
     "confidence": {
      "anyOf": [
       {
        "type": "number"
       },
       {
        "type": "null"
       }
      ],
      "title": "Confidence"
     }
    },
    "type": "object",
    "required": [
     "document_id",
     "block_id",
     "page",
     "flags",
     "text"
    ],
    "title": "ReviewItem"
   },
   "Source": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "api_key_id": {
      "type": "string",
      "title": "Api Key Id"
     },
     "path": {
      "type": "string",
      "title": "Path"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "last_sync_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Last Sync At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "api_key_id",
     "path",
     "created_at"
    ],
    "title": "Source"
   },
   "SyncReport": {
    "properties": {
     "source_id": {
      "type": "string",
      "title": "Source Id"
     },
     "job_id": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Job Id"
     },
     "new": {
      "type": "integer",
      "title": "New"
     },
     "changed": {
      "type": "integer",
      "title": "Changed"
     },
     "removed": {
      "type": "integer",
      "title": "Removed"
     },
     "unchanged": {
      "type": "integer",
      "title": "Unchanged"
     }
    },
    "type": "object",
    "required": [
     "source_id",
     "job_id",
     "new",
     "changed",
     "removed",
     "unchanged"
    ],
    "title": "SyncReport"
   },
   "UsageMeter": {
    "properties": {
     "documents": {
      "type": "integer",
      "title": "Documents",
      "default": 0
     },
     "pages": {
      "type": "integer",
      "title": "Pages",
      "default": 0
     },
     "bytes": {
      "type": "integer",
      "title": "Bytes",
      "default": 0
     },
     "chunks": {
      "type": "integer",
      "title": "Chunks",
      "default": 0
     }
    },
    "type": "object",
    "title": "UsageMeter"
   },
   "ValidationError": {
    "properties": {
     "loc": {
      "items": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      },
      "type": "array",
      "title": "Location"
     },
     "msg": {
      "type": "string",
      "title": "Message"
     },
     "type": {
      "type": "string",
      "title": "Error Type"
     },
     "input": {
      "title": "Input"
     },
     "ctx": {
      "type": "object",
      "title": "Context"
     }
    },
    "type": "object",
    "required": [
     "loc",
     "msg",
     "type"
    ],
    "title": "ValidationError"
   },
   "Webhook": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "api_key_id": {
      "type": "string",
      "title": "Api Key Id"
     },
     "url": {
      "type": "string",
      "title": "Url"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "api_key_id",
     "url",
     "created_at"
    ],
    "title": "Webhook"
   }
  }
 }
}