{"openapi":"3.1.0","info":{"title":"Ceteris-Paribus Pro® Console","description":"Provider-agnostic RAG platform. Ingest documents into the **Tumart Vector v3.5** pgvector corpus via the **Sovereign Ingestion Gateway**, then query them with any OpenAI-compatible LLM via the **Ceteris-Paribus Pro®** generation engine.\n\n## Authentication\nAll `/api/v1/*` routes require the `X-API-Key` header when `CONSOLE_API_KEY` is configured. The legacy `/api/*` routes (used by the browser UI) are not gated.\n\n## Error Responses\nAll non-2xx responses share a single envelope: `{\"ok\": false, \"error\": {\"code\": \"SNAKE_CASE\", \"message\": \"...\", \"detail\": ...}}`","contact":{"name":"Ceteris-Paribus Pro® Support","email":"support@ceterisparibus.pro"},"version":"1.0.0"},"paths":{"/api/v1/status":{"get":{"tags":["v1","Health"],"summary":"Corpus status","description":"Returns per-file chunk counts, total chunk count, and unindexed file list from the Tumart Vector v3.5 store.","operationId":"v1_status_api_v1_status_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":{"$ref":"#/components/schemas/StatusResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/config":{"get":{"tags":["v1","Settings"],"summary":"Public configuration","description":"Returns the non-secret portion of the current runtime configuration.","operationId":"v1_config_api_v1_config_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":{"$ref":"#/components/schemas/ConfigResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/documents":{"get":{"tags":["v1","Corpus"],"summary":"List ingested documents","description":"Returns every document currently indexed in the Tumart Vector v3.5 store, including filename, chunk count, last-ingested timestamp, and source URL.","operationId":"v1_list_documents_api_v1_documents_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":"array","items":{"$ref":"#/components/schemas/FileChunkInfo"},"title":"Response V1 List Documents Api V1 Documents Get"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/documents/{filename}":{"delete":{"tags":["v1","Corpus"],"summary":"Delete a document","description":"Removes all vector chunks for the given filename from the Tumart Vector v3.5 store. The source file on disk is **not** deleted.","operationId":"v1_delete_document_api_v1_documents__filename__delete","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"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":{"$ref":"#/components/schemas/DeleteDocumentResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/corpus":{"delete":{"tags":["v1","Corpus"],"summary":"Wipe entire vector corpus","description":"Deletes **all** rows from the Tumart Vector v3.5 store. This is irreversible — you will need to re-ingest documents afterwards.","operationId":"v1_reset_corpus_api_v1_corpus_delete","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":{"$ref":"#/components/schemas/ResetCorpusResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ingest":{"post":{"tags":["v1","Ingestion"],"summary":"Ingest uploaded files","description":"Upload one or more `.txt`, `.md`, `.json`, `.pdf`, `.docx`, `.doc`, or image files into the Sovereign Ingestion Gateway. Re-ingesting a file replaces its existing Tumart Vector v3.5 chunks. Returns a `job_id` that can be polled via `GET /api/v1/ingest/jobs/{job_id}`.","operationId":"v1_ingest_api_v1_ingest_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v1_ingest_api_v1_ingest_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ingest/jobs":{"get":{"tags":["v1","Ingestion"],"summary":"List recent ingest jobs","description":"Returns in-memory ingest job summaries for the current server process. Jobs are evicted 1 hour after completion and are not persisted across restarts.","operationId":"v1_list_ingest_jobs_api_v1_ingest_jobs_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":{"$ref":"#/components/schemas/IngestJobListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ingest/jobs/{job_id}":{"get":{"tags":["v1","Ingestion"],"summary":"Get a single ingest job","description":"Returns the status and progress of a specific ingest job by ID.","operationId":"v1_get_ingest_job_api_v1_ingest_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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestJobSummary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/ingest_url":{"post":{"tags":["v1","Ingestion"],"summary":"Ingest pages from URLs","description":"Fetch one or more public URLs, extract readable text via the Sovereign Ingestion Gateway, and index the content. When `follow_links` is true, up to 20 same-site sub-pages are also fetched per starting URL. Returns a `job_id` that can be polled via `GET /api/v1/ingest/jobs/{job_id}`.","operationId":"v1_ingest_url_api_v1_ingest_url_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__api_v1__UrlIngestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlIngestResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/query/sync":{"post":{"tags":["v1","Query"],"summary":"Synchronous query","description":"Submit a question and receive a single completed JSON response with the full answer and the source chunks used. For streaming, use the existing `POST /api/query` endpoint.","operationId":"v1_query_sync_api_v1_query_sync_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuerySyncBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuerySyncResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/nodes":{"get":{"tags":["v1","Surveillance"],"summary":"List surveillance nodes","description":"Returns all monitored Tier 1–4 nodes with status, scheduler timing, and discovered document count.","operationId":"v1_list_nodes_api_v1_nodes_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":{"$ref":"#/components/schemas/NodeListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["v1","Surveillance"],"summary":"Add a surveillance node","description":"Register a new URL to be polled on the given interval.","operationId":"v1_create_node_api_v1_nodes_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeCreateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/nodes/{node_id}":{"patch":{"tags":["v1","Surveillance"],"summary":"Update a surveillance node","description":"Modify name, URL, tier, interval, or active state. Reschedules the polling job automatically.","operationId":"v1_update_node_api_v1_nodes__node_id__patch","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeUpdateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["v1","Surveillance"],"summary":"Delete a surveillance node","description":"Remove a node and cancel its polling job.","operationId":"v1_delete_node_api_v1_nodes__node_id__delete","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"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":{"$ref":"#/components/schemas/NodeIdOkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/nodes/{node_id}/fetch-now":{"post":{"tags":["v1","Surveillance"],"summary":"Trigger an immediate node fetch","description":"Fire a one-off fetch for the node outside the regular schedule. Returns immediately; fetch runs in the background.","operationId":"v1_fetch_node_now_api_v1_nodes__node_id__fetch_now_post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"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":{"$ref":"#/components/schemas/FetchNowResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/nodes/{node_id}/changes":{"get":{"tags":["v1","Surveillance"],"summary":"Node change history","description":"Returns the most recent structural change events for a node. Use `?significance=regulatory` to filter to legally meaningful events only. Valid values: `regulatory`, `structural`, `cosmetic`.","operationId":"v1_node_changes_api_v1_nodes__node_id__changes_get","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"significance","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Significance"}},{"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":{"$ref":"#/components/schemas/NodeChangesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/nodes/{node_id}/acknowledge":{"post":{"tags":["v1","Surveillance"],"summary":"Acknowledge a node change","description":"Clears the amber 'Changed' flag on the node.","operationId":"v1_acknowledge_change_api_v1_nodes__node_id__acknowledge_post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"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":{"$ref":"#/components/schemas/NodeIdOkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/nodes/{node_id}/documents":{"get":{"tags":["v1","Surveillance"],"summary":"Discovered documents for a node","description":"Returns PDF and tender documents automatically discovered during surveillance polling. Each entry tracks download/extraction status and ingested chunk count.","operationId":"v1_node_documents_api_v1_nodes__node_id__documents_get","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"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":{"$ref":"#/components/schemas/NodeDocumentsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/nodes/{node_id}/documents/{doc_id}/ingest":{"post":{"tags":["v1","Surveillance"],"summary":"Ingest a specific discovered node document","description":"Download the document at its stored URL, extract text, and push it into the Tumart Vector v3.5 corpus. Works for both PDF and HTML documents. Updates the document's status in the surveillance database on success.","operationId":"v1_ingest_node_document_api_v1_nodes__node_id__documents__doc_id__ingest_post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","title":"Doc Id"}},{"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":{"$ref":"#/components/schemas/NodeDocIngestResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tender-notices":{"get":{"tags":["v1","Tenders"],"summary":"List extracted tender notices","description":"Returns structured tender notices extracted from surveillance node pages and PDFs by the Sovereign Semantic Distillation layer. Optionally filter by minimum confidence score, node ID, or limit result count.","operationId":"v1_list_tender_notices_api_v1_tender_notices_get","parameters":[{"name":"min_score","in":"query","required":false,"schema":{"type":"number","default":0.0,"title":"Min Score"}},{"name":"node_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Node Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"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":{"$ref":"#/components/schemas/TenderListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tender-notices/{notice_id}":{"delete":{"tags":["v1","Tenders"],"summary":"Delete a tender notice","description":"Permanently removes a single tender notice from the database. Any associated tender alert is also deleted (via CASCADE). The underlying surveillance node and vector corpus are not affected.","operationId":"v1_delete_tender_notice_api_v1_tender_notices__notice_id__delete","parameters":[{"name":"notice_id","in":"path","required":true,"schema":{"type":"integer","title":"Notice Id"}},{"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":{"$ref":"#/components/schemas/TenderDeleteResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/tender-notices/{notice_id}/reextract":{"post":{"tags":["v1","Tenders"],"summary":"Re-run tender extraction","description":"Fetches the notice's `source_url` again and re-runs the Sovereign Semantic Distillation layer to refresh all structured fields (title, deadline, budget, etc.). Returns the updated notice. Returns 400 if the notice has no stored `source_url`, or 422 if the page no longer appears to be a tender (confidence < 0.5).","operationId":"v1_reextract_tender_notice_api_v1_tender_notices__notice_id__reextract_post","parameters":[{"name":"notice_id","in":"path","required":true,"schema":{"type":"integer","title":"Notice Id"}},{"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":{"$ref":"#/components/schemas/TenderNoticeOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/alerts":{"get":{"tags":["v1","Alerts"],"summary":"List tender alerts","description":"Returns scored tender alerts generated by the Relevance Gating layer. Each alert is linked to a tender notice and carries urgency (critical/high/medium/low), matched keyword chips, and dismiss/star state.","operationId":"v1_list_alerts_api_v1_alerts_get","parameters":[{"name":"dismissed","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Dismissed"}},{"name":"urgency","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"}},{"name":"starred_first","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Starred First"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"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":{"$ref":"#/components/schemas/AlertListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/alerts/{alert_id}":{"patch":{"tags":["v1","Alerts"],"summary":"Update an alert","description":"Dismiss or star/un-star a tender alert.","operationId":"v1_patch_alert_api_v1_alerts__alert_id__patch","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"integer","title":"Alert Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertPatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertPatchResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["v1","Alerts"],"summary":"Delete an alert","description":"Permanently remove a tender alert (the underlying notice is kept).","operationId":"v1_delete_alert_api_v1_alerts__alert_id__delete","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"integer","title":"Alert Id"}},{"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":{"$ref":"#/components/schemas/AlertIdOkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/query/stream":{"post":{"tags":["v1","Query"],"summary":"Streaming query (NDJSON)","description":"Submit a question and receive a newline-delimited JSON stream. Events: `sources` (retrieved chunks), `delta` (token text), `done` or `error`.","operationId":"v1_query_stream_api_v1_query_stream_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryStreamBody"}}}},"responses":{"200":{"description":"NDJSON stream — one JSON event per line. Events: `sources` (retrieved chunks), `delta` (token text), `done`, `error`.","content":{"application/x-ndjson":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/corpus/coverage":{"post":{"tags":["v1","Corpus"],"summary":"Corpus coverage probe","description":"For each supplied topic string (or for each field label of a DocGen document), runs a lightweight vector retrieval probe and classifies corpus coverage. 'covered' means best cosine distance ≤ 0.25, 'partial' ≤ 0.45, 'missing' otherwise. Returns a 120-char chunk preview for each topic.","operationId":"v1_corpus_coverage_api_v1_corpus_coverage_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoverageRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoverageResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/interactions":{"get":{"tags":["v1","Interactions"],"summary":"List interaction history","description":"Returns a paginated list of all recorded RAG interactions. Use `?limit`, `?offset`, and `?since` (ISO-8601 datetime) to page through the log.","operationId":"v1_list_interactions_api_v1_interactions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"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":{"$ref":"#/components/schemas/InteractionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/interactions/insights":{"get":{"tags":["v1","Interactions"],"summary":"Interaction insights and corpus health","description":"Returns aggregated quality metrics: average confidence by day, the five topic clusters with the lowest average confidence, and the topics with the highest negative-feedback rate. Useful as a corpus health dashboard.","operationId":"v1_interaction_insights_api_v1_interactions_insights_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":{"$ref":"#/components/schemas/InsightsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/interactions/{interaction_id}":{"get":{"tags":["v1","Interactions"],"summary":"Get a single interaction with chunk previews","description":"Returns the full interaction record including the stored answer text, retrieved chunk IDs with 120-char content previews, and all attached feedback signals.","operationId":"v1_get_interaction_api_v1_interactions__interaction_id__get","parameters":[{"name":"interaction_id","in":"path","required":true,"schema":{"type":"integer","title":"Interaction Id"}},{"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":{"$ref":"#/components/schemas/InteractionDetailOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/interactions/{interaction_id}/feedback":{"post":{"tags":["v1","Interactions"],"summary":"Submit feedback on an interaction","description":"Attach an explicit signal to a recorded interaction. Valid signals: `positive`, `negative`, `hallucination`, `correction`. Optionally provide a `note` (free text) and a `corrected_answer`. Multiple feedback records per interaction are allowed.","operationId":"v1_post_feedback_api_v1_interactions__interaction_id__feedback_post","parameters":[{"name":"interaction_id","in":"path","required":true,"schema":{"type":"integer","title":"Interaction Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/corpus/gaps":{"get":{"tags":["v1","Corpus"],"summary":"List open corpus gap alerts","description":"Returns unresolved gap alerts generated by the background corpus coverage scanner. Each alert includes the topic, coverage status (`covered`/`partial`/`missing`), number of interactions that triggered it, and a suggested action.","operationId":"v1_list_corpus_gaps_api_v1_corpus_gaps_get","parameters":[{"name":"resolved","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Resolved"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"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":{"$ref":"#/components/schemas/CorpusGapListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/corpus/gaps/{gap_id}":{"delete":{"tags":["v1","Corpus"],"summary":"Dismiss a corpus gap alert","description":"Mark a gap alert as resolved. Resolved alerts are excluded from the default `GET /api/v1/corpus/gaps` response (use `?resolved=true` to see them). The alert is not deleted — it is preserved for audit purposes.","operationId":"v1_dismiss_corpus_gap_api_v1_corpus_gaps__gap_id__delete","parameters":[{"name":"gap_id","in":"path","required":true,"schema":{"type":"integer","title":"Gap Id"}},{"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":{"$ref":"#/components/schemas/OkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/settings":{"post":{"tags":["v1","Settings"],"summary":"Update runtime configuration","description":"Persist one or more configuration values (provider URLs, model IDs, API keys). Values are merged into the local settings store and applied to the running process immediately — no restart required. Secret fields (API keys) are write-only: reading back the settings via `GET /api/v1/config` will not expose them.","operationId":"v1_settings_save_api_v1_settings_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsSaveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/documents/{filename}/content":{"get":{"tags":["v1","Corpus"],"summary":"Download document content","description":"Returns the raw file bytes for a previously ingested document. The `filename` must match exactly what appears in `GET /api/v1/documents`. Content-Type is inferred from the file extension. Returns 404 when the file does not exist on disk.","operationId":"v1_document_content_api_v1_documents__filename__content_get","parameters":[{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}},{"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":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/query/batch":{"post":{"tags":["v1","Query"],"summary":"Batch synchronous query","description":"Submit up to 20 prompts in a single request. Each prompt is run through the full Tumart Vector v3.5 retrieval + Ceteris-Paribus Pro® generation pipeline sequentially. Every result includes its own `sources` list. Generation errors for individual prompts are surfaced inline rather than failing the whole batch. For streaming responses, use `POST /api/v1/query/stream` instead.","operationId":"v1_query_batch_api_v1_query_batch_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryBatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryBatchResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/crawl":{"post":{"tags":["v1","Crawler"],"summary":"Start a crawl session","description":"Launch a Research Crawler Agent session with a mission statement, seed URLs, and optional BFS configuration. Returns the session ID and initial status immediately; the crawl runs as a background task.","operationId":"v1_crawl_start_api_v1_crawl_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlStartBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlStartResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["v1","Crawler"],"summary":"List crawl sessions","description":"Returns all Research Crawler Agent sessions with stats and up to 200 candidates each.","operationId":"v1_crawl_list_api_v1_crawl_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":{"$ref":"#/components/schemas/CrawlListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/crawl/{session_id}":{"get":{"tags":["v1","Crawler"],"summary":"Get a crawl session","description":"Returns a single crawl session with paginated candidates.","operationId":"v1_crawl_get_api_v1_crawl__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"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":{"$ref":"#/components/schemas/CrawlSession"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["v1","Crawler"],"summary":"Delete a crawl session","description":"Cancels any active crawl task and permanently removes the session record, all its candidates, and their stored content from disk.","operationId":"v1_crawl_delete_api_v1_crawl__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"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":{"$ref":"#/components/schemas/OkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/crawl/{session_id}/cancel":{"post":{"tags":["v1","Crawler"],"summary":"Cancel a crawl session","description":"Requests graceful cancellation of a running crawl. The session record is preserved.","operationId":"v1_crawl_cancel_api_v1_crawl__session_id__cancel_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"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":{"$ref":"#/components/schemas/OkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/crawl/{session_id}/candidates/{candidate_id}/approve":{"post":{"tags":["v1","Crawler"],"summary":"Approve a crawl candidate","description":"Marks the candidate as approved and ingests its content through the Sovereign Ingestion Gateway. If stored content is missing, the source URL is re-fetched.","operationId":"v1_crawl_approve_api_v1_crawl__session_id__candidates__candidate_id__approve_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"candidate_id","in":"path","required":true,"schema":{"type":"integer","title":"Candidate Id"}},{"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":{"$ref":"#/components/schemas/CrawlApproveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/crawl/{session_id}/candidates/{candidate_id}/reject":{"post":{"tags":["v1","Crawler"],"summary":"Reject a crawl candidate","description":"Marks the candidate as rejected. It will not be ingested.","operationId":"v1_crawl_reject_api_v1_crawl__session_id__candidates__candidate_id__reject_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"candidate_id","in":"path","required":true,"schema":{"type":"integer","title":"Candidate Id"}},{"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":{"$ref":"#/components/schemas/CrawlRejectResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/crawl/{session_id}/candidates/bulk-approve":{"post":{"tags":["v1","Crawler"],"summary":"Bulk-approve crawl candidates","description":"Approves and ingests all pending candidates with a relevance score at or above `min_score`. Returns counts of approved and successfully ingested candidates.","operationId":"v1_crawl_bulk_approve_api_v1_crawl__session_id__candidates_bulk_approve_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlBulkApproveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApproveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/docgen/catalogue":{"get":{"tags":["v1","DocGen"],"summary":"List all generatable document types grouped by phase","operationId":"v1_docgen_catalogue_api_v1_docgen_catalogue_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":{"$ref":"#/components/schemas/CatalogueResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/docgen/sessions":{"post":{"tags":["v1","DocGen"],"summary":"Create a new DocGen session","description":"Open a named dossier session. Canonical facts registered on the session are automatically injected into the LLM system prompt on every `POST /api/v1/docgen/generate` call that includes the `session_id`, ensuring cross-document consistency.","operationId":"v1_docgen_session_create_api_v1_docgen_sessions_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocGenSessionCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocGenSessionOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["v1","DocGen"],"summary":"List all active DocGen sessions","description":"Returns all live in-memory sessions (24-hour idle TTL). Sessions are not persisted across restarts.","operationId":"v1_docgen_sessions_list_api_v1_docgen_sessions_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":{"$ref":"#/components/schemas/DocGenSessionListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/docgen/sessions/{session_id}":{"get":{"tags":["v1","DocGen"],"summary":"Get a single DocGen session","operationId":"v1_docgen_session_get_api_v1_docgen_sessions__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"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":{"$ref":"#/components/schemas/DocGenSessionOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["v1","DocGen"],"summary":"Delete a DocGen session","operationId":"v1_docgen_session_delete_api_v1_docgen_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"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":{"$ref":"#/components/schemas/OkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/docgen/sessions/{session_id}/facts":{"post":{"tags":["v1","DocGen"],"summary":"Register or update canonical facts on a session","description":"Merge the provided key-value facts into the session's canonical fact registry. Existing keys are overwritten; unmentioned keys are preserved. Facts are injected as a ground-truth block into the generation system prompt.","operationId":"v1_docgen_session_facts_api_v1_docgen_sessions__session_id__facts_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocGenSessionFactsBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocGenSessionOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/docgen/generate":{"post":{"tags":["v1","DocGen"],"summary":"Stream-generate a legal document (NDJSON)","description":"Generate a legal document using RAG-grounded streaming. Pass `session_id` to inject canonical session facts into the prompt. Pass `language` (`fr`, `ar`, or `bilingual`) to control output language.","operationId":"v1_docgen_generate_api_v1_docgen_generate_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_GenerateBody"}}}},"responses":{"200":{"description":"NDJSON stream — one JSON event per line. Events: `sources`, `delta` (token text), `done`, `error`.","content":{"application/x-ndjson":{"schema":{"description":"One line in the NDJSON generation stream from POST /api/generate.","properties":{"event":{"title":"Event","type":"string"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"sources":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Sources"}},"required":["event"],"title":"GenerateEvent","type":"object"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/docgen/generate/sync":{"post":{"tags":["v1","DocGen"],"summary":"Generate a legal document (synchronous — returns full text as JSON)","description":"Non-streaming variant of `/docgen/generate`. Runs the same RAG pipeline (embed → retrieve → rerank → generate) and returns the complete document text in a single JSON response. Use this when you cannot consume NDJSON streams. Pass `session_id` to inject canonical session facts into the prompt.","operationId":"v1_docgen_generate_sync_api_v1_docgen_generate_sync_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_GenerateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/v1/docgen/export":{"post":{"tags":["v1","DocGen"],"summary":"Export generated document text to DOCX or PDF","description":"Export document text to DOCX or PDF. Pass `language` (`fr`, `ar`, or `bilingual`) so Arabic sections receive RTL paragraph styling in DOCX.","operationId":"v1_docgen_export_api_v1_docgen_export_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ExportBody"}}}},"responses":{"200":{"description":"Generated document file — returned as a binary attachment.","content":{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/docgen/":{"get":{"summary":"Index","operationId":"index_docgen__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/docgen":{"get":{"summary":"Index","operationId":"index_docgen_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/docgen/guide/":{"get":{"summary":"Guide","operationId":"guide_docgen_guide__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/docgen/guide":{"get":{"summary":"Guide","operationId":"guide_docgen_guide_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/docgen/guide/pdf":{"get":{"summary":"Guide Pdf","operationId":"guide_pdf_docgen_guide_pdf_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/docgen/api/catalogue":{"get":{"tags":["DocGen"],"summary":"Api Catalogue","operationId":"api_catalogue_docgen_api_catalogue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogueResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/docgen/api/generate":{"post":{"tags":["DocGen"],"summary":"Api Generate","operationId":"api_generate_docgen_api_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateBody"}}},"required":true},"responses":{"200":{"description":"NDJSON stream — one JSON event per line. Events: `delta` (token text), `done`, `error`.","content":{"application/x-ndjson":{"schema":{"properties":{"event":{"type":"string","title":"Event"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"sources":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Sources"}},"type":"object","required":["event"],"title":"GenerateEvent","description":"One line in the NDJSON generation stream from POST /api/generate."}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/docgen/api/export":{"post":{"tags":["DocGen"],"summary":"Api Export","operationId":"api_export_docgen_api_export_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportBody"}}},"required":true},"responses":{"200":{"description":"Generated document file — returned as a binary attachment.","content":{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/audit/":{"get":{"summary":"Audit Page","operationId":"audit_page_audit__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/audit":{"get":{"summary":"Audit Page","operationId":"audit_page_audit_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/system-card/":{"get":{"summary":"System Card Page","operationId":"system_card_page_system_card__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/system-card":{"get":{"summary":"System Card Page","operationId":"system_card_page_system_card_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/config":{"get":{"tags":["Settings"],"summary":"Api Config","operationId":"api_config_api_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/settings":{"get":{"tags":["Settings"],"summary":"Api Settings Get","operationId":"api_settings_get_api_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsStateResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Settings"],"summary":"Api Settings Save","operationId":"api_settings_save_api_settings_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsSaveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/status":{"get":{"tags":["Health"],"summary":"Api Status","operationId":"api_status_api_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ingest":{"post":{"tags":["Ingestion"],"summary":"Api Ingest","operationId":"api_ingest_api_ingest_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_api_ingest_api_ingest_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/ingest_url":{"post":{"tags":["Ingestion"],"summary":"Api Ingest Url","operationId":"api_ingest_url_api_ingest_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__main__UrlIngestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlIngestResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/query":{"post":{"tags":["Query"],"summary":"Api Query","operationId":"api_query_api_query_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryBody"}}},"required":true},"responses":{"200":{"description":"NDJSON stream — one JSON event per line. Events: `sources` (retrieved chunks), `delta` (token text), `done`, `error`.","content":{"application/x-ndjson":{"schema":{"type":"string"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/healthz":{"get":{"tags":["Health"],"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/crawl":{"get":{"tags":["Crawler"],"summary":"Api Crawl List","operationId":"api_crawl_list_api_crawl_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Crawler"],"summary":"Api Crawl Start","operationId":"api_crawl_start_api_crawl_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlStartBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlStartResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/crawl/{session_id}":{"get":{"tags":["Crawler"],"summary":"Api Crawl Get","operationId":"api_crawl_get_api_crawl__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlSession"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Crawler"],"summary":"Api Crawl Delete","operationId":"api_crawl_delete_api_crawl__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/crawl/{session_id}/cancel":{"post":{"tags":["Crawler"],"summary":"Api Crawl Cancel","operationId":"api_crawl_cancel_api_crawl__session_id__cancel_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/crawl/{session_id}/candidates/{candidate_id}/approve":{"post":{"tags":["Crawler"],"summary":"Api Crawl Approve","operationId":"api_crawl_approve_api_crawl__session_id__candidates__candidate_id__approve_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"candidate_id","in":"path","required":true,"schema":{"type":"integer","title":"Candidate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlApproveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/crawl/{session_id}/candidates/{candidate_id}/reject":{"post":{"tags":["Crawler"],"summary":"Api Crawl Reject","operationId":"api_crawl_reject_api_crawl__session_id__candidates__candidate_id__reject_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}},{"name":"candidate_id","in":"path","required":true,"schema":{"type":"integer","title":"Candidate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrawlRejectResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/crawl/{session_id}/candidates/bulk-approve":{"post":{"tags":["Crawler"],"summary":"Api Crawl Bulk Approve","operationId":"api_crawl_bulk_approve_api_crawl__session_id__candidates_bulk_approve_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"integer","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApproveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApproveResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/nodes":{"get":{"tags":["Surveillance"],"summary":"Api Nodes List","operationId":"api_nodes_list_api_nodes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"tags":["Surveillance"],"summary":"Api Nodes Create","operationId":"api_nodes_create_api_nodes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeCreateBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/nodes/{node_id}":{"patch":{"tags":["Surveillance"],"summary":"Api Nodes Update","operationId":"api_nodes_update_api_nodes__node_id__patch","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeUpdateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeOut"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Surveillance"],"summary":"Api Nodes Delete","operationId":"api_nodes_delete_api_nodes__node_id__delete","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeIdOkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/nodes/{node_id}/changes":{"get":{"tags":["Surveillance"],"summary":"Api Nodes Changes","operationId":"api_nodes_changes_api_nodes__node_id__changes_get","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeChangesResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/nodes/{node_id}/acknowledge":{"post":{"tags":["Surveillance"],"summary":"Api Nodes Acknowledge","operationId":"api_nodes_acknowledge_api_nodes__node_id__acknowledge_post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeIdOkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/nodes/{node_id}/documents":{"get":{"tags":["Surveillance"],"summary":"Api Nodes Documents","operationId":"api_nodes_documents_api_nodes__node_id__documents_get","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NodeDocumentsResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/nodes/{node_id}/fetch-now":{"post":{"tags":["Surveillance"],"summary":"Api Nodes Fetch Now","operationId":"api_nodes_fetch_now_api_nodes__node_id__fetch_now_post","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchNowResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/tender-notices":{"get":{"tags":["Tenders"],"summary":"Api Tender Notices","description":"Console-UI-accessible tender notices list (mirrors /api/v1/tender-notices, no auth).","operationId":"api_tender_notices_api_tender_notices_get","parameters":[{"name":"min_score","in":"query","required":false,"schema":{"type":"number","default":0.0,"title":"Min Score"}},{"name":"node_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Node Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenderListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/alerts":{"get":{"tags":["Alerts"],"summary":"Api List Alerts","description":"Console-UI-accessible alerts list (mirrors /api/v1/alerts, no auth).","operationId":"api_list_alerts_api_alerts_get","parameters":[{"name":"dismissed","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Dismissed"}},{"name":"urgency","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"}},{"name":"starred_first","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Starred First"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertListResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/alerts/{alert_id}":{"patch":{"tags":["Alerts"],"summary":"Api Patch Alert","description":"Dismiss or star an alert (ungated).","operationId":"api_patch_alert_api_alerts__alert_id__patch","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"integer","title":"Alert Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertPatchResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"delete":{"tags":["Alerts"],"summary":"Api Delete Alert","description":"Delete an alert permanently (ungated).","operationId":"api_delete_alert_api_alerts__alert_id__delete","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"integer","title":"Alert Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertIdOkResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/":{"get":{"summary":"Index","operationId":"index__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/m":{"get":{"summary":"Mobile","operationId":"mobile_m_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"Request validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"schemas":{"AlertIdOkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"alert_id":{"type":"integer","title":"Alert Id"}},"type":"object","required":["ok","alert_id"],"title":"AlertIdOkResponse"},"AlertListResponse":{"properties":{"alerts":{"items":{"$ref":"#/components/schemas/AlertOut"},"type":"array","title":"Alerts"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["alerts","total"],"title":"AlertListResponse"},"AlertOut":{"properties":{"id":{"type":"integer","title":"Id"},"tender_notice_id":{"type":"integer","title":"Tender Notice Id"},"score":{"type":"number","title":"Score"},"urgency_level":{"type":"string","title":"Urgency Level"},"dismissed":{"type":"boolean","title":"Dismissed"},"starred":{"type":"boolean","title":"Starred"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"additionalProperties":true,"type":"object","required":["id","tender_notice_id","score","urgency_level","dismissed","starred"],"title":"AlertOut"},"AlertPatchBody":{"properties":{"dismissed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dismissed"},"starred":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Starred"}},"type":"object","title":"AlertPatchBody"},"AlertPatchResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Id"},"dismissed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dismissed"},"starred":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Starred"}},"additionalProperties":true,"type":"object","required":["ok"],"title":"AlertPatchResponse"},"Body_api_ingest_api_ingest_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","title":"Body_api_ingest_api_ingest_post"},"Body_v1_ingest_api_v1_ingest_post":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files","default":[]}},"type":"object","title":"Body_v1_ingest_api_v1_ingest_post"},"BulkApproveBody":{"properties":{"min_score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Min Score","default":50}},"type":"object","title":"BulkApproveBody"},"BulkApproveResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"approved":{"type":"integer","title":"Approved"},"ingested":{"type":"integer","title":"Ingested"},"failures":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Failures"}},"additionalProperties":true,"type":"object","required":["ok","approved","ingested"],"title":"BulkApproveResponse"},"CatalogueResponse":{"properties":{"phases":{"items":{"$ref":"#/components/schemas/PhaseOut"},"type":"array","title":"Phases"}},"type":"object","required":["phases"],"title":"CatalogueResponse"},"ConfigResponse":{"properties":{"ai_provider_base_url":{"type":"string","title":"Ai Provider Base Url"},"ai_generation_model":{"type":"string","title":"Ai Generation Model"},"ai_embedding_model":{"type":"string","title":"Ai Embedding Model"},"embedding_endpoint":{"type":"string","title":"Embedding Endpoint"},"embedding_dim":{"type":"integer","title":"Embedding Dim"},"crawler_base_url":{"type":"string","title":"Crawler Base Url"},"crawler_model":{"type":"string","title":"Crawler Model"},"alert_threshold":{"type":"number","title":"Alert Threshold"},"reranker_enabled":{"type":"boolean","title":"Reranker Enabled"},"reranker_model":{"type":"string","title":"Reranker Model"},"vision_model":{"type":"string","title":"Vision Model"},"pdf_support":{"type":"boolean","title":"Pdf Support"},"batch_embed_enabled":{"type":"boolean","title":"Batch Embed Enabled"},"batch_embed_threshold":{"type":"integer","title":"Batch Embed Threshold"},"missing":{"items":{"type":"string"},"type":"array","title":"Missing"},"configured":{"type":"boolean","title":"Configured"}},"additionalProperties":true,"type":"object","required":["ai_provider_base_url","ai_generation_model","ai_embedding_model","embedding_endpoint","embedding_dim","crawler_base_url","crawler_model","alert_threshold","reranker_enabled","reranker_model","vision_model","pdf_support","batch_embed_enabled","batch_embed_threshold","missing","configured"],"title":"ConfigResponse"},"CorpusGapListResponse":{"properties":{"gaps":{"items":{"$ref":"#/components/schemas/CorpusGapOut"},"type":"array","title":"Gaps"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["gaps","total"],"title":"CorpusGapListResponse"},"CorpusGapOut":{"properties":{"id":{"type":"integer","title":"Id"},"topic":{"type":"string","title":"Topic"},"coverage_status":{"type":"string","title":"Coverage Status"},"best_distance":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Best Distance"},"triggering_interaction_count":{"type":"integer","title":"Triggering Interaction Count"},"suggested_action":{"type":"string","title":"Suggested Action"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"}},"additionalProperties":true,"type":"object","required":["id","topic","coverage_status","triggering_interaction_count","suggested_action"],"title":"CorpusGapOut"},"CoverageItem":{"properties":{"topic":{"type":"string","title":"Topic"},"status":{"type":"string","enum":["covered","partial","missing"],"title":"Status"},"best_distance":{"type":"number","title":"Best Distance"},"best_chunk_preview":{"type":"string","title":"Best Chunk Preview"}},"type":"object","required":["topic","status","best_distance","best_chunk_preview"],"title":"CoverageItem"},"CoverageRequestBody":{"properties":{"topics":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Topics","description":"List of topic strings to probe. Each topic is embedded and checked against the Tumart Vector v3.5 corpus via cosine distance.","examples":[["Loi 09-08 Article 3","CNDP notification","Dahir IA draft"]]},"doc_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Id","description":"Optional DocGen catalogue document ID. When provided, the document's form field labels are automatically expanded into topic strings.","examples":["note_ammc"]}},"type":"object","title":"CoverageRequestBody"},"CoverageResponse":{"properties":{"coverage":{"items":{"$ref":"#/components/schemas/CoverageItem"},"type":"array","title":"Coverage"}},"type":"object","required":["coverage"],"title":"CoverageResponse"},"CrawlApproveResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"candidate_id":{"type":"integer","title":"Candidate Id"},"ingest_warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ingest Warning"}},"additionalProperties":true,"type":"object","required":["ok","candidate_id"],"title":"CrawlApproveResponse"},"CrawlBulkApproveBody":{"properties":{"min_score":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Min Score","default":50}},"type":"object","title":"CrawlBulkApproveBody"},"CrawlListResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/CrawlSession"},"type":"array","title":"Sessions"}},"type":"object","required":["sessions"],"title":"CrawlListResponse"},"CrawlRejectResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"candidate_id":{"type":"integer","title":"Candidate Id"}},"type":"object","required":["ok","candidate_id"],"title":"CrawlRejectResponse"},"CrawlSession":{"properties":{"id":{"type":"integer","title":"Id"},"mission":{"type":"string","title":"Mission"},"status":{"type":"string","title":"Status"}},"additionalProperties":true,"type":"object","required":["id","mission","status"],"title":"CrawlSession"},"CrawlStartBody":{"properties":{"mission":{"type":"string","maxLength":4000,"minLength":1,"title":"Mission"},"seeds":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Seeds"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["mission","seeds"],"title":"CrawlStartBody"},"CrawlStartResponse":{"properties":{"session_id":{"type":"integer","title":"Session Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["session_id","status"],"title":"CrawlStartResponse"},"DailyConfidence":{"properties":{"date":{"type":"string","title":"Date"},"avg_confidence":{"type":"number","title":"Avg Confidence"},"interaction_count":{"type":"integer","title":"Interaction Count"}},"type":"object","required":["date","avg_confidence","interaction_count"],"title":"DailyConfidence"},"DeleteDocumentResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"filename":{"type":"string","title":"Filename"},"chunks_deleted":{"type":"integer","title":"Chunks Deleted"}},"type":"object","required":["ok","filename","chunks_deleted"],"title":"DeleteDocumentResponse"},"DocGenSessionCreate":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name","examples":["ZILLIONLABS AFRICA S.A. — Dossier IPO"]}},"type":"object","required":["name"],"title":"DocGenSessionCreate"},"DocGenSessionFactsBody":{"properties":{"facts":{"additionalProperties":true,"type":"object","title":"Facts","examples":[{"capital":"300000 MAD","company_name":"ZILLIONLABS AFRICA S.A."}]}},"type":"object","required":["facts"],"title":"DocGenSessionFactsBody"},"DocGenSessionListResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/DocGenSessionOut"},"type":"array","title":"Sessions"}},"type":"object","required":["sessions"],"title":"DocGenSessionListResponse"},"DocGenSessionOut":{"properties":{"session_id":{"type":"string","title":"Session Id"},"name":{"type":"string","title":"Name"},"facts":{"additionalProperties":true,"type":"object","title":"Facts"},"created_at":{"type":"string","title":"Created At"}},"additionalProperties":true,"type":"object","required":["session_id","name","facts","created_at"],"title":"DocGenSessionOut"},"DocOut":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"mode":{"type":"string","title":"Mode"},"description":{"type":"string","title":"Description"},"fields":{"items":{"$ref":"#/components/schemas/FormFieldOut"},"type":"array","title":"Fields"},"prompt_scaffold":{"type":"string","title":"Prompt Scaffold"}},"additionalProperties":true,"type":"object","required":["id","title","mode","description","fields","prompt_scaffold"],"title":"DocOut"},"ErrorBody":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"detail":{"title":"Detail"}},"type":"object","required":["code","message"],"title":"ErrorBody"},"ErrorEnvelope":{"properties":{"ok":{"type":"boolean","title":"Ok","default":false},"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorEnvelope"},"ExportBody":{"properties":{"text":{"type":"string","title":"Text"},"title":{"type":"string","title":"Title"},"format":{"type":"string","enum":["docx","pdf"],"title":"Format","default":"docx"}},"type":"object","required":["text","title"],"title":"ExportBody"},"FeedbackBody":{"properties":{"signal":{"type":"string","title":"Signal","description":"One of: positive | negative | hallucination | correction","examples":["positive"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"corrected_answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Answer"}},"type":"object","required":["signal"],"title":"FeedbackBody"},"FeedbackOut":{"properties":{"id":{"type":"integer","title":"Id"},"interaction_id":{"type":"integer","title":"Interaction Id"},"signal":{"type":"string","title":"Signal"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"corrected_answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Answer"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"additionalProperties":true,"type":"object","required":["id","interaction_id","signal"],"title":"FeedbackOut"},"FeedbackResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"feedback":{"$ref":"#/components/schemas/FeedbackOut"}},"type":"object","required":["ok","feedback"],"title":"FeedbackResponse"},"FetchNowResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"node_id":{"type":"integer","title":"Node Id"},"url":{"type":"string","title":"Url"},"message":{"type":"string","title":"Message"}},"type":"object","required":["ok","node_id","url","message"],"title":"FetchNowResponse"},"FileChunkInfo":{"properties":{"filename":{"type":"string","title":"Filename"},"chunks":{"type":"integer","title":"Chunks"},"last_ingested":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Ingested"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"}},"additionalProperties":true,"type":"object","required":["filename","chunks"],"title":"FileChunkInfo"},"FormFieldOut":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"placeholder":{"type":"string","title":"Placeholder"},"field_type":{"type":"string","title":"Field Type"},"required":{"type":"boolean","title":"Required"},"options":{"items":{"type":"string"},"type":"array","title":"Options"},"hint_fr":{"type":"string","title":"Hint Fr"},"hint_en":{"type":"string","title":"Hint En"}},"additionalProperties":true,"type":"object","required":["id","label","placeholder","field_type","required","options","hint_fr","hint_en"],"title":"FormFieldOut"},"GenerateBody":{"properties":{"doc_id":{"type":"string","title":"Doc Id"},"mode":{"type":"string","enum":["form","chat"],"title":"Mode","default":"form"},"form_data":{"additionalProperties":{"type":"string"},"type":"object","title":"Form Data"},"chat_text":{"type":"string","title":"Chat Text","default":""}},"type":"object","required":["doc_id"],"title":"GenerateBody"},"HealthResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"}},"type":"object","required":["ok"],"title":"HealthResponse"},"IngestJobListResponse":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/IngestJobSummary"},"type":"array","title":"Jobs"}},"type":"object","required":["jobs"],"title":"IngestJobListResponse"},"IngestJobSummary":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","title":"Status"},"started_at":{"type":"string","title":"Started At"},"files_requested":{"type":"integer","title":"Files Requested"},"chunks_added":{"type":"integer","title":"Chunks Added"},"errors":{"items":{},"type":"array","title":"Errors","default":[]}},"additionalProperties":true,"type":"object","required":["job_id","status","started_at","files_requested","chunks_added"],"title":"IngestJobSummary"},"IngestResponse":{"properties":{"job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Id"},"files_processed":{"type":"integer","title":"Files Processed","default":0},"chunks_added":{"type":"integer","title":"Chunks Added","default":0},"errors":{"items":{},"type":"array","title":"Errors","default":[]}},"additionalProperties":true,"type":"object","title":"IngestResponse"},"InsightsResponse":{"properties":{"total_interactions":{"type":"integer","title":"Total Interactions"},"avg_confidence_overall":{"type":"number","title":"Avg Confidence Overall"},"daily_confidence":{"items":{"$ref":"#/components/schemas/DailyConfidence"},"type":"array","title":"Daily Confidence"},"low_confidence_topics":{"items":{"$ref":"#/components/schemas/LowConfidenceTopic"},"type":"array","title":"Low Confidence Topics"},"high_negative_feedback_topics":{"items":{"$ref":"#/components/schemas/NegativeFeedbackTopic"},"type":"array","title":"High Negative Feedback Topics"}},"type":"object","required":["total_interactions","avg_confidence_overall","daily_confidence","low_confidence_topics","high_negative_feedback_topics"],"title":"InsightsResponse"},"InteractionDetailOut":{"properties":{"id":{"type":"integer","title":"Id"},"prompt":{"type":"string","title":"Prompt"},"retrieved_chunk_ids":{"items":{},"type":"array","title":"Retrieved Chunk Ids","default":[]},"answer_text":{"type":"string","title":"Answer Text"},"confidence_score":{"type":"number","title":"Confidence Score"},"model_used":{"type":"string","title":"Model Used"},"search_mode":{"type":"string","title":"Search Mode"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"feedback":{"items":{},"type":"array","title":"Feedback","default":[]}},"additionalProperties":true,"type":"object","required":["id","prompt","answer_text","confidence_score","model_used","search_mode"],"title":"InteractionDetailOut"},"InteractionListResponse":{"properties":{"interactions":{"items":{"$ref":"#/components/schemas/InteractionOut"},"type":"array","title":"Interactions"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["interactions","total","limit","offset"],"title":"InteractionListResponse"},"InteractionOut":{"properties":{"id":{"type":"integer","title":"Id"},"prompt":{"type":"string","title":"Prompt"},"confidence_score":{"type":"number","title":"Confidence Score"},"model_used":{"type":"string","title":"Model Used"},"search_mode":{"type":"string","title":"Search Mode"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"additionalProperties":true,"type":"object","required":["id","prompt","confidence_score","model_used","search_mode"],"title":"InteractionOut"},"LowConfidenceTopic":{"properties":{"topic":{"type":"string","title":"Topic"},"avg_confidence":{"type":"number","title":"Avg Confidence"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["topic","avg_confidence","count"],"title":"LowConfidenceTopic"},"NegativeFeedbackTopic":{"properties":{"topic":{"type":"string","title":"Topic"},"negative_rate":{"type":"number","title":"Negative Rate"},"total_interactions":{"type":"integer","title":"Total Interactions"},"negative_count":{"type":"integer","title":"Negative Count"}},"type":"object","required":["topic","negative_rate","total_interactions","negative_count"],"title":"NegativeFeedbackTopic"},"NodeChange":{"properties":{"id":{"type":"integer","title":"Id"},"node_id":{"type":"integer","title":"Node Id"},"detected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected At"},"old_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Hash"},"new_hash":{"type":"string","title":"New Hash"},"change_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Summary"},"significance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Significance"},"ai_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Summary"},"ai_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ai Confidence"}},"additionalProperties":true,"type":"object","required":["id","node_id","new_hash"],"title":"NodeChange"},"NodeChangesResponse":{"properties":{"node_id":{"type":"integer","title":"Node Id"},"changes":{"items":{"$ref":"#/components/schemas/NodeChange"},"type":"array","title":"Changes"}},"type":"object","required":["node_id","changes"],"title":"NodeChangesResponse"},"NodeCreateBody":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"url":{"type":"string","maxLength":500,"minLength":8,"title":"Url"},"tier":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"Tier"},"interval_minutes":{"type":"integer","maximum":10080.0,"minimum":10.0,"title":"Interval Minutes","default":1440}},"type":"object","required":["name","url","tier"],"title":"NodeCreateBody"},"NodeDocIngestResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"doc_id":{"type":"integer","title":"Doc Id"},"chunks_added":{"type":"integer","title":"Chunks Added"}},"type":"object","required":["ok","doc_id","chunks_added"],"title":"NodeDocIngestResponse"},"NodeDocument":{"properties":{"id":{"type":"integer","title":"Id"},"node_id":{"type":"integer","title":"Node Id"},"url":{"type":"string","title":"Url"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"status":{"type":"string","title":"Status"}},"additionalProperties":true,"type":"object","required":["id","node_id","url","status"],"title":"NodeDocument"},"NodeDocumentsResponse":{"properties":{"node_id":{"type":"integer","title":"Node Id"},"documents":{"items":{"$ref":"#/components/schemas/NodeDocument"},"type":"array","title":"Documents"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["node_id","documents","total"],"title":"NodeDocumentsResponse"},"NodeIdOkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"node_id":{"type":"integer","title":"Node Id"}},"type":"object","required":["ok","node_id"],"title":"NodeIdOkResponse"},"NodeListResponse":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/NodeOut"},"type":"array","title":"Nodes"}},"type":"object","required":["nodes"],"title":"NodeListResponse"},"NodeOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"url":{"type":"string","title":"Url"},"tier":{"type":"integer","title":"Tier"},"interval_minutes":{"type":"integer","title":"Interval Minutes"},"active":{"type":"boolean","title":"Active"},"next_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Run At"},"doc_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Count"}},"additionalProperties":true,"type":"object","required":["id","name","url","tier","interval_minutes","active"],"title":"NodeOut"},"NodeUpdateBody":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name"},"url":{"anyOf":[{"type":"string","maxLength":500,"minLength":8},{"type":"null"}],"title":"Url"},"tier":{"anyOf":[{"type":"integer","maximum":4.0,"minimum":1.0},{"type":"null"}],"title":"Tier"},"interval_minutes":{"anyOf":[{"type":"integer","maximum":10080.0,"minimum":10.0},{"type":"null"}],"title":"Interval Minutes"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"NodeUpdateBody"},"OkResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"}},"type":"object","required":["ok"],"title":"OkResponse"},"PhaseOut":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"subtitle":{"type":"string","title":"Subtitle"},"docs":{"items":{"$ref":"#/components/schemas/DocOut"},"type":"array","title":"Docs"}},"additionalProperties":true,"type":"object","required":["id","title","subtitle","docs"],"title":"PhaseOut"},"QueryBatchBody":{"properties":{"prompts":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Prompts","examples":[["What are the data retention rules?","Who is the data controller?"]]},"search_mode":{"type":"string","title":"Search Mode","description":"Retrieval strategy: 'vector' (cosine KNN, default), 'hybrid' (BM25 + cosine RRF), or 'keyword' (BM25 only).","default":"vector","examples":["vector","hybrid","keyword"]},"model_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Override","examples":["meta-llama/Llama-3.3-70B-Instruct-Turbo"]},"base_url_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url Override","examples":["https://api.fireworks.ai/inference/v1"]},"api_key_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Override","examples":["fw_..."]}},"type":"object","required":["prompts"],"title":"QueryBatchBody"},"QueryBatchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/QueryBatchResult"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["results","total"],"title":"QueryBatchResponse"},"QueryBatchResult":{"properties":{"prompt":{"type":"string","title":"Prompt"},"answer":{"type":"string","title":"Answer"},"sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sources"},"model_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Used"}},"type":"object","required":["prompt","answer","sources"],"title":"QueryBatchResult"},"QueryBody":{"properties":{"prompt":{"type":"string","maxLength":8000,"minLength":1,"title":"Prompt"}},"type":"object","required":["prompt"],"title":"QueryBody"},"QueryStreamBody":{"properties":{"prompt":{"type":"string","maxLength":8000,"minLength":1,"title":"Prompt","examples":["Summarise all ingested documents."]},"search_mode":{"type":"string","enum":["vector","hybrid","keyword"],"title":"Search Mode","description":"Retrieval strategy: 'vector' (cosine KNN, default), 'hybrid' (BM25 + cosine RRF), or 'keyword' (BM25 only).","default":"vector","examples":["vector","hybrid","keyword"]},"model_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Override"},"base_url_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url Override"},"api_key_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Override"}},"type":"object","required":["prompt"],"title":"QueryStreamBody"},"QuerySyncBody":{"properties":{"prompt":{"type":"string","maxLength":8000,"minLength":1,"title":"Prompt","examples":["What are the data retention rules?"]},"search_mode":{"type":"string","enum":["vector","hybrid","keyword"],"title":"Search Mode","description":"Retrieval strategy: 'vector' (cosine KNN, default), 'hybrid' (BM25 + cosine RRF), or 'keyword' (BM25 only).","default":"vector","examples":["vector","hybrid","keyword"]},"model_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Override"},"base_url_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url Override"},"api_key_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Override"}},"type":"object","required":["prompt"],"title":"QuerySyncBody"},"QuerySyncResponse":{"properties":{"answer":{"type":"string","title":"Answer"},"sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sources"},"model_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Used"}},"type":"object","required":["answer","sources"],"title":"QuerySyncResponse"},"ResetCorpusResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"chunks_deleted":{"type":"integer","title":"Chunks Deleted"}},"type":"object","required":["ok","chunks_deleted"],"title":"ResetCorpusResponse"},"SettingsBody":{"properties":{"AI_PROVIDER_BASE_URL":{"type":"string","title":"Ai Provider Base Url","default":""},"AI_PROVIDER_API_KEY":{"type":"string","title":"Ai Provider Api Key","default":""},"AI_GENERATION_MODEL":{"type":"string","title":"Ai Generation Model","default":""},"AI_EMBEDDING_MODEL":{"type":"string","title":"Ai Embedding Model","default":""},"OPENAI_API_KEY":{"type":"string","title":"Openai Api Key","default":""},"EMBEDDING_BASE_URL":{"type":"string","title":"Embedding Base Url","default":""},"EMBEDDING_API_KEY":{"type":"string","title":"Embedding Api Key","default":""},"EMBEDDING_DIM":{"type":"string","title":"Embedding Dim","default":""},"CRAWLER_BASE_URL":{"type":"string","title":"Crawler Base Url","default":""},"CRAWLER_API_KEY":{"type":"string","title":"Crawler Api Key","default":""},"CRAWLER_MODEL":{"type":"string","title":"Crawler Model","default":""},"ALERT_THRESHOLD":{"type":"string","title":"Alert Threshold","default":""},"RERANKER_MODEL":{"type":"string","title":"Reranker Model","default":""},"RERANKER_ENABLED":{"type":"string","title":"Reranker Enabled","default":""},"VISION_MODEL":{"type":"string","title":"Vision Model","default":""},"VISION_API_KEY":{"type":"string","title":"Vision Api Key","default":""},"VISION_BASE_URL":{"type":"string","title":"Vision Base Url","default":""},"BATCH_EMBED_THRESHOLD":{"type":"string","title":"Batch Embed Threshold","default":""},"BATCH_EMBED_ENABLED":{"type":"string","title":"Batch Embed Enabled","default":""}},"type":"object","title":"SettingsBody"},"SettingsSaveResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"config":{"$ref":"#/components/schemas/ConfigResponse"}},"type":"object","required":["ok","config"],"title":"SettingsSaveResponse"},"SettingsStateResponse":{"properties":{"AI_PROVIDER_BASE_URL":{"type":"string","title":"Ai Provider Base Url","default":""},"AI_PROVIDER_API_KEY":{"type":"string","title":"Ai Provider Api Key","default":""},"AI_GENERATION_MODEL":{"type":"string","title":"Ai Generation Model","default":""},"AI_EMBEDDING_MODEL":{"type":"string","title":"Ai Embedding Model","default":""},"OPENAI_API_KEY":{"type":"string","title":"Openai Api Key","default":""},"EMBEDDING_BASE_URL":{"type":"string","title":"Embedding Base Url","default":""},"EMBEDDING_API_KEY":{"type":"string","title":"Embedding Api Key","default":""},"EMBEDDING_DIM":{"type":"string","title":"Embedding Dim","default":""},"CRAWLER_BASE_URL":{"type":"string","title":"Crawler Base Url","default":""},"CRAWLER_API_KEY":{"type":"string","title":"Crawler Api Key","default":""},"CRAWLER_MODEL":{"type":"string","title":"Crawler Model","default":""},"ALERT_THRESHOLD":{"type":"string","title":"Alert Threshold","default":""},"RERANKER_MODEL":{"type":"string","title":"Reranker Model","default":""},"RERANKER_ENABLED":{"type":"string","title":"Reranker Enabled","default":""},"VISION_MODEL":{"type":"string","title":"Vision Model","default":""},"VISION_API_KEY":{"type":"string","title":"Vision Api Key","default":""},"VISION_BASE_URL":{"type":"string","title":"Vision Base Url","default":""},"BATCH_EMBED_THRESHOLD":{"type":"string","title":"Batch Embed Threshold","default":""},"BATCH_EMBED_ENABLED":{"type":"string","title":"Batch Embed Enabled","default":""}},"additionalProperties":true,"type":"object","title":"SettingsStateResponse","description":"Return shape of GET /api/settings — secret values are masked as 'configured'."},"StatusResponse":{"properties":{"total_chunks":{"type":"integer","title":"Total Chunks"},"files":{"items":{"$ref":"#/components/schemas/FileChunkInfo"},"type":"array","title":"Files"},"unindexed_files":{"items":{"type":"string"},"type":"array","title":"Unindexed Files"},"uploaded_docs_dir":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Uploaded Docs Dir"},"reranker_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Reranker Enabled"},"reranker_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reranker Model"},"pdf_support":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pdf Support"},"vision_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vision Model"},"batch_embed_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Batch Embed Enabled"},"batch_embed_threshold":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Batch Embed Threshold"},"db_connected":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Db Connected"}},"additionalProperties":true,"type":"object","required":["total_chunks","files","unindexed_files"],"title":"StatusResponse"},"TenderDeleteResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"notice_id":{"type":"integer","title":"Notice Id"}},"type":"object","required":["ok","notice_id"],"title":"TenderDeleteResponse"},"TenderListResponse":{"properties":{"notices":{"items":{"$ref":"#/components/schemas/TenderNoticeOut"},"type":"array","title":"Notices"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["notices","total"],"title":"TenderListResponse"},"TenderNoticeOut":{"properties":{"id":{"type":"integer","title":"Id"},"node_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Node Id"},"source_url":{"type":"string","title":"Source Url"},"reference_number":{"type":"string","title":"Reference Number"},"entity_name":{"type":"string","title":"Entity Name"},"title":{"type":"string","title":"Title"},"closing_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closing Date"},"budget_mad":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Budget Mad"},"download_urls":{"items":{"type":"string"},"type":"array","title":"Download Urls","default":[]},"confidence":{"type":"number","title":"Confidence"},"raw_text_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Raw Text Snippet"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":true,"type":"object","required":["id","source_url","reference_number","entity_name","title","confidence"],"title":"TenderNoticeOut"},"UrlIngestResponse":{"properties":{"job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Id"},"results":{"items":{"$ref":"#/components/schemas/UrlIngestResult"},"type":"array","title":"Results"},"ok_count":{"type":"integer","title":"Ok Count"},"error_count":{"type":"integer","title":"Error Count"}},"additionalProperties":true,"type":"object","required":["results","ok_count","error_count"],"title":"UrlIngestResponse"},"UrlIngestResult":{"properties":{"url":{"type":"string","title":"Url"},"kind":{"type":"string","title":"Kind"},"ok":{"type":"boolean","title":"Ok"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"chunks":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chunks"},"pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pages"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"additionalProperties":true,"type":"object","required":["url","kind","ok"],"title":"UrlIngestResult"},"_ExportBody":{"properties":{"text":{"type":"string","title":"Text"},"title":{"type":"string","title":"Title"},"format":{"type":"string","enum":["docx","pdf"],"title":"Format","default":"docx"},"language":{"type":"string","enum":["fr","ar","bilingual"],"title":"Language","default":"fr"}},"type":"object","required":["text","title"],"title":"_ExportBody"},"_GenerateBody":{"properties":{"doc_id":{"type":"string","title":"Doc Id"},"mode":{"type":"string","enum":["form","chat"],"title":"Mode","default":"form"},"form_data":{"additionalProperties":{"type":"string"},"type":"object","title":"Form Data"},"chat_text":{"type":"string","title":"Chat Text","default":""},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"language":{"type":"string","enum":["fr","ar","bilingual"],"title":"Language","default":"fr"},"model_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Override"},"base_url_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url Override"},"api_key_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Override"}},"type":"object","required":["doc_id"],"title":"_GenerateBody"},"app__api_v1__UrlIngestBody":{"properties":{"urls":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Urls","examples":[["https://example.com/policy"]]},"follow_links":{"type":"boolean","title":"Follow Links","default":false}},"type":"object","required":["urls"],"title":"UrlIngestBody"},"app__main__UrlIngestBody":{"properties":{"urls":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Urls"},"follow_links":{"type":"boolean","title":"Follow Links","default":false}},"type":"object","required":["urls"],"title":"UrlIngestBody"}}}}