{"openapi":"3.1.0","info":{"title":"CECO API","version":"1","description":"Correct PDFs and prove what changed. Every route here accepts an API key; nothing else does. Additive changes only within /v1."},"servers":[{"url":"https://cecopdf.com"}],"paths":{"/v1/usage":{"get":{"summary":"What this account holds and may do today. Read-only.","description":"What this account holds and may do today. Read-only.","operationId":"usage_route_v1_usage_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":[]}},"/v1/plans":{"get":{"summary":"Every plan side by side, in the numbers the service enforces. No key needed.","description":"Every plan side by side, in the numbers the service enforces. No key needed.","operationId":"plans_route_v1_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlansOut"}}}}},"x-errors":[]}},"/v1/documents":{"post":{"summary":"Upload a PDF. Send it as multipart field `file`; add `password` for a document that will not open without one.","operationId":"upload_document_v1_documents_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_v1_documents_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Upload a PDF. Send it as multipart field `file`; add `password` for a document that will not open without one.","x-errors":["file_too_large","too_many_pages","page_too_large","not_a_pdf","unreadable_pdf","no_pages","password_protected","password_required","password_incorrect","not_protected"]},"get":{"summary":"List this account's documents, newest first.","operationId":"list_documents_v1_documents_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentOut"},"title":"Response List Documents V1 Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"List this account's documents, newest first.","x-errors":[]}},"/v1/documents/{document_id}":{"get":{"summary":"One document, with its pages and state.","operationId":"get_document_v1_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"One document, with its pages and state.","x-errors":["not_found"]},"delete":{"summary":"Delete a document, its corrections and every file made from it. The record keeps that it existed.","operationId":"delete_document_v1_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Delete a document, its corrections and every file made from it. The record keeps that it existed.","x-errors":["not_found","missing_capability"]}},"/v1/documents/{document_id}/classify":{"post":{"summary":"Re-examine the pages: which carry text and which are scans.","operationId":"classify_document_route_v1_documents__document_id__classify_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PageInfo"},"title":"Response Classify Document Route V1 Documents  Document Id  Classify Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Re-examine the pages: which carry text and which are scans.","x-errors":["not_found"]}},"/v1/attestations":{"post":{"summary":"State that you are authorised to correct this document. Every correction carries one.","operationId":"create_attestation_v1_attestations_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttestationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttestationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"State that you are authorised to correct this document. Every correction carries one.","x-errors":["not_found"]}},"/v1/documents/{document_id}/edits:propose":{"post":{"summary":"Propose a correction and read what the engine would do, or why it refuses. Changes nothing.","operationId":"propose_edit_v1_documents__document_id__edits_propose_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProposalOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Propose a correction and read what the engine would do, or why it refuses. Changes nothing.","x-errors":["not_found","attestation_required","page_out_of_range"]}},"/v1/documents/{document_id}/edits":{"post":{"summary":"Apply a proposed correction. The answer is its verification.","operationId":"apply_edit_v1_documents__document_id__edits_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_apply_edit_v1_documents__document_id__edits_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Apply a proposed correction. The answer is its verification.","x-errors":["not_found","attestation_required","stale_or_invalid_confirmation","edit_refused","edit_failed","daily_limit_reached"]}},"/v1/documents/{document_id}/verification":{"get":{"summary":"The verification of the document as it now stands: the pixel comparison and every guard.","operationId":"get_verification_v1_documents__document_id__verification_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"The verification of the document as it now stands: the pixel comparison and every guard.","x-errors":["not_found","not_verified","no_revision"]}},"/v1/documents/{document_id}/corrections":{"get":{"summary":"Every correction standing on the document, oldest first.","description":"Every correction standing on the document, oldest first.","operationId":"list_corrections_route_v1_documents__document_id__corrections_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CorrectionOut"},"title":"Response List Corrections Route V1 Documents  Document Id  Corrections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found"]}},"/v1/documents/{document_id}/undo":{"post":{"summary":"Step back one correction. Nothing is deleted.","description":"Step back one correction. Nothing is deleted.","operationId":"undo_correction_v1_documents__document_id__undo_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found","nothing_to_undo"]}},"/v1/documents/{document_id}/redo":{"post":{"summary":"Restore the correction last undone.","description":"Restore the correction last undone.","operationId":"redo_correction_v1_documents__document_id__redo_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found","nothing_to_redo"]}},"/v1/documents/{document_id}/manifest":{"get":{"summary":"The provenance record embedded in the corrected file.","operationId":"get_manifest_v1_documents__document_id__manifest_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Manifest V1 Documents  Document Id  Manifest Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"The provenance record embedded in the corrected file.","x-errors":["not_found","no_revision","no_manifest"]}},"/v1/documents/{document_id}/export":{"post":{"summary":"Pass the export gate: the document is released only if its latest verification is of these exact bytes and passed.","operationId":"create_export_v1_documents__document_id__export_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Pass the export gate: the document is released only if its latest verification is of these exact bytes and passed.","x-errors":["not_found","nothing_to_export","not_verified","verification_hash_mismatch","verification_failed","diff_outside_expected_region"]}},"/v1/documents/{document_id}/export/download":{"get":{"summary":"Download the corrected PDF, through the same gate.","description":"Download the corrected PDF, through the same gate.","operationId":"download_export_v1_documents__document_id__export_download_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found","nothing_to_export","not_verified","verification_hash_mismatch","verification_failed","diff_outside_expected_region","payment_required","email_required"]}},"/v1/documents/{document_id}/certificate":{"post":{"summary":"Issue a signed verification certificate for the document as it now stands.","description":"Issue a signed verification certificate for the document as it now stands.","operationId":"issue_certificate_v1_documents__document_id__certificate_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CertificateRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["business_plan_required","not_found","nothing_to_export","not_verified","verification_failed","nothing_to_certify","correction_not_verified","record_does_not_verify"]}},"/v1/documents/{document_id}/certificates":{"get":{"summary":"The certificates issued for a document, newest first.","description":"The certificates issued for a document, newest first.","operationId":"list_certificates_v1_documents__document_id__certificates_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CertificateOut"},"title":"Response List Certificates V1 Documents  Document Id  Certificates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found"]}},"/v1/certificates/{certificate_id}/pdf":{"get":{"summary":"Download a certificate this account holds.","description":"Download a certificate this account holds.","operationId":"certificate_pdf_v1_certificates__certificate_id__pdf_get","parameters":[{"name":"certificate_id","in":"path","required":true,"schema":{"type":"string","title":"Certificate Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found","certificate_file_deleted"]}},"/v1/certificates/{certificate_id}":{"get":{"summary":"Check a certificate by id: valid or not, its hashes and date. No key needed.","description":"Check a certificate by id: valid or not, its hashes and date. No key needed.","operationId":"check_certificate_v1_certificates__certificate_id__get","parameters":[{"name":"certificate_id","in":"path","required":true,"schema":{"type":"string","title":"Certificate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateCheckOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found"]}},"/v1/certificates/verify":{"post":{"summary":"Check a certificate file's exact bytes. No key needed.","description":"Check a certificate file's exact bytes. No key needed.","operationId":"check_certificate_file_v1_certificates_verify_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_check_certificate_file_v1_certificates_verify_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateCheckOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":[]}},"/v1/documents/{document_id}/pages/{page_index}/ocr":{"post":{"summary":"Read a page and say where the words are, with their confidence.","description":"Read a page and say where the words are, with their confidence.","operationId":"search_page_route_v1_documents__document_id__pages__page_index__ocr_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"page_index","in":"path","required":true,"schema":{"type":"integer","title":"Page Index"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OcrSearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OcrPageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found","page_out_of_range"]}},"/v1/documents/{document_id}/pages/{page_index}/preflight":{"post":{"summary":"Find the words in a region that are already known to refuse, before trying them.","description":"Find the words in a region that are already known to refuse, before trying them.","operationId":"preflight_page_route_v1_documents__document_id__pages__page_index__preflight_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"page_index","in":"path","required":true,"schema":{"type":"integer","title":"Page Index"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreflightOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found","page_out_of_range"]}},"/v1/documents/{document_id}/search":{"get":{"summary":"Where a phrase appears in the pages that carry text.","description":"Where a phrase appears in the pages that carry text.","operationId":"search_document_route_v1_documents__document_id__search_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"","title":"Q"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found"]}},"/v1/documents/{document_id}/pages/{page_index}/preview.png":{"get":{"summary":"A page as a low-resolution image, to look at.","description":"A page as a low-resolution image, to look at.","operationId":"page_preview_v1_documents__document_id__pages__page_index__preview_png_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"page_index","in":"path","required":true,"schema":{"type":"integer","title":"Page Index"}},{"name":"revision","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision"}},{"name":"thumb","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Thumb"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found"]}},"/v1/documents/{document_id}/pages/{page_index}/crop.png":{"get":{"summary":"Native-resolution pixels of one region, at most 4 megapixels. Until the document is paid for, a corrected page is marked and native only inside its corrections.","description":"Native-resolution pixels of one region, at most 4 megapixels. Until the document is paid for, a corrected page is marked and native only inside its corrections.","operationId":"page_crop_v1_documents__document_id__pages__page_index__crop_png_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"page_index","in":"path","required":true,"schema":{"type":"integer","title":"Page Index"}},{"name":"x","in":"query","required":true,"schema":{"type":"integer","maximum":100000,"minimum":0,"title":"X"}},{"name":"y","in":"query","required":true,"schema":{"type":"integer","maximum":100000,"minimum":0,"title":"Y"}},{"name":"w","in":"query","required":true,"schema":{"type":"integer","maximum":100000,"minimum":1,"title":"W"}},{"name":"h","in":"query","required":true,"schema":{"type":"integer","maximum":100000,"minimum":1,"title":"H"}},{"name":"dpi","in":"query","required":false,"schema":{"type":"integer","maximum":2400,"minimum":0,"default":0,"title":"Dpi"}},{"name":"revision","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["not_found","crop_too_large","inspection_budget_spent"]}},"/v1/jobs/{job_id}":{"get":{"summary":"The progress of a queued job.","operationId":"get_job_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"The progress of a queued job.","x-errors":["not_found"]}},"/v1/audit":{"get":{"summary":"This account's record of what was done, newest first.","operationId":"list_audit_v1_audit_get","parameters":[{"name":"subject_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"default":100,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditEntryOut"},"title":"Response List Audit V1 Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"This account's record of what was done, newest first.","x-errors":[]}},"/v1/audit/export":{"get":{"summary":"The whole record as a file, with the chain's verdict inside it.","description":"The whole record as a file, with the chain's verdict inside it.","operationId":"export_audit_v1_audit_export_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"x-errors":["business_plan_required"]}},"/v1/audit/verify-chain":{"get":{"summary":"Recompute the record's hash chain and say where it breaks, if anywhere.","operationId":"verify_audit_chain_v1_audit_verify_chain_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-tenant-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Tenant-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Verify Audit Chain V1 Audit Verify Chain Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"description":"Recompute the record's hash chain and say where it breaks, if anywhere.","x-errors":[]}},"/healthz":{"get":{"summary":"Whether the service is up.","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz Healthz Get"}}}}},"description":"Whether the service is up.","x-errors":[]}}},"components":{"schemas":{"ApplyRequest":{"properties":{"proposal_id":{"type":"string","title":"Proposal Id"},"confirm_token":{"type":"string","title":"Confirm Token"}},"type":"object","required":["proposal_id","confirm_token"],"title":"ApplyRequest"},"AttestationOut":{"properties":{"attestation_id":{"type":"string","title":"Attestation Id"},"statement_version":{"type":"string","title":"Statement Version"},"statement_text":{"type":"string","title":"Statement Text"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["attestation_id","statement_version","statement_text","created_at"],"title":"AttestationOut"},"AttestationRequest":{"properties":{"document_id":{"type":"string","title":"Document Id"},"statement_version":{"type":"string","title":"Statement Version","default":"2026-08-v1"}},"type":"object","required":["document_id"],"title":"AttestationRequest"},"AuditEntryOut":{"properties":{"seq":{"type":"integer","title":"Seq"},"ts":{"type":"string","format":"date-time","title":"Ts"},"actor_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor User Id"},"actor_kind":{"type":"string","title":"Actor Kind"},"action":{"type":"string","title":"Action"},"subject_type":{"type":"string","title":"Subject Type"},"subject_id":{"type":"string","title":"Subject Id"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"entry_hash":{"type":"string","title":"Entry Hash"}},"type":"object","required":["seq","ts","actor_user_id","actor_kind","action","subject_type","subject_id","payload","entry_hash"],"title":"AuditEntryOut"},"Body_apply_edit_v1_documents__document_id__edits_post":{"properties":{"request":{"$ref":"#/components/schemas/EditRequest"},"apply":{"$ref":"#/components/schemas/ApplyRequest"}},"type":"object","required":["request","apply"],"title":"Body_apply_edit_v1_documents__document_id__edits_post"},"Body_check_certificate_file_v1_certificates_verify_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_check_certificate_file_v1_certificates_verify_post"},"Body_upload_document_v1_documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"password":{"type":"string","title":"Password","default":""}},"type":"object","required":["file"],"title":"Body_upload_document_v1_documents_post"},"CertificateCheckOut":{"properties":{"status":{"type":"string","title":"Status"},"valid":{"type":"boolean","title":"Valid"},"reason":{"type":"string","title":"Reason"},"algorithm":{"type":"string","title":"Algorithm","default":"Ed25519"},"certificate_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Certificate Id"},"issued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Issued At"},"original_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Original Sha256"},"corrected_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected Sha256"},"certificate_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Certificate Sha256"},"corrections":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Corrections"},"key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Id"},"statement":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Statement"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature"},"seal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seal"}},"type":"object","required":["status","valid","reason"],"title":"CertificateCheckOut","description":"What the public check says about a certificate: never its content.\n\n``status`` is ``valid``, ``invalid`` (a stored record that no longer matches\nits signature), ``altered`` (a file naming a real certificate whose bytes are\nnot the ones issued) or ``unknown``. A valid answer carries the signed\nstatement, its signature and the seal, so it can be checked against the\npublished key rather than taken on trust."},"CertificateOut":{"properties":{"certificate_id":{"type":"string","title":"Certificate Id"},"document_id":{"type":"string","title":"Document Id"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"original_sha256":{"type":"string","title":"Original Sha256"},"corrected_sha256":{"type":"string","title":"Corrected Sha256"},"certificate_sha256":{"type":"string","title":"Certificate Sha256"},"corrections":{"type":"integer","title":"Corrections"},"key_id":{"type":"string","title":"Key Id"},"pdf_available":{"type":"boolean","title":"Pdf Available","default":true}},"type":"object","required":["certificate_id","document_id","issued_at","original_sha256","corrected_sha256","certificate_sha256","corrections","key_id"],"title":"CertificateOut","description":"A certificate this account holds."},"CertificateRequest":{"properties":{"name":{"type":"string","maxLength":200,"title":"Name","default":""}},"type":"object","title":"CertificateRequest","description":"What to print as the document's name, if anything.\n\nThe service keeps no filenames -- one here is often the name of the person\nthe document is about -- so the interface offers the name its own browser\nremembers and the person decides what, if anything, is printed. It goes into\nthe certificate PDF and nowhere else."},"CorrectionOut":{"properties":{"seq":{"type":"integer","title":"Seq"},"page_index":{"type":"integer","title":"Page Index"},"box_render":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Box Render"},"box_dpi":{"type":"integer","title":"Box Dpi","default":300},"changed_render":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Changed Render"},"changed_dpi":{"type":"integer","title":"Changed Dpi","default":300},"text_before":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Before"},"text_after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text After"},"visibility_cost":{"type":"string","title":"Visibility Cost","default":"none"},"verified":{"type":"boolean","title":"Verified"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"outside_pixels":{"type":"integer","title":"Outside Pixels","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["seq","page_index","verified","created_at"],"title":"CorrectionOut","description":"One correction still standing on this document.\n\nCarried as the words it changed. There is deliberately no revision id here:\nthe person who typed the replacement knows this correction as \"tije became\ntij\", and undo always steps back from the head, so nothing needs naming."},"DocumentOut":{"properties":{"document_id":{"type":"string","title":"Document Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"state":{"type":"string","title":"State"},"page_count":{"type":"integer","title":"Page Count"},"original_sha256":{"type":"string","title":"Original Sha256"},"head_revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Head Revision Id"},"filename_hint":{"type":"string","title":"Filename Hint"},"pages":{"items":{"$ref":"#/components/schemas/PageInfo"},"type":"array","title":"Pages"},"issued_signals":{"additionalProperties":true,"type":"object","title":"Issued Signals"},"concerns":{"items":{"type":"string"},"type":"array","title":"Concerns"},"protected":{"type":"boolean","title":"Protected","default":false},"unlocked":{"type":"boolean","title":"Unlocked","default":false},"watermarked":{"type":"boolean","title":"Watermarked","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["document_id","tenant_id","state","page_count","original_sha256","head_revision_id","filename_hint","created_at"],"title":"DocumentOut"},"EditPreviewOut":{"properties":{"box_render":{"items":{"type":"integer"},"type":"array","maxItems":4,"minItems":4,"title":"Box Render"},"render_dpi":{"type":"integer","title":"Render Dpi"},"before_png":{"type":"string","title":"Before Png"},"after_png":{"type":"string","title":"After Png"},"complete":{"type":"boolean","title":"Complete","default":true}},"type":"object","required":["box_render","render_dpi","before_png","after_png"],"title":"EditPreviewOut","description":"The edited region before and after, as the user asked to see it.\n\nCarried inside the proposal rather than fetched from a route of its own,\nbecause a proposal is never stored: there would be nothing for a later\nrequest to render without performing the edit a second time.\n\nBoth crops are PNG, base64, at ``render_dpi`` and never magnified. The\nclient magnifies at integer scales with smoothing disabled, which is what\nkeeps a single sheared pixel visible instead of resampled away."},"EditRequest":{"properties":{"page_index":{"type":"integer","title":"Page Index","default":0},"target":{"oneOf":[{"$ref":"#/components/schemas/VisualTarget"},{"$ref":"#/components/schemas/TextTarget"},{"$ref":"#/components/schemas/OcrTarget"}],"title":"Target","discriminator":{"propertyName":"method","mapping":{"ocr":"#/components/schemas/OcrTarget","text_layer":"#/components/schemas/TextTarget","visual":"#/components/schemas/VisualTarget"}}},"replacement":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replacement"},"attestation_id":{"type":"string","title":"Attestation Id"},"font_attempt":{"type":"integer","title":"Font Attempt","default":0}},"type":"object","required":["target","attestation_id"],"title":"EditRequest"},"ExportOut":{"properties":{"revision_id":{"type":"string","title":"Revision Id"},"output_sha256":{"type":"string","title":"Output Sha256"},"verification_id":{"type":"string","title":"Verification Id"},"marking_applied":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Marking Applied"},"bytes_available":{"type":"boolean","title":"Bytes Available","default":true}},"type":"object","required":["revision_id","output_sha256","verification_id"],"title":"ExportOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"JobOut":{"properties":{"job_id":{"type":"string","title":"Job Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"progress":{"type":"number","title":"Progress"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"result":{"additionalProperties":true,"type":"object","title":"Result"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"}},"type":"object","required":["job_id","kind","status","progress"],"title":"JobOut"},"NoticeOut":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"text":{"type":"string","title":"Text"},"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"}},"type":"object","required":["id","kind","text"],"title":"NoticeOut","description":"Something to tell a person once, kept until they dismiss it.\n\nKept on the server rather than in the browser, because the thing it\nreports -- purchases moved into an account -- happened to the account, and\nthe account can be opened somewhere else before it is ever read."},"OcrMatchOut":{"properties":{"index":{"type":"integer","title":"Index"},"text":{"type":"string","title":"Text"},"confidence":{"type":"number","title":"Confidence"},"box_render":{"items":{"type":"integer"},"type":"array","title":"Box Render"},"competing":{"type":"integer","title":"Competing"},"needs_confirmation":{"type":"boolean","title":"Needs Confirmation"}},"type":"object","required":["index","text","confidence","box_render","competing","needs_confirmation"],"title":"OcrMatchOut"},"OcrPageOut":{"properties":{"page_index":{"type":"integer","title":"Page Index"},"provider":{"type":"string","title":"Provider"},"lang":{"type":"string","title":"Lang"},"render_dpi":{"type":"integer","title":"Render Dpi"},"word_count":{"type":"integer","title":"Word Count"},"available":{"type":"boolean","title":"Available"},"message":{"type":"string","title":"Message","default":""},"matches":{"items":{"$ref":"#/components/schemas/OcrMatchOut"},"type":"array","title":"Matches"},"confirm_threshold":{"type":"number","title":"Confirm Threshold","default":85.0},"selection_text":{"type":"string","title":"Selection Text","default":""},"selection_confidence":{"type":"number","title":"Selection Confidence","default":0.0},"word_source":{"type":"string","enum":["text_layer","recognised","measured",""],"title":"Word Source","default":""},"words":{"items":{"$ref":"#/components/schemas/OcrWordOut"},"type":"array","title":"Words"}},"type":"object","required":["page_index","provider","lang","render_dpi","word_count","available"],"title":"OcrPageOut"},"OcrSearchRequest":{"properties":{"find":{"type":"string","title":"Find","default":""},"box_render":{"anyOf":[{"items":{"type":"integer"},"type":"array","maxItems":4,"minItems":4},{"type":"null"}],"title":"Box Render"},"render_dpi":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Render Dpi"},"lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"},"turn":{"type":"integer","enum":[0,90,180,270],"title":"Turn","default":0}},"type":"object","title":"OcrSearchRequest"},"OcrTarget":{"properties":{"method":{"type":"string","const":"ocr","title":"Method","default":"ocr"},"find":{"type":"string","title":"Find"},"match_index":{"type":"integer","title":"Match Index","default":0},"confirmed":{"type":"boolean","title":"Confirmed","default":false},"render_dpi":{"type":"integer","title":"Render Dpi","default":300},"lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"}},"type":"object","required":["find"],"title":"OcrTarget","description":"Located by reading the pixels, which is the least trustworthy input.\n\n``confirmed`` is the whole point of this shape. A low-confidence or\nambiguous match is refused without it, and granting it means a person has\nlooked at a magnified crop of that specific match. The flag travels to the\nengine because a check that lived only in the interface would be routed\naround by any script -- and a script is what a bulk replace looks like."},"OcrWordOut":{"properties":{"text":{"type":"string","title":"Text"},"confidence":{"type":"number","title":"Confidence"},"box_render":{"items":{"type":"integer"},"type":"array","title":"Box Render"},"line":{"type":"integer","title":"Line"}},"type":"object","required":["text","confidence","box_render","line"],"title":"OcrWordOut"},"PageDiffOut":{"properties":{"page_index":{"type":"integer","title":"Page Index"},"identical":{"type":"boolean","title":"Identical"},"changed_pixels":{"type":"integer","title":"Changed Pixels"},"changed_fraction":{"type":"number","title":"Changed Fraction"},"bbox":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Bbox"},"outside_pixels":{"type":"integer","title":"Outside Pixels"},"max_delta":{"type":"integer","title":"Max Delta"},"histogram":{"additionalProperties":{"type":"integer"},"type":"object","title":"Histogram"}},"type":"object","required":["page_index","identical","changed_pixels","changed_fraction","bbox","outside_pixels","max_delta"],"title":"PageDiffOut"},"PageInfo":{"properties":{"index":{"type":"integer","title":"Index"},"width_pt":{"type":"number","title":"Width Pt"},"height_pt":{"type":"number","title":"Height Pt"},"rotation":{"type":"integer","title":"Rotation"},"kind":{"type":"string","title":"Kind"},"char_count":{"type":"integer","title":"Char Count"},"image_count":{"type":"integer","title":"Image Count"},"image_coverage":{"type":"number","title":"Image Coverage"},"confidence":{"type":"number","title":"Confidence"},"natural_dpi":{"type":"integer","title":"Natural Dpi","default":300}},"type":"object","required":["index","width_pt","height_pt","rotation","kind","char_count","image_count","image_coverage","confidence"],"title":"PageInfo"},"PlanFactsOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"},"price_eur":{"type":"number","title":"Price Eur"},"price_label":{"type":"string","title":"Price Label"},"recurring":{"type":"boolean","title":"Recurring"},"documents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Documents"},"downloads":{"type":"string","title":"Downloads"},"corrections_per_day":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Corrections Per Day"},"unlimited_corrections_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unlimited Corrections Days"},"upload_mb":{"type":"integer","title":"Upload Mb"},"pages":{"type":"integer","title":"Pages"},"headroom":{"type":"integer","title":"Headroom"},"capabilities":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Capabilities"},"cancel_anytime":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cancel Anytime"},"sign_in_required":{"type":"boolean","title":"Sign In Required","default":false}},"type":"object","required":["id","name","kind","price_eur","price_label","recurring","downloads","upload_mb","pages","headroom"],"title":"PlanFactsOut","description":"One column of the comparison table, as the enforcing code answers it.\n\nBuilt by `comparison.table` from the same `Entitlement` the routes consult,\nand checked against those routes by `tests/api/test_plan_comparison.py`.\n``None`` means unlimited wherever a count could be unlimited, and \"does not\napply\" for ``cancel_anytime`` on something that does not recur."},"PlansOut":{"properties":{"currency":{"type":"string","title":"Currency"},"prices_include_vat":{"type":"boolean","title":"Prices Include Vat","default":true},"capabilities":{"items":{"type":"string"},"type":"array","title":"Capabilities"},"plans":{"items":{"$ref":"#/components/schemas/PlanFactsOut"},"type":"array","title":"Plans"}},"type":"object","required":["currency","capabilities","plans"],"title":"PlansOut","description":"Every plan, side by side, in numbers the service enforces."},"PreflightOut":{"properties":{"page_index":{"type":"integer","title":"Page Index"},"render_dpi":{"type":"integer","title":"Render Dpi"},"word_source":{"type":"string","enum":["text_layer","recognised","measured",""],"title":"Word Source","default":""},"checked":{"type":"integer","title":"Checked","default":0},"skipped":{"type":"integer","title":"Skipped","default":0},"regions":{"items":{"$ref":"#/components/schemas/PreflightRegionOut"},"type":"array","title":"Regions"},"applicable":{"type":"boolean","title":"Applicable","default":true},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["page_index","render_dpi"],"title":"PreflightOut","description":"What a sweep of a region found.\n\nThere is no per-word verdict field, and its absence is the design. The check\nis one-sided: measured against the ladder it named 34 refusals correctly and\nnone wrongly, but missed 16 that also refuse. A verdict list would be read\nas \"the rest will work\", which is a promise nothing here can keep."},"PreflightRegionOut":{"properties":{"box_render":{"items":{"type":"integer"},"type":"array","title":"Box Render"},"code":{"type":"string","title":"Code"},"what":{"type":"string","title":"What"},"why":{"type":"string","title":"Why","default":""},"do":{"items":{"type":"string"},"type":"array","title":"Do"},"evidence":{"additionalProperties":true,"type":"object","title":"Evidence"},"worth_reporting":{"type":"boolean","title":"Worth Reporting","default":false}},"type":"object","required":["box_render","code","what"],"title":"PreflightRegionOut","description":"One place that is already known to refuse, and why."},"PreflightRequest":{"properties":{"box_render":{"anyOf":[{"items":{"type":"integer"},"type":"array","maxItems":4,"minItems":4},{"type":"null"}],"title":"Box Render"},"render_dpi":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Render Dpi"},"lang":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lang"},"turn":{"type":"integer","enum":[0,90,180,270],"title":"Turn","default":0}},"type":"object","title":"PreflightRequest"},"ProposalOut":{"properties":{"proposal_id":{"type":"string","title":"Proposal Id"},"confirm_token":{"type":"string","title":"Confirm Token"},"document_id":{"type":"string","title":"Document Id"},"page_index":{"type":"integer","title":"Page Index"},"tier":{"type":"integer","title":"Tier"},"tier_name":{"type":"string","title":"Tier Name"},"visibility_cost":{"type":"string","title":"Visibility Cost"},"explanation":{"type":"string","title":"Explanation"},"measurements":{"additionalProperties":true,"type":"object","title":"Measurements"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"refusal":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refusal"},"advice":{"anyOf":[{"$ref":"#/components/schemas/RefusalAdviceOut"},{"type":"null"}]},"rejected":{"items":{"$ref":"#/components/schemas/TierRejectionOut"},"type":"array","title":"Rejected"},"predicted_diff":{"items":{"$ref":"#/components/schemas/PageDiffOut"},"type":"array","title":"Predicted Diff"},"preview":{"anyOf":[{"$ref":"#/components/schemas/EditPreviewOut"},{"type":"null"}]},"font_alternatives":{"type":"integer","title":"Font Alternatives","default":0},"font_attempt":{"type":"integer","title":"Font Attempt","default":0}},"type":"object","required":["proposal_id","confirm_token","document_id","page_index","tier","tier_name","visibility_cost","explanation"],"title":"ProposalOut"},"RefusalAdviceOut":{"properties":{"code":{"type":"string","title":"Code","default":""},"what":{"type":"string","title":"What","default":""},"why":{"type":"string","title":"Why","default":""},"do":{"items":{"type":"string"},"type":"array","title":"Do"},"worth_reporting":{"type":"boolean","title":"Worth Reporting","default":false}},"type":"object","title":"RefusalAdviceOut","description":"A refusal in the words of the person who has to act on it.\n\nServed rather than left to the client, because a script calling this API\nmeets exactly the same refusals a browser does and had only the engine's own\nsentence to parse. The engine's chain still travels in ``rejected``, in\nfull: this speaks for it, and does not replace it."},"SearchHitOut":{"properties":{"page_index":{"type":"integer","title":"Page Index"},"text":{"type":"string","title":"Text"},"box_render":{"items":{"type":"integer"},"type":"array","title":"Box Render"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["page_index","text","box_render","confidence"],"title":"SearchHitOut","description":"One place a phrase appears."},"SearchOut":{"properties":{"query":{"type":"string","title":"Query"},"matches":{"items":{"$ref":"#/components/schemas/SearchHitOut"},"type":"array","title":"Matches"},"pages_searched":{"items":{"type":"integer"},"type":"array","title":"Pages Searched"},"pages_needing_recognition":{"items":{"type":"integer"},"type":"array","title":"Pages Needing Recognition"},"truncated":{"type":"boolean","title":"Truncated","default":false}},"type":"object","required":["query"],"title":"SearchOut","description":"Where a phrase appears, and where nobody has looked yet.\n\n``pages_needing_recognition`` is the honest half. Those pages are pictures;\nreading them costs seconds each, so the search does not do it behind\nsomebody's back and the interface offers it as a thing to ask for."},"SubscriptionSummaryOut":{"properties":{"plan":{"type":"string","title":"Plan"},"state":{"type":"string","title":"State"},"renews_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Renews On"},"ends_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ends On"},"pending_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pending Plan"},"pending_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pending On"},"interval":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interval"}},"type":"object","required":["plan","state"],"title":"SubscriptionSummaryOut","description":"What the topbar and the plans table need to know about a subscription."},"TextTarget":{"properties":{"method":{"type":"string","const":"text_layer","title":"Method","default":"text_layer"},"find":{"type":"string","title":"Find"},"match_index":{"type":"integer","title":"Match Index","default":0}},"type":"object","required":["find"],"title":"TextTarget"},"TierRejectionOut":{"properties":{"tier":{"type":"integer","title":"Tier"},"tier_name":{"type":"string","title":"Tier Name"},"code":{"type":"string","title":"Code"},"reason":{"type":"string","title":"Reason"},"evidence":{"additionalProperties":true,"type":"object","title":"Evidence"}},"type":"object","required":["tier","tier_name","code","reason"],"title":"TierRejectionOut","description":"Why one tier was not used.\n\nCarried all the way to the client because it is the difference between a\ntool that says \"used Tier 2\" and one that says \"used Tier 2, because Tier 1\ncan only move pixels that already exist and this replacement needs ink the\npage does not contain\"."},"UndoOut":{"properties":{"document":{"$ref":"#/components/schemas/DocumentOut"},"undone":{"$ref":"#/components/schemas/CorrectionOut"},"corrections":{"items":{"$ref":"#/components/schemas/CorrectionOut"},"type":"array","title":"Corrections"}},"type":"object","required":["document","undone"],"title":"UndoOut"},"UsageOut":{"properties":{"limit":{"type":"integer","title":"Limit"},"used":{"type":"number","title":"Used"},"remaining":{"type":"number","title":"Remaining"},"resets_on":{"type":"string","title":"Resets On"},"subscribed":{"type":"boolean","title":"Subscribed","default":false},"confirmation_sent":{"type":"boolean","title":"Confirmation Sent","default":false},"checkout_open":{"type":"boolean","title":"Checkout Open"},"signed_in_as":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signed In As"},"onboarded":{"type":"boolean","title":"Onboarded","default":false},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"entitlement":{"additionalProperties":true,"type":"object","title":"Entitlement"},"upload_limit_mb":{"type":"integer","title":"Upload Limit Mb","default":5},"page_limit":{"type":"integer","title":"Page Limit","default":100},"retention_days":{"type":"integer","title":"Retention Days","default":90},"google_sign_in":{"type":"boolean","title":"Google Sign In","default":false},"operator":{"type":"boolean","title":"Operator","default":false},"operator_reauth_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Operator Reauth Minutes"},"devices_signed_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Devices Signed In"},"development":{"type":"boolean","title":"Development","default":false},"controller":{"additionalProperties":{"type":"string"},"type":"object","title":"Controller"},"paddle":{"additionalProperties":{"type":"string"},"type":"object","title":"Paddle"},"mail_sign_in":{"type":"boolean","title":"Mail Sign In","default":false},"unlimited_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unlimited Until"},"bought_plans":{"items":{"type":"string"},"type":"array","title":"Bought Plans"},"notices":{"items":{"$ref":"#/components/schemas/NoticeOut"},"type":"array","title":"Notices"},"subscription":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionSummaryOut"},{"type":"null"}]},"dismissed_hints":{"items":{"type":"string"},"type":"array","title":"Dismissed Hints"}},"type":"object","required":["limit","used","remaining","resets_on"],"title":"UsageOut","description":"What today's allowance looks like to the interface.\n\nFractional, because undo and redo cost half a correction: the count is kept\nin halves so it cannot drift, and reported in the unit the person was\npromised."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VerificationOut":{"properties":{"verification_id":{"type":"string","title":"Verification Id"},"revision_id":{"type":"string","title":"Revision Id"},"output_sha256":{"type":"string","title":"Output Sha256"},"dpi":{"type":"integer","title":"Dpi"},"passed":{"type":"boolean","title":"Passed"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"pages":{"items":{"$ref":"#/components/schemas/PageDiffOut"},"type":"array","title":"Pages"},"guards":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Guards"},"stream_changes":{"additionalProperties":true,"type":"object","title":"Stream Changes"}},"type":"object","required":["verification_id","revision_id","output_sha256","dpi","passed"],"title":"VerificationOut"},"VisualTarget":{"properties":{"method":{"type":"string","const":"visual","title":"Method","default":"visual"},"box_render":{"items":{"type":"integer"},"type":"array","maxItems":4,"minItems":4,"title":"Box Render"},"render_dpi":{"type":"integer","title":"Render Dpi","default":300},"original_text":{"type":"string","title":"Original Text","default":""}},"type":"object","required":["box_render"],"title":"VisualTarget"}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Authorization: Bearer ceco_live_<id>_<secret>"}}},"security":[{"apiKey":[]}]}