{"openapi":"3.1.0","info":{"title":"Gemina API","description":"Extract structured data from invoices and financial documents, then search, aggregate, and chat over everything you've processed. Authenticate with your API key in the `X-API-Key` header; browser-embedded components use short-lived session tokens minted via `POST /v1/sessions/token`. Guides: https://console.gemina.co/docs","version":"1.9.0"},"paths":{"/api/v1/documents/uploads":{"post":{"tags":["Document"],"summary":"Upload Document","description":"Upload a document file (image or PDF) for processing\n\nAccepts:\n- Image files: PNG, JPEG, JPG, GIF, WEBP, HEIC/HEIF, AVIF\n- PDF files: PDF\n\nReturns document ID and storage location for further processing","operationId":"upload_document","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"202":{"description":"Accepted — processing continues; poll the results endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/v1/documents/uploads/user":{"post":{"tags":["Document"],"summary":"Upload Document By User","description":"Upload a document file (image or PDF) for processing\n\nAccepts:\n- Image files: PNG, JPEG, JPG, GIF, WEBP, HEIC/HEIF, AVIF\n- PDF files: PDF\n\nReturns document ID and storage location for further processing","operationId":"upload_document_by_user","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_by_user"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"202":{"description":"Accepted — processing continues; poll the results endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/documents/requests":{"post":{"tags":["Document"],"summary":"Create Document Processing Request","description":"Posts an async request for a document file (image or PDF) processing\n\nAccepts:\n- Image files: PNG, JPEG, JPG, GIF, WEBP, HEIC/HEIF, AVIF\n- PDF files: PDF\n\nReturns document ID and storage location for further processing","operationId":"create_document_processing_request","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_document_processing_request"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/v1/documents/uploads/web":{"post":{"tags":["Document"],"summary":"Upload Web Document","description":"Upload a document file from a URL (image or PDF) for processing\n\nAccepts:\n- Image files: PNG, JPEG, JPG, GIF, WEBP, HEIC/HEIF, AVIF\n- PDF files: PDF\n\nReturns document ID and storage location for further processing","operationId":"upload_web_document","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebDocumentUploadInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"202":{"description":"Accepted — processing continues; poll the results endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/v1/documents/requests/web":{"post":{"tags":["Document"],"summary":"Create Web Document Processing Request","description":"Upload a document file from a URL (image or PDF) for processing\n\nAccepts:\n- Image files: PNG, JPEG, JPG, GIF, WEBP, HEIC/HEIF, AVIF\n- PDF files: PDF\n\nReturns document ID and storage location for further processing","operationId":"create_web_document_processing_request","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebDocumentUploadInDTO"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/v1/documents/requests/user":{"post":{"tags":["Document"],"summary":"Create Document Processing Request By User","description":"Posts an async request for a document file (image or PDF) processing with user authentication\n\nAccepts:\n- Image files: PNG, JPEG, JPG, GIF, WEBP, HEIC/HEIF, AVIF\n- PDF files: PDF\n\nReturns document ID and storage location for further processing","operationId":"create_document_processing_request_by_user","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_document_processing_request_by_user"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/documents/requests/user/web":{"post":{"tags":["Document"],"summary":"Create Web Document Processing Request By User","description":"Posts an async request for a document file from a URL (image or PDF) processing with user authentication\n\nAccepts:\n- Image files: PNG, JPEG, JPG, GIF, WEBP, HEIC/HEIF, AVIF\n- PDF files: PDF\n\nReturns document ID and storage location for further processing","operationId":"create_web_document_processing_request_by_user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebDocumentUploadInDTO"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/documents/results/{correlation_id}":{"get":{"tags":["Document"],"summary":"Get Document Processing Result By Correlation Id","description":"Poll for an async document processing result by correlation ID.\n\nReturns:\n- 202 Accepted while processing (with a pointer for polling)\n- 200 OK when processing is complete (with the final result payload)","operationId":"get_document_processing_result_by_correlation_id","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"correlation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Correlation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"202":{"description":"Accepted — processing continues; poll the results endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/results/user/{correlation_id}":{"get":{"tags":["Document"],"summary":"Get Document Processing Result By Correlation Id By User","description":"Poll for an async document processing result by correlation ID, using user credentials.\n\nReturns:\n- 202 Accepted while processing (with a pointer for polling)\n- 200 OK when processing is complete (with the final result payload)","operationId":"get_document_processing_result_by_correlation_id_by_user","security":[{"OAuth2PasswordBearer":[]},{"APIKeyHeader":[]}],"parameters":[{"name":"correlation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Correlation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"202":{"description":"Accepted — processing continues; poll the results endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentProcessingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/extractions/{target_document_extraction_id}/feedback":{"put":{"tags":["Document"],"summary":"Validate Document Extraction","description":"One-shot validation feedback, dual-auth: X-API-Key (key-scoped,\nunchanged) or a Bearer session token (tenant-scoped, gated by the signed\nxids/euid claims). Semantics untouched: whole-payload, 409 on\nresubmission, scored server-side by the processor's DataValidator.","operationId":"validate_document_extraction","parameters":[{"name":"target_document_extraction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document extraction to validate"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionValidationInDTO"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionValidationResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/documents/extractions/{target_document_extraction_id}":{"delete":{"tags":["Document"],"summary":"Purge Document Extraction","operationId":"purge_document_extraction","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"target_document_extraction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document extraction to purge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPurgingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/extractions/{target_document_extraction_id}/user":{"delete":{"tags":["Document"],"summary":"Purge Document Extraction By User","operationId":"purge_document_extraction_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"target_document_extraction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document extraction to purge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPurgingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/{target_document_id}":{"delete":{"tags":["Document"],"summary":"Purge Document","operationId":"purge_document","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"target_document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document to purge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPurgingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/{target_document_id}/user":{"delete":{"tags":["Document"],"summary":"Purge Document By User","operationId":"purge_document_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"target_document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document to purge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPurgingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/external/{target_document_external_id}":{"delete":{"tags":["Document"],"summary":"Purge Documents With External Id","operationId":"purge_documents_with_external_id","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"target_document_external_id","in":"path","required":true,"schema":{"type":"string","title":"The external ID of the documents to purge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPurgingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/external/{target_document_external_id}/user":{"delete":{"tags":["Document"],"summary":"Purge Documents With External Id By User","operationId":"purge_documents_with_external_id_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"target_document_external_id","in":"path","required":true,"schema":{"type":"string","title":"The external ID of the documents to purge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPurgingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/endusers/{target_end_user_id}":{"delete":{"tags":["Document"],"summary":"Purge Documents With End User Id","operationId":"purge_documents_with_end_user_id","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"target_end_user_id","in":"path","required":true,"schema":{"type":"string","title":"The end user ID of the documents to purge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPurgingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/endusers/{target_end_user_id}/user":{"delete":{"tags":["Document"],"summary":"Purge Documents With End User Id By User","operationId":"purge_documents_with_end_user_id_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"target_end_user_id","in":"path","required":true,"schema":{"type":"string","title":"The end user ID of the documents to purge"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPurgingResultOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/extractions":{"get":{"tags":["Document"],"summary":"Find Document Extractions","description":"Return a list of users, based on given parameters.","operationId":"find_document_extractions","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Skip"},"description":"Number of items to skip"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"description":"Number of items to retrieve","default":100,"title":"Limit"},"description":"Number of items to retrieve"},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start date","description":"Return items with created_at >= this ISO 8601 date (YYYY-MM-DD)"},"description":"Return items with created_at >= this ISO 8601 date (YYYY-MM-DD)"},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End date","description":"Return items with created_at <= this ISO 8601 datetime (YYYY-MM-DD)"},"description":"Return items with created_at <= this ISO 8601 datetime (YYYY-MM-DD)"},{"name":"sort_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort field","description":"Field to sort by","default":"created_at"},"description":"Field to sort by"},{"name":"sort_method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortMethodModel","title":"Sort method","description":"Sort method: asc or desc","default":"desc"},"description":"Sort method: asc or desc"},{"name":"external_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for a given external identifier","title":"External Id"},"description":"Filter for a given external identifier"},{"name":"end_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for an End User ID","title":"End User Id"},"description":"Filter for an End User ID"},{"name":"with_purged","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Include purged document extractions","default":false,"title":"With Purged"},"description":"Include purged document extractions"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionsViewOutDTO"}}}},"400":{"description":"Malformed request — for example an unknown sort field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/extractions/user":{"get":{"tags":["Document"],"summary":"Find Document Extractions By User","description":"Return a list of users, based on given parameters.","operationId":"find_document_extractions_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Skip"},"description":"Number of items to skip"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"description":"Number of items to retrieve","default":100,"title":"Limit"},"description":"Number of items to retrieve"},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start date","description":"Return items with created_at >= this ISO 8601 date (YYYY-MM-DD)"},"description":"Return items with created_at >= this ISO 8601 date (YYYY-MM-DD)"},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End date","description":"Return items with created_at <= this ISO 8601 datetime (YYYY-MM-DD)"},"description":"Return items with created_at <= this ISO 8601 datetime (YYYY-MM-DD)"},{"name":"sort_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort field","description":"Field to sort by","default":"created_at"},"description":"Field to sort by"},{"name":"sort_method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortMethodModel","title":"Sort method","description":"Sort method: asc or desc","default":"desc"},"description":"Sort method: asc or desc"},{"name":"external_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for a given external identifier","title":"External Id"},"description":"Filter for a given external identifier"},{"name":"end_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for an End User ID","title":"End User Id"},"description":"Filter for an End User ID"},{"name":"extraction_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter for an exact document extraction ID — used to deep-link from the credit audit trail","title":"Extraction Id"},"description":"Filter for an exact document extraction ID — used to deep-link from the credit audit trail"},{"name":"with_purged","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Include purged document extractions","default":false,"title":"With Purged"},"description":"Include purged document extractions"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionsViewOutDTO"}}}},"400":{"description":"Malformed request — for example an unknown sort field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/extractions/costs":{"get":{"tags":["Document"],"summary":"Get Extraction Costs","description":"Look up what a batch of extractions cost.\n\nLean by design: costs only — no signed document URLs, no extracted values.\nUse this instead of the full extraction view when all you need is spend.\n\nPass one `ids` parameter per extraction, e.g.\n`?ids=<uuid>&ids=<uuid>`.\n\nIds belonging to another API key, and ids that do not exist, are omitted\nfrom the response rather than reported — the endpoint cannot be used to\ndiscover whether an extraction id is real. Key the response by\n`extractionId`; order is not guaranteed.\n\nEach entry carries a `state`:\n- `settled` — the charge is on record; the number is final\n- `pending` — billing has not run yet; retry\n- `not_charged` — billing finished with no charge; this never resolves","operationId":"get_extraction_costs","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100,"title":"Extraction ids","description":"Repeat the parameter once per id, e.g. ?ids=<uuid>&ids=<uuid>. Up to 100 per call."},"description":"Repeat the parameter once per id, e.g. ?ids=<uuid>&ids=<uuid>. Up to 100 per call."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionCostsOutDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/documents/extractions/{document_extraction_id}/cost":{"get":{"tags":["Document"],"summary":"Get Extraction Cost","description":"Look up what a single extraction cost.\n\nSee the bulk variant (`/extractions/costs`) for the `state` semantics. An\nextraction the calling API key does not own is reported as not found.","operationId":"get_extraction_cost","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"document_extraction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the extraction to price"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionCostOutResultDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/extractions/{document_extraction_id}":{"get":{"tags":["Document"],"summary":"Get Document Extraction","description":"One extraction, dual-auth: X-API-Key (key-scoped, unchanged) or a\nBearer session token (tenant-scoped, gated by the signed xids/euid\nclaims). List/search extraction routes stay key/JWT-only by design.","operationId":"get_document_extraction","parameters":[{"name":"document_extraction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document extraction to retrieve"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionPrimaryViewOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/documents/extractions/{document_extraction_id}/user":{"get":{"tags":["Document"],"summary":"Get Document Extraction By User","operationId":"get_document_extraction_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_extraction_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document extraction to retrieve"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionPrimaryViewOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/":{"get":{"tags":["Document"],"summary":"Find Documents","description":"Return a list of users, based on given parameters.","operationId":"find_documents","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Skip"},"description":"Number of items to skip"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"description":"Number of items to retrieve","default":100,"title":"Limit"},"description":"Number of items to retrieve"},{"name":"search_query","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for a given search query","title":"Search Query"},"description":"Filter for a given search query"},{"name":"sort_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort field","description":"Field to sort by","default":"created_at"},"description":"Field to sort by"},{"name":"sort_method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortMethodModel","title":"Sort method","description":"Sort method: asc or desc","default":"desc"},"description":"Sort method: asc or desc"},{"name":"external_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for a given external identifier","title":"External Id"},"description":"Filter for a given external identifier"},{"name":"end_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for an End User ID","title":"End User Id"},"description":"Filter for an End User ID"},{"name":"with_purged","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Include purged documents","default":false,"title":"With Purged"},"description":"Include purged documents"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentsViewOutDTO"}}}},"400":{"description":"Malformed request — for example an unknown sort field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/user":{"get":{"tags":["Document"],"summary":"Find Documents By User","description":"Return a list of users, based on given parameters.","operationId":"find_documents_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Skip"},"description":"Number of items to skip"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"description":"Number of items to retrieve","default":100,"title":"Limit"},"description":"Number of items to retrieve"},{"name":"search_query","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for a given search query","title":"Search Query"},"description":"Filter for a given search query"},{"name":"sort_field","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort field","description":"Field to sort by","default":"created_at"},"description":"Field to sort by"},{"name":"sort_method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortMethodModel","title":"Sort method","description":"Sort method: asc or desc","default":"desc"},"description":"Sort method: asc or desc"},{"name":"external_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for a given external identifier","title":"External Id"},"description":"Filter for a given external identifier"},{"name":"end_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}],"description":"Filter for an End User ID","title":"End User Id"},"description":"Filter for an End User ID"},{"name":"with_purged","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Include purged documents","default":false,"title":"With Purged"},"description":"Include purged documents"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentsViewOutDTO"}}}},"400":{"description":"Malformed request — for example an unknown sort field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/count/user":{"get":{"tags":["Document"],"summary":"Get Total Number Of Stored Documents By User","operationId":"get_total_number_of_stored_documents_by_user","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumberOfStoredDocumentsOutDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/documents/{document_id}":{"get":{"tags":["Document"],"summary":"Get Document","operationId":"get_document","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document to retrieve"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPrimaryViewOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/{document_id}/user":{"get":{"tags":["Document"],"summary":"Get Document By User","operationId":"get_document_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document to retrieve"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentPrimaryViewOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/documents/{document_id}/extractions":{"post":{"tags":["Document"],"summary":"Add extraction types to an existing document","description":"Run additional extraction types on a document that is already stored.\n\nNo upload: the document's stored artifacts are reused and only the\nextraction step runs. Billed per extraction like an upload. Returns the\nwhole document (all extractions, old and new). When the new extractions\nare still running the response is HTTP 202 and ``pollCorrelationId`` /\n``Location`` point at the existing results endpoint.","operationId":"add_document_extractions","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document to extract from"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddExtractionsInDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentAddExtractionsOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}},"429":{"description":"Rate or quota limit exceeded; `errors[0].error_code` says which. Retryable limits (`FILETAG_RATE_LIMIT_EXCEEDED`, burst limits) send a `Retry-After` header: back off and retry after it. `CREDIT_EXHAUSTED` for an account with no active subscription or trial sends no `Retry-After` and is not resolved by waiting: start the free trial (once per account) or choose a plan in the console.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"409":{"description":"The request conflicts with the resource's current state; `errors[0].error_code` says which rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"410":{"description":"The resource's content has been purged and cannot be processed again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"202":{"description":"The new extractions are still running. Poll `pollCorrelationId` (also in `Location`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentAddExtractionsOutDTO"}}}}}}},"/api/v1/documents/{document_id}/extractions/user":{"post":{"tags":["Document"],"summary":"Add extraction types to an existing document (user credentials)","operationId":"add_document_extractions_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the document to extract from"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddExtractionsInDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentAddExtractionsOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}},"429":{"description":"Rate or quota limit exceeded; `errors[0].error_code` says which. Retryable limits (`FILETAG_RATE_LIMIT_EXCEEDED`, burst limits) send a `Retry-After` header: back off and retry after it. `CREDIT_EXHAUSTED` for an account with no active subscription or trial sends no `Retry-After` and is not resolved by waiting: start the free trial (once per account) or choose a plan in the console.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"409":{"description":"The request conflicts with the resource's current state; `errors[0].error_code` says which rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"410":{"description":"The resource's content has been purged and cannot be processed again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"202":{"description":"The new extractions are still running. Poll `pollCorrelationId` (also in `Location`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentAddExtractionsOutDTO"}}}}}}},"/api/v1/templates/generate":{"post":{"tags":["Templates"],"summary":"Generate template from file","description":"Upload a PDF or image to generate a template. Processes synchronously (up to 60s).","operationId":"generate_template","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_generate_template"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/templates/generate/web":{"post":{"tags":["Templates"],"summary":"Generate template from URL","description":"Provide a URL to a PDF or image to generate a template. Processes synchronously (up to 60s).","operationId":"generate_template_from_url","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateTemplateFromUrlInDTO"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/templates/generate/requests":{"post":{"tags":["Templates"],"summary":"Generate template from file (async)","description":"Upload a PDF or image to generate a template. Returns immediately with template in PENDING status.","operationId":"generate_template_async","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_generate_template_async"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/templates/generate/requests/web":{"post":{"tags":["Templates"],"summary":"Generate template from URL (async)","description":"Provide a URL to generate a template. Returns immediately with template in PENDING status.","operationId":"generate_template_from_url_async","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateTemplateFromUrlInDTO"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/templates":{"post":{"tags":["Templates"],"summary":"Create template","description":"Create a new extraction template with a provided schema.","operationId":"create_template","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateInDTO"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Templates"],"summary":"List templates","description":"List all templates for the authenticated user.","operationId":"list_templates","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active status","title":"Is Active"},"description":"Filter by active status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/available":{"get":{"tags":["Templates"],"summary":"List available templates (API key)","description":"List all templates available for the user associated with the API key.","operationId":"list_templates_by_api_key","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active status","title":"Is Active"},"description":"Filter by active status"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateListOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{template_id}":{"get":{"tags":["Templates"],"summary":"Get template","description":"Get a specific template by ID.","operationId":"get_template","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Templates"],"summary":"Update template","description":"Update an existing template.","operationId":"update_template","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateInDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Templates"],"summary":"Delete template","description":"Soft delete a template and clean up associated storage.","operationId":"delete_template","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{template_id}/activate":{"post":{"tags":["Templates"],"summary":"Activate template","description":"Activate a frozen template. Requires available capacity within the plan's template limit.","operationId":"activate_template","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/templates/{template_id}/deactivate":{"post":{"tags":["Templates"],"summary":"Deactivate template","description":"Deactivate (freeze) a template. Frozen templates cannot be used in extractions or edited.","operationId":"deactivate_template","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/plans":{"get":{"tags":["Subscriptions"],"summary":"List Active Plans","operationId":"list_active_plans","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanListOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/plans/{plan_id}":{"get":{"tags":["Subscriptions"],"summary":"Get Plan","operationId":"get_plan","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the plan"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanDetailOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/top-up-packs":{"get":{"tags":["Subscriptions"],"summary":"List Top Up Packs","operationId":"list_top_up_packs","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpPackListOutDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/subscriptions":{"post":{"tags":["Subscriptions"],"summary":"Subscribe","operationId":"subscribe","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeInDTO"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/subscriptions/me":{"get":{"tags":["Subscriptions"],"summary":"Get My Subscription","operationId":"get_my_subscription","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["Subscriptions"],"summary":"Change Plan","operationId":"change_plan","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CheckoutOutDTO"},{"$ref":"#/components/schemas/SubscriptionOutDTO"}],"title":"Response Change Plan"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["Subscriptions"],"summary":"Cancel Subscription","operationId":"cancel_subscription","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/subscriptions/me/payment-method-update":{"post":{"tags":["Subscriptions"],"summary":"Start Payment Method Update","description":"Start replacing the card on file for the caller's subscription (or\nenterprise contract). POST, not GET: for an active subscription Paddle\ncreates a new zero-value transaction on every call.","operationId":"start_payment_method_update","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodUpdateOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/subscriptions/me/top-up":{"post":{"tags":["Subscriptions"],"summary":"Purchase Top Up","operationId":"purchase_top_up","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpPurchaseInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpPurchaseOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/subscriptions/me/usage":{"get":{"tags":["Subscriptions"],"summary":"Get Credit Usage","operationId":"get_credit_usage","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageBreakdownListOutDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/subscriptions/me/storage":{"get":{"tags":["Subscriptions"],"summary":"Get My Storage Usage","operationId":"get_my_storage_usage","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageUsageOutDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/subscriptions/me/credits":{"get":{"tags":["Subscriptions"],"summary":"Get Credit History","operationId":"get_credit_history","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"meter","in":"query","required":false,"schema":{"$ref":"#/components/schemas/CreditMeterFilter","description":"Meter to page. Defaults to 'processing_credits' so each page has a single running balance. Use 'filetag_credits' for the FileTag audit trail, or 'all' for an interleaved admin view (balance_after will jump between pools — expect to render a meter column).","default":"processing_credits"},"description":"Meter to page. Defaults to 'processing_credits' so each page has a single running balance. Use 'filetag_credits' for the FileTag audit trail, or 'all' for an interleaved admin view (balance_after will jump between pools — expect to render a meter column)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditTransactionListOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/webhooks/paddle":{"post":{"tags":["Billing"],"summary":"Paddle Webhook","operationId":"paddle_webhook","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponseDTO"}}}}}}},"/api/v1/billing/invoices":{"get":{"tags":["Billing"],"summary":"Get User Invoices","operationId":"get_user_invoices","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/invoices/{invoice_id}":{"get":{"tags":["Billing"],"summary":"Get Invoice","operationId":"get_invoice","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The invoice ID"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/invoices/{invoice_id}/pdf":{"get":{"tags":["Billing"],"summary":"Get Invoice Pdf","operationId":"get_invoice_pdf","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The invoice ID"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePdfOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/enterprise/me":{"get":{"tags":["Enterprise"],"summary":"Get My Contract","operationId":"get_my_contract","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractOutDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/enterprise/me/usage":{"get":{"tags":["Enterprise"],"summary":"Get My Usage","operationId":"get_my_usage","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"From Date"}},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"To Date"}},{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/PeriodPresetModel"},{"type":"null"}],"title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/enterprise/me/transactions":{"get":{"tags":["Enterprise"],"summary":"Get My Transactions","operationId":"get_my_transactions","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnterpriseTransactionListOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/enterprise/me/spend-limit":{"get":{"tags":["Enterprise"],"summary":"Get My Spend Limit","operationId":"get_my_spend_limit","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendLimitOutDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["Enterprise"],"summary":"Set My Spend Limit","operationId":"set_my_spend_limit","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendLimitUpdateInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpendLimitOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/legal/tos":{"get":{"tags":["Legal"],"summary":"Get Current Tos","description":"Returns the current Terms of Service version, effective date,\ncontent (markdown), and website URL.","operationId":"get_current_tos","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TOSOutDTO"}}}}}}},"/api/v1/contact":{"post":{"tags":["Contact"],"summary":"Submit Contact Form","operationId":"submit_contact_form","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFormInDTO"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/free-tier":{"get":{"tags":["FreeTier"],"summary":"Get Free Tier","description":"Returns the public free-tier configuration (FileTag plan) used by the\nconsole pricing page, MCP landing page, etc. Requires an authenticated\ncaller but is otherwise read-only and safe for USER, APP, and ADMIN.","operationId":"get_free_tier","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreeTierConfigOutDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/filetag":{"post":{"tags":["FileTag"],"summary":"Tag Document","description":"Extract filing metadata (title, type, date, tags, ...) from a single\nPDF or image and return a suggested filename plus a set of filename\npatterns.\n\nRequires API-key auth (``X-API-Key`` header). Subject to the per-API-key\nburst rate limit and -- for free-tier users -- the monthly FileTag\ncredit allowance.","operationId":"tag_document","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_tag_document"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileTagResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/v1/filetag/user":{"post":{"tags":["FileTag"],"summary":"Tag Document By User","description":"Browser-safe variant of ``POST /v1/filetag``.\n\nAuthenticates with the caller's JWT (``Authorization: Bearer <jwt>``)\nand treats the ``X-API-Key`` header as the *UUID id* of one of the\nuser's API keys — NOT the raw secret. The key's ownership is verified\nserver-side by matching ``APIKeyModel.id == header AND user_id ==\njwt``, so the raw secret never needs to leave the server.\n\nMirrors the auth pattern used by ``POST /v1/documents/uploads/user``.\nFor server-to-server callers (the raw-key path used by MCP and public\nSDKs), continue to use ``POST /v1/filetag``.","operationId":"tag_document_by_user","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_tag_document_by_user"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileTagResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/filetag/me/balance":{"get":{"tags":["FileTag"],"summary":"Get My Filetag Balance","description":"Current user's FileTag balance, effective monthly allowance, and next\nreset timestamp. Used by the console dashboard to surface remaining tags.","operationId":"get_my_filetag_balance","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileTagBalanceOutDTO"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/v1/filetag/me/credits":{"get":{"tags":["FileTag"],"summary":"Get My Filetag Credit History","description":"Paginated audit trail of FileTag credit transactions for the current\nuser. Returns the same rows as\n``GET /v1/subscriptions/me/credits?meter=filetag_credits`` — kept as a\nFileTag-namespaced alias so free-tier users (who have no subscription\nendpoint affinity) can discover the history endpoint naturally.","operationId":"get_my_filetag_credit_history","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditTransactionListOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/files/upload-url":{"post":{"tags":["Files"],"summary":"Create Upload","description":"Reserve a pre-signed PUT slot for a forthcoming upload.\n\nReturns the signed URL, the headers the agent must echo on the PUT,\nthe slot expiry, and a ``next_tool_call`` recipe pointing at\n``tag_file`` -- the agent copy-pastes the ``file_id`` to run the\npipeline against the uploaded bytes.","operationId":"create_upload","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesCreateUploadInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FilesUploadInstructionsOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/v1/files/{file_id}/tag":{"post":{"tags":["Files"],"summary":"Tag File","description":"Run the FileTag pipeline against a previously uploaded slot.\n\n``file_id`` is taken from the URL path; the optional ``external_id``\nand ``end_user_id`` come from the JSON body. The router constructs a\n:class:`TagFileInDTO` from the path + body and hands it off to the\nservice.","operationId":"tag_file","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagFileBodyDTO"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileTagResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/files/tag-url":{"post":{"tags":["Files"],"summary":"Tag Url","description":"Fetch a remote URL server-side under SSRF guards, then run FileTag.\n\nThe bytes never traverse the LLM context -- the URL goes in, the\nserver fetches via :func:`fetch_safe`, and the result-DTO comes back.\nToken cost is independent of file size on this path.","operationId":"tag_url","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagUrlInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileTagResultOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/v1/retrieval/status":{"get":{"tags":["Retrieval"],"summary":"Retrieval Status","description":"How many of the tenant's documents are currently indexed.\n\nSame dual auth as /query: X-API-Key OR a Bearer retrieval token — but\nonly an *unpinned* (whole-account) token is accepted. An end-user-pinned\ntoken gets 403: the account-wide index size must not leak into a single\nend-user's browser session.","operationId":"retrieval_status","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalStatusOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/retrieval/query":{"post":{"tags":["Retrieval"],"summary":"Retrieval Query","description":"Structured filters, semantic or hybrid search over the tenant's index.\n\nAuth: X-API-Key (server-to-server; ``filters.endUserId`` is a trusted\nfilter) OR a Bearer retrieval token (embedded SDK; a token-pinned\nend-user scope is ENFORCED server-side and cannot be widened by the\nrequest body). The tenant boundary always comes from the credential.","operationId":"retrieval_query","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalQueryInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalQueryOutDTO"}}}},"429":{"description":"Rate or quota limit exceeded; `errors[0].error_code` says which. Retryable limits (`FILETAG_RATE_LIMIT_EXCEEDED`, burst limits) send a `Retry-After` header: back off and retry after it. `CREDIT_EXHAUSTED` for an account with no active subscription or trial sends no `Retry-After` and is not resolved by waiting: start the free trial (once per account) or choose a plan in the console.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/retrieval/aggregate":{"post":{"tags":["Retrieval"],"summary":"Retrieval Aggregate","description":"Sums/averages/counts/group-bys over the tenant's document index.\n\nDeterministic DSL compiled server-side against whitelisted columns.\nWhen money metrics are requested without a currency filter/grouping, the\nserver groups by currency automatically (mixed-currency sums are wrong by\nconstruction) and flags it in ``meta.currencyGroupingAdded``. Same dual\nauth as /query (API key, or Bearer token with enforced end-user scope).","operationId":"retrieval_aggregate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalAggregateInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalAggregateOutDTO"}}}},"429":{"description":"Rate or quota limit exceeded; `errors[0].error_code` says which. Retryable limits (`FILETAG_RATE_LIMIT_EXCEEDED`, burst limits) send a `Retry-After` header: back off and retry after it. `CREDIT_EXHAUSTED` for an account with no active subscription or trial sends no `Retry-After` and is not resolved by waiting: start the free trial (once per account) or choose a plan in the console.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/retrieval/fields":{"get":{"tags":["Retrieval"],"summary":"Retrieval Fields","description":"Observed structured field NAMES per document type (self-query catalog).\n\nNames only — no values; tenant-scoped like every retrieval path.","operationId":"retrieval_fields","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalFieldsOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/sessions/token":{"post":{"tags":["Sessions"],"summary":"Mint Retrieval Token","description":"Mint a short-lived, signed, query-only retrieval token.\n\nScope is pinned server-side from the authenticated key: the tenant is the\nkey's user; an optional ``endUserId`` narrows the session to one end-user.","operationId":"mint_retrieval_token","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTokenInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTokenOutDTO"}}}},"429":{"description":"Rate or quota limit exceeded; `errors[0].error_code` says which. Retryable limits (`FILETAG_RATE_LIMIT_EXCEEDED`, burst limits) send a `Retry-After` header: back off and retry after it. `CREDIT_EXHAUSTED` for an account with no active subscription or trial sends no `Retry-After` and is not resolved by waiting: start the free trial (once per account) or choose a plan in the console.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/v1/sessions/token/user":{"post":{"tags":["Sessions"],"summary":"Mint Retrieval Token User","description":"Browser-safe variant of ``POST /v1/sessions/token`` for logged-in users.\n\nAuthenticates with the caller's JWT (``Authorization: Bearer <jwt>``)\nand treats the ``X-API-Key`` header as the *UUID id* of one of the\nuser's API keys — NOT the raw secret. Ownership is verified server-side\n(``APIKeyModel.id == header AND user_id == jwt``), so the raw secret\nnever leaves the server. Mirrors ``POST /v1/filetag/user``. Deliberately,\nthe key's IP allowlist is NOT enforced on this path: the console runs\nfrom arbitrary user IPs, and JWT auth + server-side ownership is the\ncontrol — the same accepted convention as ``/v1/filetag/user``.\n\nThe minted token is identical to the server-to-server variant: signed,\nquery-only, TTL-clamped, tenant pinned from the key.","operationId":"mint_retrieval_token_user","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTokenInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionTokenOutDTO"}}}},"429":{"description":"Rate or quota limit exceeded; `errors[0].error_code` says which. Retryable limits (`FILETAG_RATE_LIMIT_EXCEEDED`, burst limits) send a `Retry-After` header: back off and retry after it. `CREDIT_EXHAUSTED` for an account with no active subscription or trial sends no `Retry-After` and is not resolved by waiting: start the free trial (once per account) or choose a plan in the console.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]},{"APIKeyHeader":[]}]}},"/api/v1/chat/query":{"post":{"tags":["Chat"],"summary":"Chat Query","description":"Ask a natural-language question about the tenant's indexed documents.\n\nReturns a grounded answer with documentId citations; ``confident=false``\nmeans the underlying data could not support a reliable answer. Send back\nthe returned ``sessionId`` to continue the conversation; omit it to start\na new one.","operationId":"chat_query","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatQueryInDTO"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatQueryOutDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/chat/sessions/{session_id}":{"delete":{"tags":["Chat"],"summary":"Delete Chat Session","description":"End a conversation explicitly ('new chat' hygiene).\n\n404 for unknown, expired, or foreign sessions alike — ids can't be probed.","operationId":"delete_chat_session","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Session Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]},"get":{"tags":["Chat"],"summary":"Get Chat Session","description":"Read one conversation's transcript.\n\nMessages come back in turn order, user before assistant within a turn.\n404 for unknown, foreign and purged sessions alike — a purged stub is\nreadable only with ``with_purged``, and then carries no messages.","operationId":"get_chat_session","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the conversation to read"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of messages to skip","default":0,"title":"Skip"},"description":"Number of messages to skip"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"description":"Number of messages to retrieve","default":100,"title":"Limit"},"description":"Number of messages to retrieve"},{"name":"with_purged","in":"query","required":false,"schema":{"type":"boolean","description":"Allow reading a purged session stub","default":false,"title":"With Purged"},"description":"Allow reading a purged session stub"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatTranscriptOutDTO"}}}},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/chat/sessions":{"get":{"tags":["Chat"],"summary":"List Chat Sessions","description":"List past conversations, newest first.\n\nSessions with no delivered turn yet are omitted. Ended conversations stay\nlisted and come back ``resumable: false``; purged ones are stubs, hidden\nunless ``with_purged`` is set. A token-pinned caller sees only its own\nend-user's chats.","operationId":"list_chat_sessions","parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of items to skip","default":0,"title":"Skip"},"description":"Number of items to skip"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":0,"description":"Number of items to retrieve","default":100,"title":"Limit"},"description":"Number of items to retrieve"},{"name":"sort_field","in":"query","required":false,"schema":{"type":"string","title":"Sort field","description":"Field to sort by"},"description":"Field to sort by"},{"name":"sort_method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SortMethodModel","title":"Sort method","description":"Sort method: asc or desc","default":"asc"},"description":"Sort method: asc or desc"},{"name":"with_purged","in":"query","required":false,"schema":{"type":"boolean","description":"Include purged session stubs","default":false,"title":"With Purged"},"description":"Include purged session stubs"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionListOutDTO"}}}},"400":{"description":"Malformed request — for example an unknown sort field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"OAuth2PasswordBearer":[]}]}},"/api/v1/chat/sessions/{session_id}/purge":{"delete":{"tags":["Chat"],"summary":"Purge Chat Session","description":"Permanently destroy a conversation's stored content. IRREVERSIBLE.\n\nMessages are deleted, trace content is scrubbed, and the title is cleared;\na stub row survives as the record of the purge. Transient conversational\nstate on the chat backend expires within approximately 24 hours.\n\nDeliberately NOT available to retrieval tokens: they carry a single\nquery-only scope minted for embedded widgets, and granting them\nirreversible deletion would be a least-privilege regression.","operationId":"purge_chat_session","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the conversation to purge"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/api/v1/chat/sessions/{session_id}/purge/user":{"delete":{"tags":["Chat"],"summary":"Purge Chat Session By User","description":"Console-signed-in equivalent of ``purge_chat_session``. IRREVERSIBLE.\n\nSame semantics and the same refusal of retrieval tokens; this variant\nauthenticates with the console JWT instead of an API key, mirroring the\ndocuments purge convention.","operationId":"purge_chat_session_by_user","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"The ID of the conversation to purge"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"The resource does not exist, or is not visible to the caller. Ownership failures are deliberately indistinguishable from a missing resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FoundationDTO"}}}},"422":{"description":"Request validation failed (`HTTPValidationError`), or the request was understood but cannot be applied — e.g. the extraction is under legal hold or did not complete successfully (`FoundationDTO`).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/HTTPValidationError"},{"$ref":"#/components/schemas/FoundationDTO"}]}}}}}}},"/":{"get":{"tags":["Meta"],"summary":"Get Root","operationId":"get_root","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"AddExtractionsInDTO":{"properties":{"extractionTypes":{"items":{"$ref":"#/components/schemas/UploadExtractionTypeEnum"},"type":"array","minItems":1,"title":"Extractiontypes","description":"Extraction types to add to the existing document"},"modelType":{"anyOf":[{"$ref":"#/components/schemas/ModelType"},{"type":"null"}],"description":"Extraction model; defaults to the account's configured model"},"thinking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Thinking","description":"Enable extended reasoning; defaults to the account setting"},"evaluation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Evaluation","description":"Enable self-evaluation of the extracted data; defaults to the account setting"},"correction":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Correction","description":"Enable self-correction of the extracted data; defaults to the account setting"},"includeCoordinates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Includecoordinates","description":"Return per-field bounding boxes; defaults to the account setting"},"templateId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Templateid","description":"Custom template to extract with; required by (and only valid with) the custom_template type"}},"type":"object","required":["extractionTypes"],"title":"AddExtractionsInDTO","description":"Request body for ``POST /documents/{document_id}/extractions``.\n\nNo file, external id or end-user id: they belong to the document. FileTag is\nstructurally rejected by ``UploadExtractionTypeModel``."},"AggregateMetaDTO":{"properties":{"count":{"type":"integer","title":"Count"},"currencyGroupingAdded":{"type":"boolean","title":"Currencygroupingadded","description":"True when the server added 'currency' to group_by because money metrics (document totals, or line_total in line-item scope) were requested without a currency filter — amounts in different currencies must never be summed together.","default":false},"duplicatesIgnored":{"type":"integer","title":"Duplicatesignored","description":"Count of duplicate index rows collapsed before aggregating — the same invoice (vendor tax id + document number + issue date) indexed more than once. >0 means the tenant has re-uploaded documents.","default":0},"uomGroupingAdded":{"type":"boolean","title":"Uomgroupingadded","description":"True when the server added 'measurable_uom' to group_by because a measurable_quantity metric was requested without a unit filter or grouping — quantities in different units must never be summed together.","default":false},"linesWithoutUnitData":{"type":"integer","title":"Lineswithoutunitdata","description":"Line-item scope only: matching line items that carry no unit data (indexed before unit extraction shipped, or unit indeterminate) and are therefore excluded from measurable sums. >0 means the aggregate undercounts older documents.","default":0}},"type":"object","required":["count"],"title":"AggregateMetaDTO"},"AggregateMetricDTO":{"properties":{"op":{"type":"string","enum":["sum","avg","min","max","count"],"title":"Op"},"field":{"anyOf":[{"type":"string","enum":["total_amount","net_amount","vat_amount","measurable_quantity","line_total"]},{"type":"null"}],"title":"Field"}},"additionalProperties":false,"type":"object","required":["op"],"title":"AggregateMetricDTO"},"AggregateRowDTO":{"properties":{"group":{"additionalProperties":true,"type":"object","title":"Group","default":{}},"values":{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"integer"},{"type":"null"}]},"type":"object","title":"Values","default":{}}},"type":"object","title":"AggregateRowDTO"},"Body_create_document_processing_request":{"properties":{"extraction_types":{"items":{"$ref":"#/components/schemas/UploadExtractionTypeEnum"},"type":"array","title":"Extraction Types"},"model_type":{"anyOf":[{"$ref":"#/components/schemas/ModelType"},{"type":"null"}],"description":"The model type to use for the document"},"thinking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Thinking","description":"Whether to use the Thinning model for the document"},"evaluation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Evaluation","description":"Whether to use the Evaluation model for the document"},"correction":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Correction","description":"Whether to use the Correction model for the document"},"include_coordinates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Coordinates","description":"Whether to include coordinates in the extraction results"},"external_id":{"type":"string","maxLength":100,"minLength":1,"title":"External Id","description":"External identifier for the document"},"end_user_id":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"End User Id","description":"End User ID for the document"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id","description":"Template ID for custom template extraction"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["extraction_types","external_id","file"],"title":"Body_create_document_processing_request"},"Body_create_document_processing_request_by_user":{"properties":{"extraction_types":{"items":{"$ref":"#/components/schemas/UploadExtractionTypeEnum"},"type":"array","title":"Extraction Types"},"model_type":{"anyOf":[{"$ref":"#/components/schemas/ModelType"},{"type":"null"}],"description":"The model type to use for the document"},"thinking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Thinking","description":"Whether to use the Thinning model for the document"},"evaluation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Evaluation","description":"Whether to use the Evaluation model for the document"},"correction":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Correction","description":"Whether to use the Correction model for the document"},"include_coordinates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Coordinates","description":"Whether to include coordinates in the extraction results"},"external_id":{"type":"string","maxLength":100,"minLength":1,"title":"External Id","description":"External identifier for the document"},"end_user_id":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"End User Id","description":"End User ID for the document"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id","description":"Template ID for custom template extraction"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["extraction_types","external_id","file"],"title":"Body_create_document_processing_request_by_user"},"Body_generate_template":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_generate_template"},"Body_generate_template_async":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_generate_template_async"},"Body_tag_document":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_tag_document"},"Body_tag_document_by_user":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_tag_document_by_user"},"Body_upload_document":{"properties":{"extraction_types":{"items":{"$ref":"#/components/schemas/UploadExtractionTypeEnum"},"type":"array","title":"Extraction Types"},"model_type":{"anyOf":[{"$ref":"#/components/schemas/ModelType"},{"type":"null"}],"description":"The model type to use for the document"},"thinking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Thinking","description":"Whether to use the Thinning model for the document"},"evaluation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Evaluation","description":"Whether to use the Evaluation model for the document"},"correction":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Correction","description":"Whether to use the Correction model for the document"},"include_coordinates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Coordinates","description":"Whether to include coordinates in the extraction results"},"external_id":{"type":"string","maxLength":100,"minLength":1,"title":"External Id","description":"External identifier for the document"},"end_user_id":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"End User Id","description":"End User ID for the document"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id","description":"Template ID for custom template extraction"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["extraction_types","external_id","file"],"title":"Body_upload_document"},"Body_upload_document_by_user":{"properties":{"extraction_types":{"items":{"$ref":"#/components/schemas/UploadExtractionTypeEnum"},"type":"array","title":"Extraction Types"},"model_type":{"anyOf":[{"$ref":"#/components/schemas/ModelType"},{"type":"null"}],"description":"The model type to use for the document"},"thinking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Thinking","description":"Whether to use the Thinning model for the document"},"evaluation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Evaluation","description":"Whether to use the Evaluation model for the document"},"correction":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Correction","description":"Whether to use the Correction model for the document"},"include_coordinates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Include Coordinates","description":"Whether to include coordinates in the extraction results"},"external_id":{"type":"string","maxLength":100,"minLength":1,"title":"External Id","description":"External identifier for the document"},"end_user_id":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"End User Id","description":"End User ID for the document"},"template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Template Id","description":"Template ID for custom template extraction"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["extraction_types","external_id","file"],"title":"Body_upload_document_by_user"},"ChatMessageOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"role":{"type":"string","title":"Role","description":"user | assistant"},"content":{"type":"string","title":"Content"},"turnIndex":{"type":"integer","title":"Turnindex"},"citations":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Citations"},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent"},"confident":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Confident"}},"type":"object","required":["role","content","turnIndex"],"title":"ChatMessageOutDTO","description":"One transcript message. ``citations``/``intent``/``confident`` are\nassistant-side only and stay null on user rows."},"ChatQueryInDTO":{"properties":{"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"},"sessionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Sessionid","description":"Continue an existing conversation. Omit to start a new one; the response returns the sessionId to send on follow-up turns."},"endUserId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Enduserid","description":"Server-to-server (API key) path only: trusted within-tenant filter. On the token path the token's signed scope always wins."}},"additionalProperties":false,"type":"object","required":["message"],"title":"ChatQueryInDTO"},"ChatQueryOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"answer":{"type":"string","title":"Answer"},"sessionId":{"type":"string","format":"uuid","title":"Sessionid","description":"Conversation id — send back to continue this chat"},"citations":{"items":{"type":"string"},"type":"array","title":"Citations","description":"documentId values the answer relies on"},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent","description":"structured | semantic | hybrid | aggregation"},"confident":{"type":"boolean","title":"Confident","description":"False when the data could not support a reliable answer","default":false}},"type":"object","required":["answer","sessionId"],"title":"ChatQueryOutDTO"},"ChatSessionListOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"count":{"type":"integer","title":"Count"},"sessions":{"items":{"$ref":"#/components/schemas/ChatSessionOutDTO"},"type":"array","title":"Sessions"}},"type":"object","required":["count","sessions"],"title":"ChatSessionListOutDTO"},"ChatSessionOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"LLM-generated label; null for pre-history or purged sessions"},"endUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enduserid","description":"The end-user this conversation was scoped to; null for tenant-wide (all-documents) chats. An identifier, not content — it survives on purged stubs so tenants can attribute the purge."},"lastActivityAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lastactivityat"},"turnCount":{"type":"integer","title":"Turncount","default":0},"purgeAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Purgeat","description":"When retention will delete this chat; null = kept always"},"resumable":{"type":"boolean","title":"Resumable","description":"False: the transcript is read-only; a new turn on it would 404","default":false},"purgedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Purgedat"},"purgeReason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purgereason","description":"user_deleted | retention_expired | admin_action"}},"type":"object","required":["id"],"title":"ChatSessionOutDTO","description":"One row of chat history — a live conversation, an ended one, or a stub.\n\nA purged session survives here as a STUB: ids and timestamps, never a\ntitle and never content (design D4/D10). The console's purge copy already\npromises \"a record of the purge will be kept\", and document lists expose\nexactly this shape behind the same ``with_purged`` flag."},"ChatTranscriptOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"session":{"$ref":"#/components/schemas/ChatSessionOutDTO"},"count":{"type":"integer","title":"Count","description":"Total messages in the session, not just this page"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessageOutDTO"},"type":"array","title":"Messages"}},"type":"object","required":["session","count","messages"],"title":"ChatTranscriptOutDTO"},"CheckoutOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"checkoutUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkouturl"},"subscriptionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Subscriptionid"},"paddleTransactionId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddletransactionid"},"status":{"type":"string","enum":["checkout_ready","payment_processing"],"title":"Status","default":"checkout_ready"}},"type":"object","title":"CheckoutOutDTO"},"ColumnDefinitionDTO":{"properties":{"type":{"$ref":"#/components/schemas/FieldType"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["type"],"title":"ColumnDefinitionDTO"},"ComparisonSummaryModel":{"properties":{"coverage":{"type":"number","title":"Coverage","description":"(tp + fp) / total_expected"},"recall":{"type":"number","title":"Recall","description":"tp / (tp + fn)"},"precision":{"type":"number","title":"Precision","description":"tp / (tp + fp)"},"f1":{"type":"number","title":"F1","description":"2 * precision * recall / (precision + recall)"},"strict_precision":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Strict Precision","description":"tp / (tp + fp + extra)"},"strict_f1":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Strict F1","description":"2 * strict_precision * recall / (strict_precision + recall)"},"accuracy":{"type":"number","title":"Accuracy","description":"tp / total_expected — 'correct out of all expected'"},"exact_match":{"type":"boolean","title":"Exact Match"},"counts":{"$ref":"#/components/schemas/CountBreakdownModel"},"correct_fields":{"items":{"type":"string"},"type":"array","title":"Correct Fields"},"incorrect_fields":{"items":{"type":"string"},"type":"array","title":"Incorrect Fields"},"missing_fields":{"items":{"type":"string"},"type":"array","title":"Missing Fields"},"extra_fields":{"items":{"type":"string"},"type":"array","title":"Extra Fields"},"differences":{"items":{"$ref":"#/components/schemas/FieldDifferenceModel"},"type":"array","title":"Differences"},"by_label":{"additionalProperties":{"type":"string"},"type":"object","title":"By Label","description":"label -> one of {'correct','incorrect','missing','extra'}"}},"type":"object","required":["coverage","recall","precision","f1","accuracy","exact_match","counts","correct_fields","incorrect_fields","missing_fields","extra_fields","differences"],"title":"ComparisonSummaryModel"},"ContactFormInDTO":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Company"},"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"}},"type":"object","required":["name","email","message"],"title":"ContactFormInDTO"},"ContractOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"userId":{"type":"string","format":"uuid","title":"Userid"},"userEmail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Useremail"},"status":{"$ref":"#/components/schemas/ContractStatus"},"paddleSubscriptionId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddlesubscriptionid"},"billingCycleDay":{"type":"integer","title":"Billingcycleday"},"requiresManualApproval":{"type":"boolean","title":"Requiresmanualapproval"},"maxMonthlyExtractions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Maxmonthlyextractions"},"monthlySpendLimitCents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Monthlyspendlimitcents"},"monthlyFiletagCredits":{"type":"integer","minimum":0.0,"title":"Monthlyfiletagcredits","default":0},"rateCardTemplateId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Ratecardtemplateid"},"rateCards":{"items":{"$ref":"#/components/schemas/RateCardOutDTO"},"type":"array","title":"Ratecards"},"volumeDiscountTiers":{"items":{"$ref":"#/components/schemas/VolumeDiscountTierOutDTO"},"type":"array","title":"Volumediscounttiers"},"checkoutUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkouturl"},"documentIntelligenceEnabled":{"type":"boolean","title":"Documentintelligenceenabled","default":false},"chatIncludedPerCycle":{"type":"integer","title":"Chatincludedpercycle","default":0},"chatPriceCents":{"type":"string","title":"Chatpricecents","default":"0"},"indexPriceCents":{"type":"string","title":"Indexpricecents","default":"0"},"retrievalRateLimitPerSecond":{"type":"integer","title":"Retrievalratelimitpersecond","default":20},"storagePricePerGbMonthCents":{"type":"string","title":"Storagepricepergbmonthcents","default":"0"},"storageIncludedGb":{"type":"string","title":"Storageincludedgb","default":"0"}},"type":"object","required":["id","userId","status","billingCycleDay","requiresManualApproval"],"title":"ContractOutDTO"},"ContractStatus":{"type":"string","enum":["active","suspended","terminated"],"title":"ContractStatus"},"CountBreakdownModel":{"properties":{"total_expected":{"type":"integer","title":"Total Expected"},"total_extracted":{"type":"integer","title":"Total Extracted"},"present":{"type":"integer","title":"Present"},"correct":{"type":"integer","title":"Correct"},"incorrect":{"type":"integer","title":"Incorrect"},"missing":{"type":"integer","title":"Missing"},"extra":{"type":"integer","title":"Extra"},"tp":{"type":"integer","title":"Tp","description":"True Positives (correct)"},"fp":{"type":"integer","title":"Fp","description":"False Positives (incorrect on expected)"},"fn":{"type":"integer","title":"Fn","description":"False Negatives (missing)"}},"type":"object","required":["total_expected","total_extracted","present","correct","incorrect","missing","extra","tp","fp","fn"],"title":"CountBreakdownModel"},"CreateTemplateInDTO":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"schema":{"$ref":"#/components/schemas/TemplateSchemaDTO-Input"}},"type":"object","required":["name","schema"],"title":"CreateTemplateInDTO"},"CreditMeter":{"type":"string","enum":["processing_credits","filetag_credits"],"title":"CreditMeter","description":"Discriminates which balance a credit transaction debits/credits.\n\n``processing_credits`` covers both subscription and enterprise ledgers\n(distinguished by ``subscription_id IS NULL`` on enterprise rows).\n``filetag_credits`` covers the per-user FileTag allowance stored in\n``filetag_credit_balances``. Separate meters so reports and history\nviews can filter cleanly without conflating the two accounting pools."},"CreditMeterFilter":{"type":"string","enum":["processing_credits","filetag_credits","all"],"title":"CreditMeterFilter","description":"Query-param filter for credit history endpoints.\n\nSuperset of :class:`CreditMeter` with an ``all`` sentinel for admin and\nunified-history views that want both meters interleaved. Read endpoints\ndefault to ``processing_credits`` so pre-audit-trail behavior is\npreserved — mixing meters in a single page confuses ``balance_after``\nreadings since each meter has its own running balance."},"CreditTransactionListOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"transactions":{"items":{"$ref":"#/components/schemas/CreditTransactionOutDTO"},"type":"array","title":"Transactions"},"total":{"type":"integer","title":"Total","description":"Total number of transactions matching the filter, across all pages. Clients can use this to render 'Page X of Y' without a second count call. Scoped to the same ``meter`` filter as ``transactions`` when one is applied.","default":0}},"type":"object","required":["transactions"],"title":"CreditTransactionListOutDTO"},"CreditTransactionOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"type":{"$ref":"#/components/schemas/CreditTransactionType"},"meter":{"$ref":"#/components/schemas/CreditMeter"},"creditsDelta":{"type":"string","title":"Creditsdelta"},"creditsBalanceAfter":{"type":"string","title":"Creditsbalanceafter"},"referenceId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Referenceid"},"referenceFilename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referencefilename"},"referenceExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referenceexternalid"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["id","type","meter","creditsDelta","creditsBalanceAfter"],"title":"CreditTransactionOutDTO"},"CreditTransactionType":{"type":"string","enum":["trial_grant","subscription_grant","top_up","usage","expiry","adjustment","reservation","refund","filetag_grant"],"title":"CreditTransactionType"},"DataCenterRegionModel":{"type":"string","enum":["israel","europe","united_states","asia"],"title":"DataCenterRegionModel"},"DataRetentionPeriodModel":{"type":"string","enum":["one_day","three_days","seven_days","one_month","three_months","six_months","one_year","always"],"title":"DataRetentionPeriodModel"},"DocumentAddExtractionsMetaOutDTO":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"documentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Documentid"},"userId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Userid"},"endUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enduserid"},"apiKeyId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Apikeyid"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"fileSize":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Filesize"},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contenttype"},"documentFileType":{"anyOf":[{"$ref":"#/components/schemas/DocumentFileTypeModel"},{"type":"null"}]},"numberOfPages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numberofpages"},"normalizedWidth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedwidth"},"normalizedHeight":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedheight"},"normalizedMegapixels":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Normalizedmegapixels"},"storageLocation":{"anyOf":[{"$ref":"#/components/schemas/DataCenterRegionModel"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Imageurl"},"thumbnailUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Thumbnailurl"},"originalDocumentUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Originaldocumenturl"},"processingStatus":{"anyOf":[{"$ref":"#/components/schemas/ResponseStatus"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"contentPurgedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Contentpurgedat"},"correlationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Correlationid"},"next":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Next"}},"type":"object","required":["createdAt","contentPurgedAt"],"title":"DocumentAddExtractionsMetaOutDTO","description":"The document-view meta plus the async poll pointer.\n\nExtends (never replaces) ``DocumentViewMetaOutDTO`` so the add-on response\nkeeps every meta field a document view carries (``createdAt``,\n``contentPurgedAt``, ``processingStatus``, ``documentId``, ...) and only\nADDS ``next`` / ``correlationId`` -- the same poll pointer an upload response\nexposes, so an existing submit-and-wait SDK helper works unchanged."},"DocumentAddExtractionsOutDTO":{"properties":{"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/DocumentAddExtractionsMetaOutDTO"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentDataOutDTO"},{"type":"null"}]},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"newExtractionIds":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Newextractionids","description":"Ids of the extractions this call created"},"pollCorrelationId":{"type":"string","format":"uuid","title":"Pollcorrelationid","description":"Correlation id to poll for the document's completion"}},"type":"object","required":["status","meta","data","pollCorrelationId"],"title":"DocumentAddExtractionsOutDTO","description":"The document view (all extractions, old and new) plus what this call created.\n\n``pollCorrelationId`` is the document's ORIGINAL correlation: the existing\n``GET /documents/results/{id}`` / ``get_extraction_result`` report the whole\ndocument as done only once every row (including the new ones) is terminal."},"DocumentDataOutDTO":{"properties":{"extractions":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExtractionProcessingResultOutDTO"},"type":"array"},{"type":"null"}],"title":"Extractions"}},"type":"object","title":"DocumentDataOutDTO"},"DocumentFileTypeModel":{"type":"string","enum":["pdf","image","other"],"title":"DocumentFileTypeModel"},"DocumentMetaOutDTO":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"documentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Documentid"},"userId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Userid"},"endUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enduserid"},"apiKeyId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Apikeyid"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"fileSize":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Filesize"},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contenttype"},"documentFileType":{"anyOf":[{"$ref":"#/components/schemas/DocumentFileTypeModel"},{"type":"null"}]},"numberOfPages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numberofpages"},"normalizedWidth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedwidth"},"normalizedHeight":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedheight"},"normalizedMegapixels":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Normalizedmegapixels"},"storageLocation":{"anyOf":[{"$ref":"#/components/schemas/DataCenterRegionModel"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Imageurl"},"thumbnailUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Thumbnailurl"},"originalDocumentUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Originaldocumenturl"}},"type":"object","title":"DocumentMetaOutDTO"},"DocumentPrimaryViewOutDTO":{"properties":{"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/DocumentViewMetaOutDTO"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentDataOutDTO"},{"type":"null"}]},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"}},"type":"object","required":["status","meta","data"],"title":"DocumentPrimaryViewOutDTO"},"DocumentProcessingMetaOutDTO":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"documentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Documentid"},"userId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Userid"},"endUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enduserid"},"apiKeyId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Apikeyid"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"fileSize":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Filesize"},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contenttype"},"documentFileType":{"anyOf":[{"$ref":"#/components/schemas/DocumentFileTypeModel"},{"type":"null"}]},"numberOfPages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numberofpages"},"normalizedWidth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedwidth"},"normalizedHeight":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedheight"},"normalizedMegapixels":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Normalizedmegapixels"},"storageLocation":{"anyOf":[{"$ref":"#/components/schemas/DataCenterRegionModel"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Imageurl"},"thumbnailUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Thumbnailurl"},"originalDocumentUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Originaldocumenturl"},"correlationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Correlationid"},"next":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Next"}},"type":"object","title":"DocumentProcessingMetaOutDTO"},"DocumentProcessingResultOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/DocumentProcessingMetaOutDTO"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentDataOutDTO"},{"type":"null"}]},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","meta","data"],"title":"DocumentProcessingResultOutDTO"},"DocumentPurgingResultOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/DocumentMetaOutDTO"},"data":{"$ref":"#/components/schemas/PurgedDocumentsDataOutDTO"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","meta","data"],"title":"DocumentPurgingResultOutDTO"},"DocumentViewDataOutDTO":{"properties":{"documents":{"anyOf":[{"items":{"$ref":"#/components/schemas/DocumentViewOutDTO"},"type":"array"},{"type":"null"}],"title":"Documents"}},"type":"object","required":["documents"],"title":"DocumentViewDataOutDTO"},"DocumentViewMetaOutDTO":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"documentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Documentid"},"userId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Userid"},"endUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enduserid"},"apiKeyId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Apikeyid"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"fileSize":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Filesize"},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contenttype"},"documentFileType":{"anyOf":[{"$ref":"#/components/schemas/DocumentFileTypeModel"},{"type":"null"}]},"numberOfPages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numberofpages"},"normalizedWidth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedwidth"},"normalizedHeight":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedheight"},"normalizedMegapixels":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Normalizedmegapixels"},"storageLocation":{"anyOf":[{"$ref":"#/components/schemas/DataCenterRegionModel"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Imageurl"},"thumbnailUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Thumbnailurl"},"originalDocumentUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Originaldocumenturl"},"processingStatus":{"anyOf":[{"$ref":"#/components/schemas/ResponseStatus"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"contentPurgedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Contentpurgedat"}},"type":"object","required":["createdAt","contentPurgedAt"],"title":"DocumentViewMetaOutDTO"},"DocumentViewOutDTO":{"properties":{"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/DocumentViewMetaOutDTO"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentDataOutDTO"},{"type":"null"}]},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","meta","data"],"title":"DocumentViewOutDTO"},"DocumentsViewOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/ViewMetaOutDTO"},"data":{"anyOf":[{"$ref":"#/components/schemas/DocumentViewDataOutDTO"},{"type":"null"}]},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","meta","data"],"title":"DocumentsViewOutDTO"},"EnterpriseTransactionListOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"count":{"type":"integer","title":"Count"},"transactions":{"items":{"$ref":"#/components/schemas/EnterpriseTransactionOutDTO"},"type":"array","title":"Transactions"}},"type":"object","required":["count","transactions"],"title":"EnterpriseTransactionListOutDTO"},"EnterpriseTransactionOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"amountCents":{"type":"integer","title":"Amountcents"},"referenceId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Referenceid"},"referenceFilename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referencefilename"},"referenceExternalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referenceexternalid"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"discountPercent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discountpercent"},"discountCents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Discountcents"}},"type":"object","required":["id","amountCents"],"title":"EnterpriseTransactionOutDTO"},"ExtractionCostOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"extractionId":{"type":"string","format":"uuid","title":"Extractionid"},"creditsConsumed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Creditsconsumed","description":"Credits debited for this extraction. Null for enterprise customers, who are billed in contract dollars via costCents, and whenever state is not 'settled'."},"costCents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Costcents","description":"Enterprise rate-card cost in cents. Null for credit-billed customers."},"meter":{"anyOf":[{"$ref":"#/components/schemas/CreditMeter"},{"type":"null"}],"description":"Which pool paid: 'filetag_credits' for FileTag, 'processing_credits' for subscription / trial / enterprise."},"costExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Costexplanation"},"state":{"$ref":"#/components/schemas/ExtractionCostStateModel","description":"'settled' -- the charge is on record and this number is final. 'pending' -- billing has not run yet; retry. 'not_charged' -- billing finished and no charge exists; this never resolves, so do not poll it."}},"type":"object","required":["extractionId","state"],"title":"ExtractionCostOutDTO","description":"What one extraction cost, and whether that number is final.\n\nDeliberately lean on payload: no signed image URLs, no extracted values, no\nvalidation lookup. The full extraction view already carries the same cost\nfields for callers who want everything; this exists so \"what did this cost?\"\ndoes not pay for three storage round trips per extraction.\n\nOn ``FoundationModel`` rather than ``LeanFoundationModel`` so each row\ncarries the underlying extraction's ``createdAt`` -- per the repo timestamp\nconvention, and the field a client buckets spend by when reconciling a\nperiod."},"ExtractionCostOutResultDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"anyOf":[{"$ref":"#/components/schemas/FoundationMetaDTO"},{"type":"null"}]},"data":{"$ref":"#/components/schemas/ExtractionCostOutDTO"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","data"],"title":"ExtractionCostOutResultDTO"},"ExtractionCostStateModel":{"type":"string","enum":["pending","settled","not_charged"],"title":"ExtractionCostStateModel","description":"Whether an extraction's cost is final, still coming, or never charged.\n\nExists because a bare ``null`` cost is ambiguous across three genuinely\ndifferent situations, and a client reconciling spend has to tell them\napart:\n\n- ``pending`` -- the charge has not been written yet. Credits are deducted\n  in the Celery post phase, which runs *after* the extraction result is\n  available, so a freshly finished extraction legitimately has no cost on\n  record. Retry.\n- ``settled`` -- a charge is on record. This is the authoritative number.\n- ``not_charged`` -- terminal: no charge exists and none is coming. Either\n  the extraction FAILED (billing follows outcome, so a failure is never\n  charged), or billing ran and did not charge -- usually a real billing\n  failure, since ``post_summary_update_task`` swallows ``SubscriptionError``\n  to a log line. Never resolves on its own, so a client must not poll it.\n\nTwo caveats on ``not_charged``, both from ``post_tasks_complete`` being a\ncoarse proxy for \"billing finished\":\n\n1. It records that ``post_summary_update_task`` *started*, not that it\n   charged -- the flag is written as that task's first statement, well\n   before the charge itself. A read landing in between sees\n   ``not_charged`` for an extraction that is about to be billed.\n2. It is per-correlation (per document), so on a multi-extraction document\n   the first extraction to reach billing flips it for its siblings too.\n\nBoth windows are short (tens of milliseconds), but they mean ``not_charged``\nis advisory: alert on it only after a grace period, never treat a single\nreading as proof of an unbilled extraction."},"ExtractionCostsDataOutDTO":{"properties":{"costs":{"items":{"$ref":"#/components/schemas/ExtractionCostOutDTO"},"type":"array","title":"Costs"}},"type":"object","required":["costs"],"title":"ExtractionCostsDataOutDTO"},"ExtractionCostsOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"anyOf":[{"$ref":"#/components/schemas/FoundationMetaDTO"},{"type":"null"}]},"data":{"$ref":"#/components/schemas/ExtractionCostsDataOutDTO"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","data"],"title":"ExtractionCostsOutDTO","description":"Bulk cost response.\n\n``createdAt`` stays null (an aggregate over many extractions has no single\ncreation time); use ``servedAt`` as the as-of signal."},"ExtractionDocumentViewMetaOutDTO":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"documentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Documentid"},"endUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enduserid"},"apiKeyId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Apikeyid"},"apiKeyName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Apikeyname"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"numberOfPages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numberofpages"},"normalizedWidth":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedwidth"},"normalizedHeight":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Normalizedheight"},"normalizedMegapixels":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Normalizedmegapixels"},"contentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contenttype"},"storageLocation":{"anyOf":[{"$ref":"#/components/schemas/DataCenterRegionModel"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Imageurl"},"thumbnailUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Thumbnailurl"},"originalDocumentUrl":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Originaldocumenturl"}},"type":"object","title":"ExtractionDocumentViewMetaOutDTO"},"ExtractionMetaOutDTO":{"properties":{"extractionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Extractionid"},"modelType":{"$ref":"#/components/schemas/ModelType"},"thinking":{"type":"boolean","title":"Thinking"},"correction":{"type":"boolean","title":"Correction"},"evaluation":{"type":"boolean","title":"Evaluation"},"includeCoordinates":{"type":"boolean","title":"Includecoordinates"},"processorClass":{"type":"string","title":"Processorclass"},"extractionType":{"$ref":"#/components/schemas/ExtractionTypeModel"},"latencySeconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latencyseconds"},"numberOfFields":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numberoffields"},"purgeAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Purgeat"},"purgedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Purgedat"},"purgeReason":{"anyOf":[{"$ref":"#/components/schemas/PurgeReasonModel"},{"type":"null"}]},"validationFeedback":{"anyOf":[{"$ref":"#/components/schemas/ValidationSchemaModel"},{"type":"null"}]},"validated":{"type":"boolean","title":"Validated","default":false}},"type":"object","required":["modelType","thinking","correction","evaluation","includeCoordinates","processorClass","extractionType","purgeAt","purgedAt","purgeReason"],"title":"ExtractionMetaOutDTO"},"ExtractionPrimaryViewOutDTO":{"properties":{"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/ExtractionViewMetaOutDTO"},"values":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Values"},"verifiedValues":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Verifiedvalues"},"verifiedDiff":{"anyOf":[{"items":{"$ref":"#/components/schemas/VerifiedDiffEntryOutDTO"},"type":"array"},{"type":"null"}],"title":"Verifieddiff"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]},"document":{"$ref":"#/components/schemas/ExtractionDocumentViewMetaOutDTO"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"}},"type":"object","required":["status","meta","values","document"],"title":"ExtractionPrimaryViewOutDTO"},"ExtractionProcessingResultOutDTO":{"properties":{"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/ExtractionMetaOutDTO"},"values":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Values"},"verifiedValues":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Verifiedvalues"},"verifiedDiff":{"anyOf":[{"items":{"$ref":"#/components/schemas/VerifiedDiffEntryOutDTO"},"type":"array"},{"type":"null"}],"title":"Verifieddiff"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","meta","values"],"title":"ExtractionProcessingResultOutDTO"},"ExtractionTypeModel":{"type":"string","enum":["ocr","document_details_hebrew","document_line_items_hebrew","invoice_headers","invoice_line_items","custom_template","filetag"],"title":"ExtractionTypeModel","description":"Defines the type of operation to perform on the uploaded document"},"ExtractionValidationInDTO":{"properties":{"data":{"patternProperties":{"^label:[^|]+\\|ptr:/\\S+$":{}},"type":"object","title":"Data"},"rowSources":{"items":{"$ref":"#/components/schemas/RowSourcesModel"},"type":"array","title":"Rowsources"}},"type":"object","required":["data"],"title":"ExtractionValidationInDTO"},"ExtractionValidationMetaOutDTO":{"properties":{"extractionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Extractionid"},"documentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Documentid"},"modelType":{"$ref":"#/components/schemas/ModelType"},"thinking":{"type":"boolean","title":"Thinking"},"correction":{"type":"boolean","title":"Correction"},"evaluation":{"type":"boolean","title":"Evaluation"},"includeCoordinates":{"type":"boolean","title":"Includecoordinates"},"processorClass":{"type":"string","title":"Processorclass"},"extractionType":{"$ref":"#/components/schemas/ExtractionTypeModel"}},"type":"object","required":["modelType","thinking","correction","evaluation","includeCoordinates","processorClass","extractionType"],"title":"ExtractionValidationMetaOutDTO"},"ExtractionValidationResultOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/ExtractionValidationMetaOutDTO"},"data":{"$ref":"#/components/schemas/ComparisonSummaryModel"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","meta","data"],"title":"ExtractionValidationResultOutDTO"},"ExtractionViewDataOutDTO":{"properties":{"extractions":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExtractionViewOutDTO"},"type":"array"},{"type":"null"}],"title":"Extractions"}},"type":"object","required":["extractions"],"title":"ExtractionViewDataOutDTO"},"ExtractionViewMetaOutDTO":{"properties":{"extractionId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Extractionid"},"modelType":{"$ref":"#/components/schemas/ModelType"},"thinking":{"type":"boolean","title":"Thinking"},"correction":{"type":"boolean","title":"Correction"},"evaluation":{"type":"boolean","title":"Evaluation"},"includeCoordinates":{"type":"boolean","title":"Includecoordinates"},"processorClass":{"type":"string","title":"Processorclass"},"extractionType":{"$ref":"#/components/schemas/ExtractionTypeModel"},"latencySeconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latencyseconds"},"numberOfFields":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Numberoffields"},"purgeAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Purgeat"},"purgedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Purgedat"},"purgeReason":{"anyOf":[{"$ref":"#/components/schemas/PurgeReasonModel"},{"type":"null"}]},"validationFeedback":{"anyOf":[{"$ref":"#/components/schemas/ValidationSchemaModel"},{"type":"null"}]},"validated":{"type":"boolean","title":"Validated","default":false},"processingStatus":{"$ref":"#/components/schemas/ResponseStatus"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"creditsConsumed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Creditsconsumed"},"costCents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Costcents"},"costExplanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Costexplanation"},"meter":{"anyOf":[{"$ref":"#/components/schemas/CreditMeter"},{"type":"null"}],"description":"Which credit pool paid for the extraction. 'filetag_credits' for FileTag extractions, 'processing_credits' for subscription / trial / enterprise extractions. None when cost lookup was skipped."}},"type":"object","required":["modelType","thinking","correction","evaluation","includeCoordinates","processorClass","extractionType","purgeAt","purgedAt","purgeReason","processingStatus","createdAt"],"title":"ExtractionViewMetaOutDTO"},"ExtractionViewOutDTO":{"properties":{"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/ExtractionViewMetaOutDTO"},"values":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Values"},"verifiedValues":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Verifiedvalues"},"verifiedDiff":{"anyOf":[{"items":{"$ref":"#/components/schemas/VerifiedDiffEntryOutDTO"},"type":"array"},{"type":"null"}],"title":"Verifieddiff"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]},"document":{"$ref":"#/components/schemas/ExtractionDocumentViewMetaOutDTO"}},"type":"object","required":["status","meta","values","document"],"title":"ExtractionViewOutDTO"},"ExtractionsViewOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"$ref":"#/components/schemas/ViewMetaOutDTO"},"data":{"anyOf":[{"$ref":"#/components/schemas/ExtractionViewDataOutDTO"},{"type":"null"}]},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status","meta","data"],"title":"ExtractionsViewOutDTO"},"FeatureType":{"type":"string","enum":["basic","thinking","evaluation","correction"],"title":"FeatureType"},"FieldDefinitionDTO":{"properties":{"type":{"$ref":"#/components/schemas/FieldType"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"required":{"type":"boolean","title":"Required","default":false},"items":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Items"}},"type":"object","required":["type"],"title":"FieldDefinitionDTO"},"FieldDifferenceModel":{"properties":{"label":{"type":"string","title":"Label"},"expected":{"title":"Expected"},"got":{"title":"Got"},"abs_diff":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Abs Diff"},"pct_diff":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pct Diff"}},"type":"object","required":["label","expected","got"],"title":"FieldDifferenceModel"},"FieldType":{"type":"string","enum":["string","number","boolean","array"],"title":"FieldType"},"FileTagBalanceOutDTO":{"properties":{"creditsRemaining":{"type":"string","title":"Creditsremaining"},"monthlyAllowance":{"type":"string","title":"Monthlyallowance"},"anniversaryDay":{"type":"integer","title":"Anniversaryday"},"creditsGrantedAt":{"type":"string","format":"date-time","title":"Creditsgrantedat"},"resetsAt":{"type":"string","format":"date-time","title":"Resetsat"}},"type":"object","required":["creditsRemaining","monthlyAllowance","anniversaryDay","creditsGrantedAt","resetsAt"],"title":"FileTagBalanceOutDTO","description":"Current user's FileTag balance + allowance for the dashboard surface."},"FileTagFilenamePatternsOutDTO":{"properties":{"dateFirst":{"type":"string","title":"Datefirst"},"typeFirst":{"type":"string","title":"Typefirst"},"vendorFirst":{"type":"string","title":"Vendorfirst"},"dateFirstFull":{"type":"string","title":"Datefirstfull"},"typeFirstFull":{"type":"string","title":"Typefirstfull"},"vendorFirstFull":{"type":"string","title":"Vendorfirstfull"}},"type":"object","required":["dateFirst","typeFirst","vendorFirst","dateFirstFull","typeFirstFull","vendorFirstFull"],"title":"FileTagFilenamePatternsOutDTO","description":"Suggested filename patterns produced by ``generate_filename_patterns``.\n\nSix variants are surfaced so the caller can pick the layout that best\nmatches their downstream filing system. Long forms (``*_full``) preserve\nthe full extracted metadata; short forms truncate to a sensible length."},"FileTagMetadataOutDTO":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"documentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Documenttype"},"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"},"authors":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authors"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comments"},"copyright":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Copyright"},"documentNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Documentnumber"}},"type":"object","title":"FileTagMetadataOutDTO","description":"Flat, document-type-agnostic metadata extracted by FileTag.\n\nMirrors :class:`app.components.documents.processors.filetag.models.FileTagFieldsModel`\nbut surfaces plain scalar values (unwrapped from the ``{value, coordinates}``\nstorage shape) so callers don't need to understand the extraction wire\nformat."},"FileTagResultOutDTO":{"properties":{"documentId":{"type":"string","format":"uuid","title":"Documentid"},"documentExtractionId":{"type":"string","format":"uuid","title":"Documentextractionid"},"suggestedFilename":{"type":"string","title":"Suggestedfilename","description":"Recommended filename for the enriched file -- one of the six ``filename_patterns``, picked as the safest default for general use. Pair this with ``enriched_file_url`` when saving the downloaded file."},"metadata":{"$ref":"#/components/schemas/FileTagMetadataOutDTO"},"filenamePatterns":{"$ref":"#/components/schemas/FileTagFilenamePatternsOutDTO"},"enrichedFileUrl":{"type":"string","title":"Enrichedfileurl","description":"Short-lived signed URL to the input file with the extracted metadata embedded directly into the document properties (XMP for PDFs, EXIF/XMP for images). This is the canonical enriched output of the tool -- the file the user actually wants. Agents should download it within ``enriched_file_expires_in_seconds`` and save it under ``suggested_filename`` rather than embedding metadata client-side. Skip the download only if the user explicitly asked for the metadata payload alone."},"enrichedFileExpiresAt":{"type":"string","format":"date-time","title":"Enrichedfileexpiresat","description":"Absolute UTC timestamp when ``enriched_file_url`` stops resolving."},"enrichedFileExpiresInSeconds":{"type":"integer","title":"Enrichedfileexpiresinseconds","description":"Seconds until ``enriched_file_url`` expires, captured at response time. Easier for agents to reason about than the absolute timestamp."},"nextAction":{"$ref":"#/components/schemas/NextActionOutDTO","description":"Structured copy-paste recipe for the post-tag follow-up: HTTP GET ``enriched_file_url`` and save as ``suggested_filename``. Mirrors the ``next_tool_call`` pattern from ``files_create_upload`` -- one structured instruction per step keeps multi-step flows reliable across volatile agent scratchpads."}},"type":"object","required":["documentId","documentExtractionId","suggestedFilename","metadata","filenamePatterns","enrichedFileUrl","enrichedFileExpiresAt","enrichedFileExpiresInSeconds","nextAction"],"title":"FileTagResultOutDTO","description":"Final FileTagService result -- returned by the REST router and the MCP tool."},"FilesCreateUploadInDTO":{"properties":{"filename":{"type":"string","maxLength":255,"minLength":1,"title":"Filename"},"mime_type":{"type":"string","maxLength":128,"minLength":1,"title":"Mime Type"},"size_bytes":{"type":"integer","maximum":52428800.0,"minimum":1.0,"title":"Size Bytes"},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}],"title":"Sha256"}},"type":"object","required":["filename","mime_type","size_bytes"],"title":"FilesCreateUploadInDTO"},"FilesNextToolCallOutDTO":{"properties":{"tool":{"type":"string","enum":["tag_file","extract_document"],"title":"Tool","default":"tag_file"},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments"},"instruction":{"type":"string","title":"Instruction","default":"Once the PUT upload returns 200/204, call the tool above with the arguments above to run the FileTag pipeline on the uploaded file."}},"type":"object","required":["arguments"],"title":"FilesNextToolCallOutDTO","description":"The operation-specific MCP follow-up for an uploaded slot."},"FilesUploadDetailsOutDTO":{"properties":{"method":{"type":"string","const":"PUT","title":"Method","default":"PUT"},"url":{"type":"string","title":"Url"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers"},"expiresAt":{"type":"string","format":"date-time","title":"Expiresat"},"maxSizeBytes":{"type":"integer","title":"Maxsizebytes"}},"type":"object","required":["url","headers","expiresAt","maxSizeBytes"],"title":"FilesUploadDetailsOutDTO"},"FilesUploadInstructionsOutDTO":{"properties":{"fileId":{"type":"string","title":"Fileid"},"upload":{"$ref":"#/components/schemas/FilesUploadDetailsOutDTO"},"nextToolCall":{"$ref":"#/components/schemas/FilesNextToolCallOutDTO"}},"type":"object","required":["fileId","upload","nextToolCall"],"title":"FilesUploadInstructionsOutDTO"},"FoundationDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"$ref":"#/components/schemas/ResponseStatus"},"meta":{"anyOf":[{"$ref":"#/components/schemas/FoundationMetaDTO"},{"type":"null"}]},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"errors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Errors","default":[]}},"type":"object","required":["status"],"title":"FoundationDTO","description":"Standard response envelope, and the error body in its own right.\n\nOn an error response ``status`` is ``failed``, ``data`` is null, and the\ndetail is in ``errors``; ``meta`` echoes back whatever identifiers the\nrequest carried."},"FoundationMetaDTO":{"properties":{"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"correlationId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Correlationid"},"userId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Userid"}},"type":"object","title":"FoundationMetaDTO"},"FreeTierConfigOutDTO":{"properties":{"displayName":{"type":"string","title":"Displayname"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"features":{"items":{"type":"string"},"type":"array","title":"Features"},"monthlyFiletagCredits":{"type":"string","title":"Monthlyfiletagcredits"},"retentionDays":{"type":"integer","title":"Retentiondays"}},"type":"object","required":["displayName","monthlyFiletagCredits","retentionDays"],"title":"FreeTierConfigOutDTO"},"GenerateTemplateFromUrlInDTO":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"}},"type":"object","required":["url"],"title":"GenerateTemplateFromUrlInDTO","description":"DTO for generating template from a URL."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InvoiceListOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"count":{"type":"integer","title":"Count"},"invoices":{"items":{"$ref":"#/components/schemas/InvoiceOutDTO"},"type":"array","title":"Invoices"}},"type":"object","required":["count","invoices"],"title":"InvoiceListOutDTO"},"InvoiceOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"userId":{"type":"string","format":"uuid","title":"Userid"},"userEmail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Useremail"},"type":{"$ref":"#/components/schemas/InvoiceType"},"paddleTransactionId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddletransactionid"},"amountCents":{"type":"integer","title":"Amountcents"},"currency":{"type":"string","title":"Currency"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"issuedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Issuedat"}},"type":"object","required":["id","userId","type","amountCents","currency","status"],"title":"InvoiceOutDTO"},"InvoicePdfOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"InvoicePdfOutDTO"},"InvoiceStatus":{"type":"string","enum":["draft","preparing","issued","paid","refunded","voided"],"title":"InvoiceStatus"},"InvoiceType":{"type":"string","enum":["subscription","top_up","enterprise_usage"],"title":"InvoiceType"},"MatchedChunkDTO":{"properties":{"chunkType":{"type":"string","title":"Chunktype","default":"line_item"},"text":{"type":"string","title":"Text"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"}},"type":"object","required":["text"],"title":"MatchedChunkDTO"},"ModelType":{"type":"string","enum":["gemina","google","openai","velox","praetorian","invictus"],"title":"ModelType"},"NextActionOutDTO":{"properties":{"action":{"type":"string","const":"http_get_and_save","title":"Action","default":"http_get_and_save"},"url":{"type":"string","title":"Url"},"saveAs":{"type":"string","title":"Saveas"},"expiresInSeconds":{"type":"integer","title":"Expiresinseconds"},"instruction":{"type":"string","title":"Instruction","default":"HTTP GET the URL and save the response bytes to disk as ``save_as``. The file is the original upload with the extracted metadata embedded into its document properties (XMP for PDFs, EXIF/XMP for images) -- no client-side embedding needed. Skip only if the user explicitly asked for the metadata payload alone."}},"type":"object","required":["url","saveAs","expiresInSeconds"],"title":"NextActionOutDTO","description":"Structured follow-up recipe for an agent capability (not an MCP tool).\n\nSister pattern to :class:`app.components.files.dtos.FilesNextToolCallOutDTO`:\nthat one names a specific MCP tool by literal name (``tag_file``); this\none names a generic *capability* (``http_get_and_save``) the agent maps\nto whatever local mechanism it has -- ``WebFetch``, ``curl`` via shell,\na filesystem write tool, etc. We can't bind a specific tool name here\nbecause the right one varies per agent host (Claude / GPT / OpenClaw /\nraw HTTP client all differ).\n\nKeeping the field structured (not just a description) defeats the\n\"scratchpad volatility\" failure mode where an agent forgets to act on\nthe enriched-file URL after the metadata response satisfies the\nimmediate ask."},"NumberOfStoredDocumentsOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"userId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Userid"},"totalStoredDocuments":{"type":"integer","title":"Totalstoreddocuments","description":"Total number of stored documents"}},"type":"object","required":["totalStoredDocuments"],"title":"NumberOfStoredDocumentsOutDTO"},"OperationType":{"type":"string","enum":["header","line_item","template","ocr","filetag","index","chat","storage"],"title":"OperationType"},"PaymentMethodUpdateOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"paddleTransactionId":{"type":"string","title":"Paddletransactionid"},"checkoutUrl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkouturl"},"purpose":{"type":"string","enum":["update_payment_method","pay_overdue","resume_subscription"],"title":"Purpose"}},"type":"object","required":["paddleTransactionId","purpose"],"title":"PaymentMethodUpdateOutDTO","description":"A Paddle transaction to open in Paddle.js (``Checkout.open({transactionId})``)\nso the customer can replace the card on file.\n\n``purpose`` tells the client what completing it does:\n\"update_payment_method\" — saves the new card, charges nothing;\n\"pay_overdue\" — the subscription is past due, so the checkout charges the\noverdue renewal with the new card and the subscription recovers;\n\"resume_subscription\" — the subscription is paused, so saving the card\nresumes it and bills a new billing period immediately (a separate charge\nthat can still fail).\n``checkoutUrl`` is Paddle's hosted link for clients without Paddle.js."},"PeriodPresetModel":{"type":"string","enum":["yesterday","today","last7d","last30d","this_month","prev_month"],"title":"PeriodPresetModel"},"PlanCreditCostOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"operationType":{"$ref":"#/components/schemas/OperationType"},"modelType":{"$ref":"#/components/schemas/ModelType"},"featureType":{"$ref":"#/components/schemas/FeatureType"},"creditCost":{"type":"string","title":"Creditcost"},"perFieldCreditCost":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Perfieldcreditcost"},"includedFields":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Includedfields"}},"type":"object","required":["id","operationType","modelType","featureType","creditCost"],"title":"PlanCreditCostOutDTO"},"PlanDetailOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priceCents":{"type":"integer","title":"Pricecents"},"credits":{"type":"integer","title":"Credits"},"monthlyFiletagCredits":{"type":"integer","title":"Monthlyfiletagcredits"},"bonusPercentage":{"type":"integer","title":"Bonuspercentage"},"maxTemplates":{"type":"integer","title":"Maxtemplates"},"maxDataRetentionPeriod":{"$ref":"#/components/schemas/DataRetentionPeriodModel"},"webhooksEnabled":{"type":"boolean","title":"Webhooksenabled"},"dataResidencyEnabled":{"type":"boolean","title":"Dataresidencyenabled"},"ipAllowlistEnabled":{"type":"boolean","title":"Ipallowlistenabled"},"enhancedPrivacyEnabled":{"type":"boolean","title":"Enhancedprivacyenabled"},"supportLevel":{"$ref":"#/components/schemas/SupportLevel"},"paddleProductId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddleproductid"},"paddlePriceId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddlepriceid"},"isActive":{"type":"boolean","title":"Isactive"},"documentIntelligenceEnabled":{"type":"boolean","title":"Documentintelligenceenabled","default":false},"chatIncludedPerCycle":{"type":"integer","title":"Chatincludedpercycle","default":0},"chatCreditCost":{"type":"string","title":"Chatcreditcost","default":"0"},"indexCreditCost":{"type":"string","title":"Indexcreditcost","default":"0"},"retrievalRateLimitPerSecond":{"type":"integer","title":"Retrievalratelimitpersecond","default":20},"storageCreditCostPerGbMonth":{"type":"string","title":"Storagecreditcostpergbmonth","default":"0"},"storageIncludedGb":{"type":"string","title":"Storageincludedgb","default":"0"},"creditCosts":{"items":{"$ref":"#/components/schemas/PlanCreditCostOutDTO"},"type":"array","title":"Creditcosts","default":[]}},"type":"object","required":["id","name","slug","priceCents","credits","monthlyFiletagCredits","bonusPercentage","maxTemplates","maxDataRetentionPeriod","webhooksEnabled","dataResidencyEnabled","ipAllowlistEnabled","enhancedPrivacyEnabled","supportLevel","isActive"],"title":"PlanDetailOutDTO"},"PlanListOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"count":{"type":"integer","title":"Count"},"plans":{"items":{"$ref":"#/components/schemas/PlanOutDTO"},"type":"array","title":"Plans"}},"type":"object","required":["count","plans"],"title":"PlanListOutDTO"},"PlanOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priceCents":{"type":"integer","title":"Pricecents"},"credits":{"type":"integer","title":"Credits"},"monthlyFiletagCredits":{"type":"integer","title":"Monthlyfiletagcredits"},"bonusPercentage":{"type":"integer","title":"Bonuspercentage"},"maxTemplates":{"type":"integer","title":"Maxtemplates"},"maxDataRetentionPeriod":{"$ref":"#/components/schemas/DataRetentionPeriodModel"},"webhooksEnabled":{"type":"boolean","title":"Webhooksenabled"},"dataResidencyEnabled":{"type":"boolean","title":"Dataresidencyenabled"},"ipAllowlistEnabled":{"type":"boolean","title":"Ipallowlistenabled"},"enhancedPrivacyEnabled":{"type":"boolean","title":"Enhancedprivacyenabled"},"supportLevel":{"$ref":"#/components/schemas/SupportLevel"},"paddleProductId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddleproductid"},"paddlePriceId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddlepriceid"},"isActive":{"type":"boolean","title":"Isactive"},"documentIntelligenceEnabled":{"type":"boolean","title":"Documentintelligenceenabled","default":false},"chatIncludedPerCycle":{"type":"integer","title":"Chatincludedpercycle","default":0},"chatCreditCost":{"type":"string","title":"Chatcreditcost","default":"0"},"indexCreditCost":{"type":"string","title":"Indexcreditcost","default":"0"},"retrievalRateLimitPerSecond":{"type":"integer","title":"Retrievalratelimitpersecond","default":20},"storageCreditCostPerGbMonth":{"type":"string","title":"Storagecreditcostpergbmonth","default":"0"},"storageIncludedGb":{"type":"string","title":"Storageincludedgb","default":"0"}},"type":"object","required":["id","name","slug","priceCents","credits","monthlyFiletagCredits","bonusPercentage","maxTemplates","maxDataRetentionPeriod","webhooksEnabled","dataResidencyEnabled","ipAllowlistEnabled","enhancedPrivacyEnabled","supportLevel","isActive"],"title":"PlanOutDTO"},"PurgeReasonModel":{"type":"string","enum":["user_deleted","retention_expired","admin_action"],"title":"PurgeReasonModel"},"PurgedDocumentsDataOutDTO":{"properties":{"purgedIds":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Purgedids","description":"List of IDs of the purged documents"}},"type":"object","required":["purgedIds"],"title":"PurgedDocumentsDataOutDTO"},"QueryMetaDTO":{"properties":{"mode":{"type":"string","title":"Mode"},"count":{"type":"integer","title":"Count"},"skip":{"type":"integer","title":"Skip","default":0},"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}},"type":"object","required":["mode","count"],"title":"QueryMetaDTO"},"QueryResultItemDTO":{"properties":{"documentId":{"type":"string","format":"uuid","title":"Documentid"},"documentExtractionId":{"type":"string","format":"uuid","title":"Documentextractionid"},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"endUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enduserid"},"documentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Documenttype"},"vendorName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendorname"},"vendorTaxId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendortaxid"},"buyerName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyername"},"docNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docnumber"},"issueDate":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issuedate"},"dueDate":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Duedate"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"totalAmount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Totalamount"},"netAmount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Netamount"},"vatAmount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vatamount"},"expenseType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expensetype"},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paymentmethod"},"structured":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Structured"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","description":"Similarity score (semantic mode only)"},"matchedChunks":{"items":{"$ref":"#/components/schemas/MatchedChunkDTO"},"type":"array","title":"Matchedchunks","description":"Line-item/section snippets that matched the query (chunk search)"}},"type":"object","required":["documentId","documentExtractionId"],"title":"QueryResultItemDTO"},"RateCardOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"contractId":{"type":"string","format":"uuid","title":"Contractid"},"operationType":{"$ref":"#/components/schemas/OperationType"},"modelType":{"$ref":"#/components/schemas/ModelType"},"featureType":{"$ref":"#/components/schemas/FeatureType"},"pricePerUnitCents":{"type":"string","title":"Priceperunitcents"},"perFieldPriceCents":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Perfieldpricecents"},"includedFields":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Includedfields"}},"type":"object","required":["id","contractId","operationType","modelType","featureType","pricePerUnitCents"],"title":"RateCardOutDTO"},"ResponseStatus":{"type":"string","enum":["pending","in_process","failed","success","partial","empty"],"title":"ResponseStatus"},"RetrievalAggregateInDTO":{"properties":{"metrics":{"items":{"$ref":"#/components/schemas/AggregateMetricDTO"},"type":"array","maxItems":8,"minItems":1,"title":"Metrics"},"groupBy":{"items":{"type":"string","enum":["vendor_name","vendor_tax_id","buyer_name","currency","document_type","expense_type","payment_method","end_user_id","month","year","measurable_uom","description","doc_number","issue_date","document_id"]},"type":"array","maxItems":4,"title":"Groupby"},"filters":{"anyOf":[{"$ref":"#/components/schemas/RetrievalFiltersDTO"},{"type":"null"}]},"lineFilters":{"items":{"$ref":"#/components/schemas/StructuredFilterDTO"},"type":"array","maxItems":8,"title":"Linefilters","description":"Line-item scope only: conditions over each line-item chunk's structured fields (description, measurable_uom, quantity, ...). Same shape and ops as structured_filters. Presence of any condition switches the request to line-item scope."},"limit":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Limit","default":100}},"additionalProperties":false,"type":"object","required":["metrics"],"title":"RetrievalAggregateInDTO"},"RetrievalAggregateOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"rows":{"items":{"$ref":"#/components/schemas/AggregateRowDTO"},"type":"array","title":"Rows","default":[]},"meta":{"$ref":"#/components/schemas/AggregateMetaDTO"}},"type":"object","required":["meta"],"title":"RetrievalAggregateOutDTO"},"RetrievalFieldItemDTO":{"properties":{"documentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Documenttype"},"field":{"type":"string","title":"Field"},"count":{"type":"integer","title":"Count","description":"documents in which this field appears","default":0}},"type":"object","required":["field"],"title":"RetrievalFieldItemDTO"},"RetrievalFieldsOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"fields":{"items":{"$ref":"#/components/schemas/RetrievalFieldItemDTO"},"type":"array","title":"Fields"}},"type":"object","title":"RetrievalFieldsOutDTO","description":"Observed structured field NAMES per document type (self-query catalog).\n\nNames only — never values. Same envelope (servedAt) as the sibling\nretrieval endpoints."},"RetrievalFiltersDTO":{"properties":{"vendorName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendorname"},"vendorNames":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Vendornames"},"docNumbers":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Docnumbers"},"documentIds":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Documentids"},"documentTypes":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Documenttypes"},"currencies":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Currencies"},"vendorTaxId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendortaxid"},"buyerName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Buyername"},"docNumber":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Docnumber"},"documentType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Documenttype"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"expenseType":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expensetype"},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paymentmethod"},"externalId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Externalid"},"endUserId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enduserid"},"documentId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Documentid"},"issueDateFrom":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issuedatefrom"},"issueDateTo":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issuedateto"},"dueDateFrom":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Duedatefrom"},"dueDateTo":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Duedateto"},"totalAmountMin":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Totalamountmin"},"totalAmountMax":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Totalamountmax"}},"additionalProperties":false,"type":"object","title":"RetrievalFiltersDTO","description":"Structured filters over promoted index columns.\n\nTenant scope is NOT part of this DTO by design: ``user_id`` always comes\nfrom the authenticated context, server-side. ``end_user_id`` is a trusted\nwithin-tenant filter on the server-to-server path (PRD §6.6)."},"RetrievalQueryInDTO":{"properties":{"mode":{"type":"string","enum":["structured","semantic","hybrid"],"title":"Mode","default":"structured"},"text":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Text","description":"Natural-language query (semantic/hybrid modes)"},"filters":{"anyOf":[{"$ref":"#/components/schemas/RetrievalFiltersDTO"},{"type":"null"}]},"topK":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Topk","default":10},"skip":{"type":"integer","minimum":0.0,"title":"Skip","default":0},"limit":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Limit","default":100},"structuredFilters":{"items":{"$ref":"#/components/schemas/StructuredFilterDTO"},"type":"array","maxItems":8,"title":"Structuredfilters","description":"Self-query conditions over any structured field (whitelisted ops)"},"sortField":{"anyOf":[{"type":"string","enum":["issue_date","due_date","total_amount","vendor_name","created_at"]},{"type":"null"}],"title":"Sortfield"},"sortMethod":{"type":"string","enum":["asc","desc"],"title":"Sortmethod","default":"desc"}},"additionalProperties":false,"type":"object","title":"RetrievalQueryInDTO"},"RetrievalQueryOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"items":{"items":{"$ref":"#/components/schemas/QueryResultItemDTO"},"type":"array","title":"Items","default":[]},"meta":{"$ref":"#/components/schemas/QueryMetaDTO"}},"type":"object","required":["meta"],"title":"RetrievalQueryOutDTO"},"RetrievalStatusOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"indexedDocuments":{"type":"integer","title":"Indexeddocuments","default":0}},"type":"object","title":"RetrievalStatusOutDTO","description":"Per-tenant snapshot of the document index."},"RowMutableTableModel":{"properties":{"pointer":{"type":"string","title":"Pointer"},"keyTemplate":{"type":"string","title":"Keytemplate"},"columns":{"items":{"$ref":"#/components/schemas/ValidationColumnModel"},"type":"array","title":"Columns"}},"type":"object","required":["pointer","keyTemplate"],"title":"RowMutableTableModel","description":"A table whose rows a reviewer may add to and remove from.\n\nDeclared by the processor, never inferred by the client: any wide object\narray looks like a table to a shape classifier (custom_template's do), and\nrow controls on the wrong one would produce an alignment the scorer must\nreject."},"RowSourcesModel":{"properties":{"table":{"type":"string","title":"Table"},"sources":{"items":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"array","title":"Sources"}},"type":"object","required":["table","sources"],"title":"RowSourcesModel","description":"How a submitted table aligns to the extracted one.\n\nThe client's row plan IS the alignment, so it is sent directly rather than\nencoded as insert/delete ops — op encodings are ambiguous under compound\nedits (two inserts before the same original index produce two identical\nops whose reconstruction depends on unstated ordering rules), and the\nbackend would have to rebuild exactly this alignment from them anyway.\nLossless and order-free."},"SessionTokenInDTO":{"properties":{"endUserId":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Enduserid","description":"Optional end-user scope: the token will only see documents tagged to this end-user. Omit for an admin (whole-account) session."},"ttlSeconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ttlseconds","description":"Requested TTL; clamped server-side to [300, 900] seconds."},"extractionIds":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":10,"minItems":1},{"type":"null"}],"title":"Extractionids","description":"Optional extraction scope: the minted token may only read/verify these document-extraction ids (carried in the signed `xids` claim). Omit for the existing tenant / end-user scoping. Capped at 10; an empty list is rejected rather than silently minting a tenant-wide token."}},"additionalProperties":false,"type":"object","title":"SessionTokenInDTO"},"SessionTokenOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"token":{"type":"string","title":"Token"},"tokenType":{"type":"string","title":"Tokentype","default":"Bearer"},"expiresIn":{"type":"integer","title":"Expiresin"},"expiresAt":{"type":"string","format":"date-time","title":"Expiresat"}},"type":"object","required":["token","expiresIn","expiresAt"],"title":"SessionTokenOutDTO"},"SortMethodModel":{"type":"string","enum":["asc","desc"],"title":"SortMethodModel"},"SpendLimitOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"limitCents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limitcents"},"mtdSpendCents":{"type":"integer","title":"Mtdspendcents","default":0},"cycleStart":{"type":"string","format":"date-time","title":"Cyclestart"},"cycleEnd":{"type":"string","format":"date-time","title":"Cycleend"},"percentUsed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Percentused"},"blocked":{"type":"boolean","title":"Blocked","default":false},"warning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning"}},"type":"object","required":["cycleStart","cycleEnd"],"title":"SpendLimitOutDTO"},"SpendLimitUpdateInDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"limitCents":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Limitcents"}},"additionalProperties":false,"type":"object","title":"SpendLimitUpdateInDTO","description":"Self-service monthly spend limit. ``null`` (or omitted) REMOVES the\nlimit — 0 is deliberately invalid so \"remove\" has exactly one spelling."},"StorageUsageOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"storedBytes":{"type":"integer","title":"Storedbytes"},"storedGb":{"type":"string","title":"Storedgb"},"includedGb":{"type":"string","title":"Includedgb"},"billableGb":{"type":"string","title":"Billablegb"},"billingMode":{"type":"string","title":"Billingmode"},"ratePerGbMonth":{"type":"string","title":"Ratepergbmonth"},"projectedCharge":{"type":"string","title":"Projectedcharge"},"unit":{"type":"string","title":"Unit"}},"type":"object","required":["storedBytes","storedGb","includedGb","billableGb","billingMode","ratePerGbMonth","projectedCharge","unit"],"title":"StorageUsageOutDTO","description":"Tenant storage usage (FileTag-excluded). ``billingMode`` is\ncredits | money | none; ``unit`` is credits | usd. ``ratePerGbMonth`` and\n``projectedCharge`` are 0 when storage is not billed (``none``)."},"StructuredFilterDTO":{"properties":{"path":{"type":"string","pattern":"^[A-Za-z0-9_]{1,64}$","title":"Path"},"op":{"type":"string","enum":["eq","neq","gt","lt","contains","exists","in"],"title":"Op"},"value":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"type":"array"},{"type":"null"}],"title":"Value"}},"type":"object","required":["path","op"],"title":"StructuredFilterDTO","description":"One self-query condition over the ``structured`` JSONB (design §5, D6).\n\nDeliberately narrow: TOP-LEVEL snake_case keys only, a closed op set,\nvalues compiled to bind parameters — the model never writes SQL."},"SubscribeInDTO":{"properties":{"planId":{"type":"string","format":"uuid","title":"Planid"}},"additionalProperties":false,"type":"object","required":["planId"],"title":"SubscribeInDTO"},"SubscriptionOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"userId":{"type":"string","format":"uuid","title":"Userid"},"userEmail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Useremail"},"planId":{"type":"string","format":"uuid","title":"Planid"},"planName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Planname"},"status":{"$ref":"#/components/schemas/SubscriptionStatus"},"paddleSubscriptionId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddlesubscriptionid"},"currentPeriodStart":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Currentperiodstart"},"currentPeriodEnd":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Currentperiodend"},"cancelScheduledAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cancelscheduledat"},"creditsRemaining":{"type":"string","title":"Creditsremaining"},"priceSnapshotCents":{"type":"integer","title":"Pricesnapshotcents"},"creditsSnapshot":{"type":"integer","title":"Creditssnapshot"},"monthlyFiletagCredits":{"type":"integer","title":"Monthlyfiletagcredits"},"maxTemplates":{"type":"integer","title":"Maxtemplates"},"maxDataRetentionPeriod":{"$ref":"#/components/schemas/DataRetentionPeriodModel"},"webhooksEnabled":{"type":"boolean","title":"Webhooksenabled"},"dataResidencyEnabled":{"type":"boolean","title":"Dataresidencyenabled"},"ipAllowlistEnabled":{"type":"boolean","title":"Ipallowlistenabled"},"enhancedPrivacyEnabled":{"type":"boolean","title":"Enhancedprivacyenabled"},"supportLevel":{"$ref":"#/components/schemas/SupportLevel"},"documentIntelligenceEnabled":{"type":"boolean","title":"Documentintelligenceenabled","default":false},"chatIncludedPerCycle":{"type":"integer","title":"Chatincludedpercycle","default":0},"chatCreditCost":{"type":"string","title":"Chatcreditcost","default":"0"},"indexCreditCost":{"type":"string","title":"Indexcreditcost","default":"0"},"retrievalRateLimitPerSecond":{"type":"integer","title":"Retrievalratelimitpersecond","default":20},"storageCreditCostPerGbMonth":{"type":"string","title":"Storagecreditcostpergbmonth","default":"0"},"storageIncludedGb":{"type":"string","title":"Storageincludedgb","default":"0"}},"type":"object","required":["id","userId","planId","status","creditsRemaining","priceSnapshotCents","creditsSnapshot","monthlyFiletagCredits","maxTemplates","maxDataRetentionPeriod","webhooksEnabled","dataResidencyEnabled","ipAllowlistEnabled","enhancedPrivacyEnabled","supportLevel"],"title":"SubscriptionOutDTO"},"SubscriptionStatus":{"type":"string","enum":["initializing","pending","active","paused","cancelled","expired"],"title":"SubscriptionStatus"},"SupportLevel":{"type":"string","enum":["email","personal","dedicated"],"title":"SupportLevel"},"TOSOutDTO":{"properties":{"version":{"type":"string","title":"Version","description":"Current TOS version (semver)"},"effectiveDate":{"type":"string","format":"date","title":"Effectivedate","description":"Date the TOS became effective"},"content":{"type":"string","title":"Content","description":"TOS content in markdown format"},"contentUrl":{"type":"string","title":"Contenturl","description":"URL to the TOS page on the website"}},"type":"object","required":["version","effectiveDate","content","contentUrl"],"title":"TOSOutDTO"},"TableDefinitionDTO-Input":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"columns":{"additionalProperties":{"$ref":"#/components/schemas/ColumnDefinitionDTO"},"type":"object","title":"Columns"}},"type":"object","required":["columns"],"title":"TableDefinitionDTO"},"TableDefinitionDTO-Output":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"columns":{"additionalProperties":{"$ref":"#/components/schemas/ColumnDefinitionDTO"},"type":"object","title":"Columns"}},"type":"object","required":["columns"],"title":"TableDefinitionDTO"},"TagFileBodyDTO":{"properties":{"external_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"External Id"},"end_user_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"End User Id"}},"type":"object","title":"TagFileBodyDTO","description":"Body for ``POST /api/v1/files/{file_id}/tag`` -- file_id comes from the path.\n\nSame shape as :class:`TagFileInDTO` minus ``file_id`` because the URL\npath provides it. The router constructs a full ``TagFileInDTO`` from\n``(path_file_id, body.external_id, body.end_user_id)`` before handing\noff to :meth:`FilesService.tag_file`."},"TagUrlInDTO":{"properties":{"url":{"type":"string","title":"Url"},"external_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"External Id"},"end_user_id":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"End User Id"}},"type":"object","required":["url"],"title":"TagUrlInDTO"},"TemplateListOutDTO":{"properties":{"count":{"type":"integer","title":"Count"},"templates":{"items":{"$ref":"#/components/schemas/TemplateOutDTO"},"type":"array","title":"Templates"}},"type":"object","required":["count","templates"],"title":"TemplateListOutDTO"},"TemplateOutDTO":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"schema":{"anyOf":[{"$ref":"#/components/schemas/TemplateSchemaDTO-Output"},{"type":"null"}]},"status":{"$ref":"#/components/schemas/TemplateStatusModel"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"sourceFilename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sourcefilename"},"createdAt":{"type":"string","format":"date-time","title":"Createdat"},"updatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updatedat"},"isActive":{"type":"boolean","title":"Isactive","default":true}},"type":"object","required":["id","name","description","status","createdAt"],"title":"TemplateOutDTO"},"TemplateSchemaDTO-Input":{"properties":{"fields":{"additionalProperties":{"$ref":"#/components/schemas/FieldDefinitionDTO"},"type":"object","title":"Fields"},"tables":{"additionalProperties":{"$ref":"#/components/schemas/TableDefinitionDTO-Input"},"type":"object","title":"Tables"}},"type":"object","title":"TemplateSchemaDTO"},"TemplateSchemaDTO-Output":{"properties":{"fields":{"additionalProperties":{"$ref":"#/components/schemas/FieldDefinitionDTO"},"type":"object","title":"Fields"},"tables":{"additionalProperties":{"$ref":"#/components/schemas/TableDefinitionDTO-Output"},"type":"object","title":"Tables"}},"type":"object","title":"TemplateSchemaDTO"},"TemplateStatusModel":{"type":"string","enum":["PENDING","PROCESSING","READY","FAILED"],"title":"TemplateStatusModel"},"TopUpPackListOutDTO":{"properties":{"servedAt":{"type":"string","format":"date-time","title":"Servedat"},"servedAtTimestamp":{"type":"number","title":"Servedattimestamp"},"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"count":{"type":"integer","title":"Count"},"packs":{"items":{"$ref":"#/components/schemas/TopUpPackOutDTO"},"type":"array","title":"Packs"}},"type":"object","required":["count","packs"],"title":"TopUpPackListOutDTO"},"TopUpPackOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"credits":{"type":"integer","title":"Credits"},"priceCents":{"type":"integer","title":"Pricecents"},"paddleProductId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddleproductid"},"paddlePriceId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddlepriceid"},"isActive":{"type":"boolean","title":"Isactive"}},"type":"object","required":["id","name","credits","priceCents","isActive"],"title":"TopUpPackOutDTO"},"TopUpPurchaseInDTO":{"properties":{"packId":{"type":"string","format":"uuid","title":"Packid"}},"additionalProperties":false,"type":"object","required":["packId"],"title":"TopUpPurchaseInDTO"},"TopUpPurchaseOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"status":{"type":"string","title":"Status"},"paddleSubscriptionId":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paddlesubscriptionid"},"packId":{"type":"string","format":"uuid","title":"Packid"},"credits":{"type":"integer","title":"Credits"}},"type":"object","required":["status","packId","credits"],"title":"TopUpPurchaseOutDTO"},"UpdateTemplateInDTO":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"schema":{"anyOf":[{"$ref":"#/components/schemas/TemplateSchemaDTO-Input"},{"type":"null"}]}},"type":"object","title":"UpdateTemplateInDTO"},"UploadExtractionTypeEnum":{"type":"string","enum":["ocr","document_details_hebrew","document_line_items_hebrew","invoice_headers","invoice_line_items","custom_template"],"title":"UploadExtractionTypeEnum","description":"Extraction types accepted by the document-upload endpoints."},"UsageBreakdownListOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"usage":{"items":{"$ref":"#/components/schemas/UsageBreakdownOutDTO"},"type":"array","title":"Usage"}},"type":"object","required":["usage"],"title":"UsageBreakdownListOutDTO"},"UsageBreakdownOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"operationType":{"$ref":"#/components/schemas/OperationType"},"modelType":{"$ref":"#/components/schemas/ModelType"},"featureType":{"$ref":"#/components/schemas/FeatureType"},"unitsConsumed":{"type":"integer","title":"Unitsconsumed"},"creditsConsumed":{"type":"string","title":"Creditsconsumed"}},"type":"object","required":["operationType","modelType","featureType","unitsConsumed","creditsConsumed"],"title":"UsageBreakdownOutDTO"},"UsageLineItemOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"operationType":{"$ref":"#/components/schemas/OperationType"},"modelType":{"$ref":"#/components/schemas/ModelType"},"featureType":{"$ref":"#/components/schemas/FeatureType"},"units":{"type":"integer","title":"Units","default":0},"totalCostCents":{"type":"integer","title":"Totalcostcents","default":0},"totalBeforeDiscountCents":{"type":"integer","title":"Totalbeforediscountcents","default":0},"totalDiscountCents":{"type":"integer","title":"Totaldiscountcents","default":0}},"type":"object","required":["operationType","modelType","featureType"],"title":"UsageLineItemOutDTO"},"UsageSummaryOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"contractId":{"type":"string","format":"uuid","title":"Contractid"},"periodStart":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Periodstart"},"periodEnd":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Periodend"},"totalUsageCents":{"type":"integer","title":"Totalusagecents","default":0},"lineItems":{"items":{"$ref":"#/components/schemas/UsageLineItemOutDTO"},"type":"array","title":"Lineitems"}},"type":"object","required":["contractId"],"title":"UsageSummaryOutDTO"},"ValidationColumnModel":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["string","number","integer","boolean","date"],"title":"Type"},"enum":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enum"},"format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name","type"],"title":"ValidationColumnModel","description":"One column of a row-mutable table — the shape of ANY row.\n\nSame metadata as ``ValidationFieldModel`` minus the row index, so a client\ncan render a user-added row's cells with the same typed inputs as an\nextracted row's."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidationFieldModel":{"properties":{"key":{"type":"string","pattern":"^label:[^|]+\\|ptr:/\\S+$","title":"Key"},"label":{"type":"string","title":"Label"},"type":{"type":"string","enum":["string","number","integer","boolean","date"],"title":"Type"},"enum":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enum"},"format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Format"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["key","label","type"],"title":"ValidationFieldModel","description":"Type metadata for one submittable validation slot.\n\nJoined to ``ValidationSchemaModel.validation_schema`` by ``key`` — the SAME\nopaque ``label:...|ptr:...`` string. Kept separate rather than replacing the\nstring list so the scorer and every existing consumer stay byte-identical;\nthis array is purely additive.\n\nIt covers the keys no ``row_mutable_tables`` column already describes. A\ntable's cells all share their column's metadata, so publishing it per cell\nwould repeat every column description once per row; the columns carry it\nonce instead. Between the two, every submittable key is typed."},"ValidationSchemaModel":{"properties":{"validationSchema":{"items":{"type":"string","pattern":"^label:[^|]+\\|ptr:/\\S+$"},"type":"array","title":"Validationschema"},"validationFields":{"items":{"$ref":"#/components/schemas/ValidationFieldModel"},"type":"array","title":"Validationfields"},"rowMutableTables":{"items":{"$ref":"#/components/schemas/RowMutableTableModel"},"type":"array","title":"Rowmutabletables"}},"type":"object","required":["validationSchema"],"title":"ValidationSchemaModel"},"VerifiedDiffEntryOutDTO":{"properties":{"field":{"type":"string","title":"Field"},"status":{"type":"string","enum":["corrected","added","removed"],"title":"Status"},"pointer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pointer"},"original":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"items":{},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Original"},"verified":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"items":{},"type":"array"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Verified"}},"type":"object","required":["field","status"],"title":"VerifiedDiffEntryOutDTO","description":"One thing the reviewer changed, display-faithful.\n\nBuilt from the stored validation's per-label statuses and its RAW\nsubmitted/original value maps — never from the `differences` column, which\nis normalized for scoring (lowercased strings) and would lie to a display."},"ViewMetaOutDTO":{"properties":{"count":{"type":"integer","title":"Count"},"skip":{"type":"integer","title":"Skip"},"limit":{"type":"integer","title":"Limit"},"sortField":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sortfield"},"sortMethod":{"$ref":"#/components/schemas/SortMethodModel"},"filters":{"additionalProperties":true,"type":"object","title":"Filters"}},"type":"object","required":["count","skip","limit","sortMethod","filters"],"title":"ViewMetaOutDTO"},"VolumeDiscountTierOutDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"id":{"type":"string","format":"uuid","title":"Id"},"tierNumber":{"type":"integer","title":"Tiernumber"},"fromUnits":{"type":"integer","title":"Fromunits"},"toUnits":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tounits"},"discountPercent":{"type":"string","title":"Discountpercent"}},"type":"object","required":["id","tierNumber","fromUnits","discountPercent"],"title":"VolumeDiscountTierOutDTO"},"WebDocumentUploadInDTO":{"properties":{"createdAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Createdat"},"createdAtTimestamp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Createdattimestamp"},"externalId":{"type":"string","maxLength":100,"minLength":1,"title":"Externalid","description":"External identifier for the document"},"endUserId":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Enduserid","description":"End User ID for the document"},"extractionTypes":{"items":{"$ref":"#/components/schemas/UploadExtractionTypeEnum"},"type":"array","title":"Extractiontypes","description":"Target extractions to perform on the document"},"modelType":{"anyOf":[{"$ref":"#/components/schemas/ModelType"},{"type":"null"}],"description":"The model type to use for the document"},"thinking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Thinking","description":"Whether to use the Thinning model for the document"},"evaluation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Evaluation","description":"Whether to use the Evaluation model for the document"},"correction":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Correction","description":"Whether to use the Correction model for the document"},"includeCoordinates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Includecoordinates","description":"Whether to include coordinates in the extraction results"},"templateId":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Templateid","description":"Template ID for custom template extraction"},"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"URL for the document"}},"type":"object","required":["externalId","extractionTypes","url"],"title":"WebDocumentUploadInDTO"},"WebhookResponseDTO":{"properties":{"status":{"type":"string","title":"Status","default":"ok"}},"type":"object","title":"WebhookResponseDTO"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}}}}