{"openapi":"3.0.3","info":{"title":"FastOCR API — Document OCR & Financial Bank Statements","version":"1.0.0","description":"Cloud REST API for raw document text extraction and searchable PDF generation across 100+ languages (for LLM prompts, RAG vector databases, and document workflows) and structured bank statement parsing with automated balance tie-out auditing. API access is in private beta with 50 free pages upon allowlisting.","contact":{"name":"FastOCR Support","url":"https://fastocr.org","email":"support@fastocr.org"},"license":{"name":"Proprietary","url":"https://fastocr.org/terms"}},"servers":[{"url":"https://api.fastocr.org","description":"FastOCR public API"}],"security":[{"BearerAuth":[]}],"paths":{"/v1/documents":{"post":{"operationId":"createDocument","tags":["Documents"],"summary":"Create a document job","description":"Create a PDF document job and receive a presigned URL. Upload the file to that URL before calling the start endpoint.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"},"description":"A unique value for this create request. Reusing it with a different request body returns a conflict."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentCreateRequest"}}}},"responses":{"201":{"description":"Document job created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listDocuments","tags":["Documents"],"summary":"List document jobs","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Number of items to return."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as next_cursor by the previous request."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string"},"description":"Return items updated since this caller-supplied value."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["awaiting_upload","processing","completed","partial","failed"]},"description":"Filter by public document status."}],"responses":{"200":{"description":"A page of document jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentListResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/documents/{documentId}":{"get":{"operationId":"getDocument","tags":["Documents"],"summary":"Get a document job","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"},"description":"Document ID returned by the create request."}],"responses":{"200":{"description":"The document job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentStatusResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteDocument","tags":["Documents"],"summary":"Delete a document job","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"},"description":"Document ID returned by the create request."}],"responses":{"202":{"description":"Deletion was requested.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/documents/{documentId}/start":{"post":{"operationId":"startDocument","tags":["Documents"],"summary":"Start document processing","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"},"description":"Document ID returned by the create request."}],"responses":{"202":{"description":"Document processing started or is already in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/documents/{documentId}/output":{"get":{"operationId":"getDocumentOutput","tags":["Documents"],"summary":"Get a document output link","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"},"description":"Document ID returned by the create request."},{"name":"format","in":"query","required":true,"schema":{"type":"string","enum":["text","pdf"]},"description":"Output format to return as a presigned download link."}],"responses":{"200":{"description":"A short-lived presigned output link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank-statements":{"post":{"operationId":"createBankStatement","tags":["Bank Statements"],"summary":"Create a bank statement job","description":"Private beta: bank statement API access is allowlisted per account. Create a job, upload the statement to the presigned URL, then call the start endpoint.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string"},"description":"A unique value for this create request. Reusing it with a different request body returns a conflict."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankStatementCreateRequest"}}}},"responses":{"201":{"description":"Bank statement job created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listBankStatements","tags":["Bank Statements"],"summary":"List bank statement jobs","description":"List bank statement jobs for the authenticated account.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Number of items to return."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Opaque cursor returned as next_cursor by the previous request."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string"},"description":"Return items updated since this caller-supplied value."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["awaiting_upload","processing","completed","failed"]},"description":"Filter by public bank statement status."}],"responses":{"200":{"description":"A page of bank statement jobs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankStatementListResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank-statements/{statementId}":{"get":{"operationId":"getBankStatement","tags":["Bank Statements"],"summary":"Get a bank statement job","parameters":[{"name":"statementId","in":"path","required":true,"schema":{"type":"string"},"description":"Bank statement ID returned by the create request."}],"responses":{"200":{"description":"The bank statement job.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankStatementStatusResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"deleteBankStatement","tags":["Bank Statements"],"summary":"Delete a bank statement job","parameters":[{"name":"statementId","in":"path","required":true,"schema":{"type":"string"},"description":"Bank statement ID returned by the create request."}],"responses":{"202":{"description":"Deletion was requested.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank-statements/{statementId}/start":{"post":{"operationId":"startBankStatement","tags":["Bank Statements"],"summary":"Start bank statement processing","parameters":[{"name":"statementId","in":"path","required":true,"schema":{"type":"string"},"description":"Bank statement ID returned by the create request."}],"responses":{"202":{"description":"Bank statement processing started or is already in progress.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank-statements/{statementId}/output":{"get":{"operationId":"getBankStatementOutput","tags":["Bank Statements"],"summary":"Get a bank statement output link","description":"For format=json, the presigned link downloads the structured bank statement JSON described by BankStatementJsonOutput.","parameters":[{"name":"statementId","in":"path","required":true,"schema":{"type":"string"},"description":"Bank statement ID returned by the create request."},{"name":"format","in":"query","required":true,"schema":{"type":"string","enum":["json","csv","xlsx"]},"description":"Output format to return as a presigned download link."}],"responses":{"200":{"description":"A short-lived presigned output link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputResponse"}}}},"400":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"The resource or requested output was not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The request conflicts with the current resource state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"The request was rate limited. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Use an API key in the form Authorization: Bearer <key>. Keys are issued only to approved, allowlisted accounts during private beta."}},"schemas":{"DocumentCreateRequest":{"type":"object","required":["filename","size_bytes"],"properties":{"filename":{"type":"string","description":"The original filename. The v1 document API accepts PDF files."},"size_bytes":{"type":"integer","format":"int64","minimum":1,"maximum":1073741824,"description":"Positive file size in bytes. The maximum is 1 GiB."},"sha256":{"type":"string","description":"Optional SHA-256 value supplied with the create request."},"external_id":{"type":"string","nullable":true,"description":"Optional caller-supplied correlation value returned with the resource."}}},"BankStatementCreateRequest":{"type":"object","required":["filename","size_bytes"],"properties":{"filename":{"type":"string","description":"The original filename. Supported extensions are PDF, PNG, JPG, JPEG, and WebP."},"size_bytes":{"type":"integer","format":"int64","minimum":1,"maximum":52428800,"description":"Positive file size in bytes. The overall statement maximum is 50 MiB; images have a 20 MiB maximum."},"sha256":{"type":"string","description":"Optional SHA-256 value supplied with the create request."},"external_id":{"type":"string","nullable":true,"description":"Optional caller-supplied correlation value returned with the resource."}}},"CreateResponse":{"type":"object","required":["id","status","upload_url","expires_at"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["awaiting_upload"]},"upload_url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}}},"StartResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["processing"]}}},"DeleteResponse":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["deleting"]}}},"OutputResponse":{"type":"object","required":["format","url","expires_at"],"properties":{"format":{"type":"string"},"url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"},"pages_billed":{"type":"integer","minimum":0},"pages_total":{"type":"integer","minimum":0}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/Error"}}},"Error":{"type":"object","required":["type","code","message"],"properties":{"type":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"retryable":{"type":"boolean"}}},"JobError":{"allOf":[{"$ref":"#/components/schemas/Error"}],"description":"Processing failure details. Clients should branch on code; new codes may be added."},"DocumentOutputs":{"type":"object","properties":{"text":{"$ref":"#/components/schemas/OutputAvailability"},"pdf":{"$ref":"#/components/schemas/OutputAvailability"}}},"StatementOutputs":{"type":"object","properties":{"json":{"$ref":"#/components/schemas/OutputAvailability"},"csv":{"$ref":"#/components/schemas/OutputAvailability"},"xlsx":{"$ref":"#/components/schemas/OutputAvailability"}}},"OutputAvailability":{"type":"object","required":["available"],"properties":{"available":{"type":"boolean"}}},"DocumentStatusResponse":{"type":"object","required":["id","status","external_id"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["awaiting_upload","processing","completed","partial","failed"]},"external_id":{"type":"string","nullable":true},"pages_billed":{"type":"integer","minimum":0},"pages_total":{"type":"integer","minimum":0},"pages_processed":{"type":"integer","minimum":0},"is_truncated":{"type":"boolean"},"outputs":{"$ref":"#/components/schemas/DocumentOutputs"},"error":{"$ref":"#/components/schemas/JobError"}}},"StatementStatusResponse":{"type":"object","required":["id","status","external_id","has_transactions"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["awaiting_upload","processing","completed","failed"]},"external_id":{"type":"string","nullable":true},"pages_billed":{"type":"integer","minimum":0},"pages_total":{"type":"integer","minimum":0},"has_transactions":{"type":"boolean"},"needs_review":{"type":"boolean","description":"Workflow signal emitted for completed statements when verification data is available; false is not a guarantee that no human review is needed."},"outputs":{"$ref":"#/components/schemas/StatementOutputs"},"error":{"$ref":"#/components/schemas/JobError"}}},"DocumentListResponse":{"type":"object","required":["documents","next_cursor"],"properties":{"documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentStatusResponse"}},"next_cursor":{"type":"string","nullable":true}}},"BankStatementListResponse":{"type":"object","required":["bank_statements","next_cursor"],"properties":{"bank_statements":{"type":"array","items":{"$ref":"#/components/schemas/StatementStatusResponse"}},"next_cursor":{"type":"string","nullable":true}}},"BankStatementJsonOutput":{"type":"object","required":["status","needs_review","page_count","accounts"],"properties":{"status":{"type":"string","enum":["completed","no_transactions"]},"needs_review":{"type":"boolean","description":"Document-level workflow signal. It is true if any account needs review; false is not a guarantee that no human review is needed."},"page_count":{"type":"integer","minimum":0},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/BankAccount"}},"csv":{"type":"string","description":"CSV representation also emitted in the JSON result."},"resolved_by_map":{"type":"object","additionalProperties":{"type":"string"},"description":"Page-number keys mapped to the extraction path used for that page."}}},"BankAccount":{"type":"object","required":["account_number","account_type","bank_name","account_holder","currency","period","opening_balance","closing_balance","needs_review","verification","totals","transactions","flagged_rows"],"properties":{"account_number":{"type":"string","nullable":true},"account_type":{"type":"string","nullable":true},"bank_name":{"type":"string","nullable":true},"account_holder":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true},"period":{"$ref":"#/components/schemas/StatementPeriod"},"opening_balance":{"type":"integer","nullable":true,"description":"Integer minor currency units."},"closing_balance":{"type":"integer","nullable":true,"description":"Integer minor currency units."},"needs_review":{"type":"boolean","description":"Account-level workflow signal; it does not guarantee that review is unnecessary when false."},"verification":{"$ref":"#/components/schemas/AccountVerification"},"totals":{"$ref":"#/components/schemas/AccountTotals"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"flagged_rows":{"type":"array","items":{"$ref":"#/components/schemas/FlaggedIssue"},"description":"Legacy compatibility field that mirrors verification.flagged_issues when emitted."}}},"StatementPeriod":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","nullable":true},"to":{"type":"string","nullable":true}}},"AccountTotals":{"type":"object","required":["credits","debits","net","transaction_count"],"properties":{"credits":{"type":"integer","description":"Integer minor currency units."},"debits":{"type":"integer","description":"Integer minor currency units."},"net":{"type":"integer","description":"Credits minus debits, in integer minor currency units."},"transaction_count":{"type":"integer","minimum":0}}},"AccountVerification":{"type":"object","additionalProperties":false,"required":["needs_review","has_opening_anchor","endpoints_tie_out","chain_broken","flagged_issues"],"properties":{"needs_review":{"type":"boolean"},"has_opening_anchor":{"type":"boolean"},"endpoints_tie_out":{"type":"boolean"},"chain_broken":{"type":"boolean"},"flagged_issues":{"type":"array","items":{"$ref":"#/components/schemas/FlaggedIssue"}}}},"FlaggedIssue":{"type":"object","required":["type","reason"],"properties":{"row_index":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"type":{"type":"string"},"reason":{"type":"string"}}},"Transaction":{"type":"object","required":["date","time","description","reference","type","debit","credit","balance","page","verified"],"properties":{"date":{"type":"string"},"time":{"type":"string","nullable":true},"description":{"type":"string"},"reference":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"debit":{"type":"integer","nullable":true,"description":"Integer minor currency units."},"credit":{"type":"integer","nullable":true,"description":"Integer minor currency units."},"balance":{"type":"integer","nullable":true,"description":"Integer minor currency units."},"page":{"type":"integer","minimum":1},"verified":{"type":"boolean","description":"True only when the transaction passes both arithmetic-chain checks and source-grounding checks. This is not an absolute guarantee."}}}}},"tags":[{"name":"Documents","description":"PDF document OCR jobs."},{"name":"Bank Statements","description":"Private-beta bank statement extraction jobs. Access is allowlisted per account."}]}