{"openapi":"3.1.0","info":{"title":"Koncile API","version":"1.1.0"},"paths":{"/v1/check_api_key/":{"post":{"tags":["Public"],"summary":"Check Api Key","operationId":"check_api_key","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/upload_file/":{"post":{"tags":["Public"],"summary":"Upload File","operationId":"upload_file","security":[{"HTTPBearer":[]}],"parameters":[{"name":"folder_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Folder Id"}},{"name":"template_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Id"}},{"name":"doc_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/datatable_match_agents/{agent_id}/upload_csv/":{"post":{"tags":["Public"],"summary":"Upload Datatable Csv","description":"Upload a CSV datatable for a given Datatable Match Agent.\n\nThe agent must be of type `datatable_match` and linked to exactly one\ntemplate (class). The agent's active status is preserved and previously\nextracted documents on the linked template are not flagged for rerun.","operationId":"upload_datatable_csv","security":[{"HTTPBearer":[]}],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"integer","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_datatable_csv"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_tasks_results/":{"get":{"tags":["Public"],"summary":"Fetch Tasks Result","operationId":"fetch_tasks_result","security":[{"HTTPBearer":[]}],"parameters":[{"name":"task_id","in":"query","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_all_folders/":{"get":{"tags":["Public"],"summary":"Fetch All Folders","operationId":"fetch_all_folders","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigsApiOut"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/fetch_folder/":{"get":{"tags":["Public"],"summary":"Fetch Folder","operationId":"fetch_folder","security":[{"HTTPBearer":[]}],"parameters":[{"name":"folder_id","in":"query","required":true,"schema":{"type":"integer","title":"Folder Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_template/":{"get":{"tags":["Public"],"summary":"Fetch Template","operationId":"fetch_template","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"query","required":true,"schema":{"type":"integer","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_field/":{"get":{"tags":["Public"],"summary":"Fetch Field","operationId":"fetch_field","security":[{"HTTPBearer":[]}],"parameters":[{"name":"field_id","in":"query","required":true,"schema":{"type":"integer","title":"Field Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParameterApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_instruction/":{"get":{"tags":["Public"],"summary":"Fetch Instruction","operationId":"fetch_instruction","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instruction_id","in":"query","required":true,"schema":{"type":"integer","title":"Instruction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstructionApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_documents/":{"get":{"tags":["Public"],"summary":"Fetch Documents","operationId":"fetch_documents","security":[{"HTTPBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter documents created after this date (inclusive)","title":"Start Date"},"description":"Filter documents created after this date (inclusive)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter documents created before this date (inclusive)","title":"End Date"},"description":"Filter documents created before this date (inclusive)"},{"name":"folder_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter documents whose template belongs to this folder (config)","title":"Folder Id"},"description":"Filter documents whose template belongs to this folder (config)"},{"name":"template_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter documents extracted with this template (class)","title":"Template Id"},"description":"Filter documents extracted with this template (class)"},{"name":"updated_since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter documents created or modified at or after this timestamp. Accepts an ISO 8601 date (YYYY-MM-DD) or full datetime (YYYY-MM-DDTHH:MM:SS). Interpreted as UTC: a timezone-naive value is treated as UTC, and a timezone-aware value (e.g. ...Z or +02:00) is honored. Use the timestamp of your last successful poll to fetch only the delta.","title":"Updated Since"},"description":"Filter documents created or modified at or after this timestamp. Accepts an ISO 8601 date (YYYY-MM-DD) or full datetime (YYYY-MM-DDTHH:MM:SS). Interpreted as UTC: a timezone-naive value is treated as UTC, and a timezone-aware value (e.g. ...Z or +02:00) is honored. Use the timestamp of your last successful poll to fetch only the delta."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"integer"},"title":"Response Fetch Documents"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_document_data/":{"get":{"tags":["Public"],"summary":"Fetch Document Data","operationId":"fetch_document_data","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"query","required":true,"schema":{"type":"integer","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_file/":{"get":{"tags":["Public"],"summary":"Fetch File","operationId":"fetch_file","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Document Id"}},{"name":"task_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_raw_text/":{"get":{"tags":["Public"],"summary":"Fetch Raw Text","operationId":"fetch_raw_text","security":[{"HTTPBearer":[]}],"parameters":[{"name":"document_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Document Id"}},{"name":"task_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/fetch_files_batch/":{"post":{"tags":["Public"],"summary":"Fetch Files Batch","description":"Fetch multiple files and return them as a ZIP archive.\n\nProvide either document IDs, task IDs, or both to download files in a single\nZIP archive. Files are fetched concurrently and packaged efficiently.\n\n**Parameters:**\n- `document_ids` (optional): List of document IDs to include\n- `task_ids` (optional): List of task IDs to resolve to documents\n\n**Behavior:**\n- At least one of `document_ids` or `task_ids` must be provided\n- If multiple documents reference the same file, it's included only once\n- Fails on first error encountered (all-or-nothing operation)\n\n**Error Codes:**\n- `400 BATCH_INVALID_INPUT`: No IDs provided\n- `404 TASK_NOT_FOUND`: Task does not exist\n- `422 TASK_NOT_DONE`: Task is not completed yet\n- `422 TASK_NO_DOCUMENT`: Could not fetch file\n- `404 DOCUMENT_NOT_FOUND`: Document does not exist\n- `404 DOCUMENT_NO_FILE`: File not found\n- `403 BATCH_PERMISSION_DENIED`: Insufficient permissions\n- `500 BATCH_FILE_FETCH_FAILED`: File retrieval failed\n\n**Returns:**\n- `200`: ZIP file (application/zip) containing all requested files","operationId":"fetch_files_batch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchFilesBatchRequest"}}},"required":true},"responses":{"200":{"description":"ZIP file containing all requested files","content":{"application/json":{"schema":{}},"application/zip":{}}},"400":{"description":"Error response with detailed error information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchFileErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/create_folder/":{"post":{"tags":["Public"],"summary":"Create Folder","operationId":"create_folder","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigApiCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/create_template/":{"post":{"tags":["Public"],"summary":"Create Template","operationId":"create_template","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Template Id"}},{"name":"with_agents","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"With Agents"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassApiCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/create_field/":{"post":{"tags":["Public"],"summary":"Create Field","operationId":"create_field","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParameterApiCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParameterApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/create_instruction/":{"post":{"tags":["Public"],"summary":"Create Instruction Public","operationId":"create_instruction_public","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstructionApiCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstructionApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/update_folder/":{"put":{"tags":["Public"],"summary":"Update Folder","operationId":"update_folder","security":[{"HTTPBearer":[]}],"parameters":[{"name":"folder_id","in":"query","required":true,"schema":{"type":"integer","title":"Folder Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigApiUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/update_template/":{"put":{"tags":["Public"],"summary":"Update Template","operationId":"update_template","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"query","required":true,"schema":{"type":"integer","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassApiUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/update_field/":{"put":{"tags":["Public"],"summary":"Update Field","operationId":"update_field","security":[{"HTTPBearer":[]}],"parameters":[{"name":"field_id","in":"query","required":true,"schema":{"type":"integer","title":"Field Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParameterApiUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParameterApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/update_instruction/":{"put":{"tags":["Public"],"summary":"Update Instruction Public","operationId":"update_instruction_public","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instruction_id","in":"query","required":true,"schema":{"type":"integer","title":"Instruction Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstructionApiUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstructionApiOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/delete_folder/":{"delete":{"tags":["Public"],"summary":"Delete Folder","operationId":"delete_folder","security":[{"HTTPBearer":[]}],"parameters":[{"name":"folder_id","in":"query","required":true,"schema":{"type":"integer","title":"Folder Id"}},{"name":"override","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Override"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/delete_template/":{"delete":{"tags":["Public"],"summary":"Delete Template","operationId":"delete_template","security":[{"HTTPBearer":[]}],"parameters":[{"name":"template_id","in":"query","required":true,"schema":{"type":"integer","title":"Template Id"}},{"name":"override","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Override"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/delete_field/":{"delete":{"tags":["Public"],"summary":"Delete Field","operationId":"delete_field","security":[{"HTTPBearer":[]}],"parameters":[{"name":"field_id","in":"query","required":true,"schema":{"type":"integer","title":"Field Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/delete_instruction/":{"delete":{"tags":["Public"],"summary":"Delete Instruction Public","operationId":"delete_instruction_public","security":[{"HTTPBearer":[]}],"parameters":[{"name":"instruction_id","in":"query","required":true,"schema":{"type":"integer","title":"Instruction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/delete_doc/":{"delete":{"tags":["Public"],"summary":"Delete Document","operationId":"delete_document","security":[{"HTTPBearer":[]}],"parameters":[{"name":"doc_id","in":"query","required":true,"schema":{"type":"integer","title":"Doc Id"}},{"name":"delete_file","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Delete File"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/rerun_documents/":{"post":{"tags":["Public"],"summary":"Rerun Documents","operationId":"rerun_documents","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentRerunRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentRerunBatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"ApiOut":{"properties":{"status":{"$ref":"#/components/schemas/TaskStatus"},"status_message":{"type":"string","title":"Status Message"},"child_task_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Child Task Ids"},"task_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"},"document_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Document Id"},"document_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Name"},"General_fields":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"General Fields"},"Line_fields":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Line Fields"},"Fraud_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fraud Verdict"},"Fraud_justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fraud Justification"},"Fraud_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fraud Score"},"Fraud_detection_tests":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Fraud Detection Tests"}},"type":"object","required":["status","status_message"],"title":"ApiOut"},"BatchFileErrorResponse":{"properties":{"error_code":{"type":"string","title":"Error Code","description":"Machine-readable error code for programmatic handling","examples":["TASK_NOT_FOUND","DOCUMENT_PERMISSION_DENIED","BATCH_FILE_FETCH_FAILED"]},"error_type":{"type":"string","title":"Error Type","description":"Category of error","examples":["invalid_id","permission","fetch_failed","validation"]},"id_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id Type","description":"Type of ID that caused the error","examples":["task_id","document_id"]},"id":{"anyOf":[{"type":"integer"},{"type":"string"},{"type":"null"}],"title":"Id","description":"The specific ID that caused the error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["error_code","error_type","message"],"title":"BatchFileErrorResponse","description":"Standardized error response for batch file operations.\n\nThis schema ensures consistent error reporting across the public API,\nmaking it easier for API consumers to handle errors programmatically."},"Body_upload_datatable_csv":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_datatable_csv"},"Body_upload_file":{"properties":{"files":{"items":{"type":"string","format":"binary"},"type":"array","title":"Files"},"metadata":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata","examples":[""]}},"type":"object","required":["files"],"title":"Body_upload_file"},"ClassApiCreate":{"properties":{"folder_id":{"type":"integer","title":"Folder Id"},"name":{"type":"string","title":"Name"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"},"number_locale":{"anyOf":[{"$ref":"#/components/schemas/FormatLocale"},{"type":"null"}]},"date_locale":{"anyOf":[{"$ref":"#/components/schemas/FormatLocale"},{"type":"null"}]}},"type":"object","required":["folder_id","name"],"title":"ClassApiCreate"},"ClassApiOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"},"folder_id":{"type":"integer","title":"Folder Id"},"field_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Field Ids"},"instruction_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Instruction Ids"}},"type":"object","required":["id","name","folder_id"],"title":"ClassApiOut"},"ClassApiUpdate":{"properties":{"folder_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Folder Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"},"number_locale":{"anyOf":[{"$ref":"#/components/schemas/FormatLocale"},{"type":"null"}]},"date_locale":{"anyOf":[{"$ref":"#/components/schemas/FormatLocale"},{"type":"null"}]}},"type":"object","title":"ClassApiUpdate"},"ConfigApiCreate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"}},"type":"object","title":"ConfigApiCreate"},"ConfigApiOut":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"},"id":{"type":"integer","title":"Id"},"template_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Template Ids"},"templates":{"anyOf":[{"items":{"$ref":"#/components/schemas/ShortenedClassOut"},"type":"array"},{"type":"null"}],"title":"Templates"}},"type":"object","required":["id"],"title":"ConfigApiOut"},"ConfigApiUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"}},"type":"object","title":"ConfigApiUpdate"},"ConfigsApiOut":{"properties":{"folders":{"items":{"$ref":"#/components/schemas/ConfigApiOut"},"type":"array","title":"Folders"}},"type":"object","required":["folders"],"title":"ConfigsApiOut"},"DocumentRerunBatchResponse":{"properties":{"rerun":{"type":"integer","title":"Rerun","description":"Number of documents whose rerun was dispatched."},"not_rerun":{"type":"integer","title":"Not Rerun","description":"Number of documents that were not rerun (ineligible, foreign, or missing)."},"rerun_doc_ids":{"items":{"type":"integer"},"type":"array","title":"Rerun Doc Ids","description":"Document IDs whose rerun was dispatched."},"errors":{"items":{"$ref":"#/components/schemas/BatchFileErrorResponse"},"type":"array","title":"Errors","description":"Per-document reasons a document was not rerun (ineligible, not found, or belongs to another company)."}},"type":"object","required":["rerun","not_rerun"],"title":"DocumentRerunBatchResponse","description":"Response for a document-rerun batch request."},"DocumentRerunRequest":{"properties":{"doc_ids":{"items":{"type":"integer"},"type":"array","maxItems":500,"minItems":1,"title":"Doc Ids","description":"Document IDs to rerun (1-500). All must belong to the caller's company.","examples":[[123,456]]},"override_extraction":{"type":"boolean","title":"Override Extraction","description":"Force the rerun even if nothing has changed since the document's last extraction (normally a rerun is refused unless a parameter, instruction, or the template's extraction version changed). Only affects extraction (attributes/subattributes) — never forces OCR to re-run.","default":false}},"type":"object","required":["doc_ids"],"title":"DocumentRerunRequest","description":"Request body for rerunning one or more documents (document rerun —\nre-extract with the document's current template; OCR is never re-run\nby this endpoint, see `override_extraction`)."},"FetchFilesBatchRequest":{"properties":{"document_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Document Ids","description":"List of document IDs to fetch","examples":[[]]},"task_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Task Ids","description":"List of task IDs to resolve to documents","examples":[[]]}},"type":"object","title":"FetchFilesBatchRequest","description":"Request body for fetching multiple files as a batch."},"FormatLocale":{"type":"string","enum":["EU","US"],"title":"FormatLocale"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InstructionApiCreate":{"properties":{"content":{"type":"string","title":"Content"},"type":{"type":"string","title":"Type"},"template_id":{"type":"integer","title":"Template Id"}},"type":"object","required":["content","type","template_id"],"title":"InstructionApiCreate"},"InstructionApiOut":{"properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"id":{"type":"integer","title":"Id"},"template_id":{"type":"integer","title":"Template Id"}},"type":"object","required":["id","template_id"],"title":"InstructionApiOut"},"InstructionApiUpdate":{"properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},"type":"object","title":"InstructionApiUpdate"},"ParameterApiCreate":{"properties":{"name":{"type":"string","title":"Name"},"template_id":{"type":"integer","title":"Template Id"},"type":{"type":"string","title":"Type"},"format":{"$ref":"#/components/schemas/ParameterFormat"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"}},"type":"object","required":["name","template_id","type","format"],"title":"ParameterApiCreate"},"ParameterApiOut":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"},"format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format"},"position":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Position"},"id":{"type":"integer","title":"Id"},"template_id":{"type":"integer","title":"Template Id"}},"type":"object","required":["id","template_id"],"title":"ParameterApiOut"},"ParameterApiUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"},"format":{"anyOf":[{"$ref":"#/components/schemas/ParameterFormat"},{"type":"null"}]}},"type":"object","title":"ParameterApiUpdate"},"ParameterFormat":{"type":"string","enum":["text","number","date","invoice_date","invoice_number","code","label","unit_price","total_price","quantity","quantity_unit","empty","default","multiple_choice","boolean","unit","invoice_amount","document_name","fraud_verdict"],"title":"ParameterFormat"},"ShortenedClassOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Desc"}},"type":"object","required":["id","name"],"title":"ShortenedClassOut"},"TaskStatus":{"type":"string","enum":["IN PROGRESS","DONE","FAILED","DUPLICATE"],"title":"TaskStatus"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}},"externalDocs":{"description":"Full documentation here","url":"https://docs.koncile.ai"}}