{"openapi":"3.1.0","info":{"title":"ReceViz API","description":"**ReceViz by AccountHouse** — intelligent document capture, structured extraction and verification.\n\n### Authentication\nSend `Authorization: Bearer <key>`:\n- **Secret keys** (`rv_live_…`, `rv_test_…`) — on your server only.\n- **Client tokens** (`rv_ct_…`) — short-lived, minted by your server (`POST /client-tokens`) or from a\n  publishable key (`POST /client-sessions`); safe to hand to a mobile app or web page.\n\nEvery key carries capabilities (scopes). A request that needs a capability the key, its application or\nits organisation lacks gets `403 missing_capability`.\n\n### Errors\nEvery error is `{\"error\": {\"type\", \"code\", \"message\", \"param\", \"request_id\"}}` and every response\ncarries `X-Request-Id`.\n\n### Rate limits\nPer credential, per minute. Responses carry `X-RateLimit-Limit`, `X-RateLimit-Remaining` and\n`X-RateLimit-Reset`; a `429` carries `Retry-After`.\n\n### Idempotency\nSend `Idempotency-Key` on `POST /extractions` to make retries safe for 24 hours.\n","version":"1.0.0","x-logo":{"altText":"ReceViz by AccountHouse"},"contact":{"name":"ReceViz by AccountHouse","url":"https://receviz.theaccounthouse.com"}},"servers":[{"url":"https://accounthouse-backend-793493499887.me-central1.run.app/api/receviz/v1","description":"ReceViz v1"}],"paths":{"/me":{"get":{"tags":["ReceViz API v1"],"summary":"The calling credential","operationId":"me_receviz_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialInfo"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/extractions":{"post":{"tags":["ReceViz API v1"],"summary":"Extract structured data from a document","description":"Send an image (JPEG, PNG, WebP, TIFF, HEIC) or a PDF as `file`, and/or the text an SDK read on the device as `client_ocr`. Small documents are processed while you wait (200); large ones, or any request with `async=true`, return 202 and finish in the background — poll the extraction or subscribe to `extraction.completed`. Send an `Idempotency-Key` header to make retries safe.","operationId":"create_extraction_receviz_v1_extractions_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"allOf":[{"$ref":"#/components/schemas/Body_create_extraction_receviz_v1_extractions_post"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Extraction"}}}},"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Extraction"}}},"description":"Accepted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["ReceViz API v1"],"summary":"Recent extractions (metadata only)","operationId":"list_extractions_receviz_v1_extractions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Starting After"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/extractions/{extraction_id}":{"get":{"tags":["ReceViz API v1"],"summary":"Retrieve an extraction","operationId":"get_extraction_receviz_v1_extractions__extraction_id__get","parameters":[{"name":"extraction_id","in":"path","required":true,"schema":{"type":"string","title":"Extraction Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Extraction"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/document-types":{"get":{"tags":["ReceViz API v1"],"summary":"Document types this application can extract","operationId":"list_document_types_receviz_v1_document_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["ReceViz API v1"],"summary":"Create a document type","operationId":"create_document_type_receviz_v1_document_types_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTypeCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTypeModel"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/document-types/{key}":{"get":{"tags":["ReceViz API v1"],"summary":"A document type and its current schema","operationId":"get_document_type_receviz_v1_document_types__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTypeModel"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/document-types/{key}/versions/{version}":{"get":{"tags":["ReceViz API v1"],"summary":"A published schema version","operationId":"get_document_type_version_receviz_v1_document_types__key__versions__version__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaModel"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/schemas/{schema_id}":{"get":{"tags":["ReceViz API v1"],"summary":"A published schema version by id","operationId":"get_schema_receviz_v1_schemas__schema_id__get","parameters":[{"name":"schema_id","in":"path","required":true,"schema":{"type":"string","title":"Schema Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaModel"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/usage":{"get":{"tags":["ReceViz API v1"],"summary":"This application's usage","operationId":"usage_receviz_v1_usage_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/client-tokens":{"post":{"tags":["ReceViz API v1"],"summary":"Mint a short-lived client token (server side)","description":"Call from your server with a secret key; hand the token to your app or web page.","operationId":"create_client_token_receviz_v1_client_tokens_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientTokenCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientToken"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/client-sessions":{"post":{"tags":["ReceViz API v1"],"summary":"Exchange a publishable key for a client token","description":"For apps and pages with no server of their own. The key's restrictions (origins, bundle identifiers) and a tight rate limit apply.","operationId":"create_client_session_receviz_v1_client_sessions_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientSessionCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientToken"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/quality/feedback":{"post":{"tags":["ReceViz API v1"],"summary":"Report how an on-device reading compared with ReceViz's","operationId":"quality_feedback_receviz_v1_quality_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityFeedback"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QualityFeedbackAck"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Missing, invalid, revoked or expired credential","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"The credential may not do this","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict (e.g. an Idempotency-Key reused)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Temporarily unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/brands/{key}/logo":{"get":{"tags":["ReceViz API v1"],"summary":"A known brand's logo","description":"The 128 px WebP logo of a brand named in `enrichment.merchant.brand`. No key needed — an `<img>` cannot send one — and the request is not logged. 404 when the brand is unknown or its logo may not be shown right now. Brand names and logos are their owners' trademarks: show them only to identify the merchant on a document.","operationId":"brand_logo_receviz_v1_brands__key__logo_get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}},"image/webp":{}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limited or over quota","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Something failed inside ReceViz (internal_error). Safe to retry with the same Idempotency-Key; quote the request id if it persists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"Body_create_extraction_receviz_v1_extractions_post":{"properties":{"file":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File","description":"The document: image or PDF."},"document_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type","description":"Document type key, e.g. payment_receipt."},"schema_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Schema Version","description":"A published version; default the pinned or latest."},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode","description":"fast, standard or verified (default: the application's)."},"async":{"type":"boolean","title":"Async ","description":"Process in the background and return 202.","default":false},"options":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Options","description":"JSON: {include_ocr: none|text|lines, evidence: full|boxes_only|none, tiling: auto|off|force, preprocessing: auto|off, date_order: DMY|MDY, reference_date, default_currency, known_merchants: [..], ocr_provider}"},"metadata":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata","description":"JSON object of your own keys, echoed back (≤ 2 KB)."},"client_ocr":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Ocr","description":"JSON {width, height, lines: [{text, x, y, w, h, confidence}]}"}},"type":"object","title":"Body_create_extraction_receviz_v1_extractions_post"},"Capture":{"properties":{"noun":{"type":"string","title":"Noun","description":"What a scanner calls this document in its guidance (\"Point at an invoice\"): the document type's own capture.noun, else inferred from its key and name.","examples":["invoice"]}},"type":"object","required":["noun"],"title":"Capture"},"ClientSessionCreate":{"properties":{"document_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Types"}},"type":"object","title":"ClientSessionCreate"},"ClientToken":{"properties":{"object":{"type":"string","title":"Object","default":"client_token"},"token":{"type":"string","title":"Token"},"expires_at":{"type":"string","title":"Expires At"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"application":{"type":"string","title":"Application"},"livemode":{"type":"boolean","title":"Livemode"},"document_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Types"}},"type":"object","required":["token","expires_at","scopes","application","livemode"],"title":"ClientToken"},"ClientTokenCreate":{"properties":{"ttl_seconds":{"anyOf":[{"type":"integer","maximum":3600.0,"minimum":60.0},{"type":"null"}],"title":"Ttl Seconds","description":"Default 600."},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"Subset of the key's public-client capabilities; default all."},"document_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Document Types","description":"Restrict the token to these document types."}},"type":"object","title":"ClientTokenCreate"},"CredentialInfo":{"properties":{"object":{"type":"string","title":"Object","default":"credential_context"},"tenant":{"type":"string","title":"Tenant"},"application":{"type":"string","title":"Application"},"application_name":{"type":"string","title":"Application Name"},"environment":{"type":"string","title":"Environment"},"livemode":{"type":"boolean","title":"Livemode"},"kind":{"type":"string","title":"Kind"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"rate_limit_per_minute":{"type":"integer","title":"Rate Limit Per Minute"}},"additionalProperties":true,"type":"object","required":["tenant","application","application_name","environment","livemode","kind","scopes","rate_limit_per_minute"],"title":"CredentialInfo"},"DocumentTypeCreate":{"properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$","title":"Key","examples":["payment_receipt"]},"name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template","description":"Start from a built-in: payment_receipt, retail_receipt, invoice."},"definition":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Definition","description":"The document-type definition (see Document Types)."},"publish":{"type":"boolean","title":"Publish","description":"Publish version 1 immediately.","default":true}},"type":"object","required":["key"],"title":"DocumentTypeCreate"},"DocumentTypeModel":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"document_type"},"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"latest_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latest Version"},"capture":{"$ref":"#/components/schemas/Capture"},"schema":{"anyOf":[{"$ref":"#/components/schemas/SchemaModel"},{"type":"null"}]}},"additionalProperties":true,"type":"object","required":["id","key","name","description","latest_version","capture"],"title":"DocumentTypeModel"},"Enrichment":{"properties":{"merchant":{"anyOf":[{"$ref":"#/components/schemas/MerchantBrand"},{"type":"null"}],"description":"The known brand the merchant name matches; null when none matched with certainty."}},"type":"object","title":"Enrichment"},"ErrorBody":{"properties":{"type":{"type":"string","title":"Type","description":"invalid_request_error, authentication_error, permission_error, not_found_error, conflict_error, rate_limit_error, processing_error, api_error or service_unavailable_error"},"code":{"type":"string","title":"Code","description":"Machine-readable reason, e.g. file_too_large, missing_capability."},"message":{"type":"string","title":"Message"},"param":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"},"doc_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Url"},"details":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Details"}},"type":"object","required":["type","code","message"],"title":"ErrorBody"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorResponse"},"Extraction":{"properties":{"id":{"type":"string","title":"Id","examples":["rv_req_8fK2aQ0zT3mN1pL5vB7xY9"]},"object":{"type":"string","title":"Object","default":"extraction"},"status":{"type":"string","title":"Status","description":"queued, processing, succeeded or failed"},"livemode":{"type":"boolean","title":"Livemode"},"application":{"type":"string","title":"Application"},"document_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type"},"schema_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Schema Version"},"mode":{"type":"string","title":"Mode"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"data":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Data","description":"Values only, shaped like the document type."},"fields":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Fields","description":"Per field: FieldResult (or nested object/array results)."},"review":{"anyOf":[{"$ref":"#/components/schemas/Review"},{"type":"null"}]},"validation":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Validation"},"verification":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Verification"},"warnings":{"anyOf":[{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array"},{"type":"null"}],"title":"Warnings"},"quality":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Quality"},"enrichment":{"anyOf":[{"$ref":"#/components/schemas/Enrichment"},{"type":"null"}],"description":"Facts added from ReceViz's own knowledge rather than read off the page."},"processing":{"anyOf":[{"$ref":"#/components/schemas/Processing"},{"type":"null"}]},"ocr":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Ocr","description":"Only with options.include_ocr and the OCR capability."},"metadata":{"type":"object","title":"Metadata"},"error":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Error"}},"additionalProperties":true,"type":"object","required":["id","status","livemode","application","document_type","schema_version","mode","created_at"],"title":"Extraction"},"ExtractionList":{"properties":{"object":{"type":"string","title":"Object","default":"list"},"data":{"items":{"type":"object"},"type":"array","title":"Data"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"ExtractionList"},"FieldOutcome":{"properties":{"field":{"type":"string","maxLength":64,"title":"Field"},"device":{"type":"string","pattern":"^(none|candidate|confirmed|locked|read)$","title":"Device","description":"What the on-device reader settled on."},"confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence"},"cloud":{"type":"boolean","title":"Cloud","description":"ReceViz read a value for this field."},"agreed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Agreed","description":"Both read it: did they agree? Null if either read nothing."}},"type":"object","required":["field","device","cloud"],"title":"FieldOutcome"},"MerchantBrand":{"properties":{"brand":{"type":"string","title":"Brand","description":"Stable brand key, e.g. walgreens.","examples":["walgreens"]},"name":{"type":"string","title":"Name","description":"The brand's own name.","examples":["Walgreens"]},"kind":{"type":"string","title":"Kind","description":"merchant or bank"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"The brand's logo (128 px WebP), when logos are enabled for integrations. Brand names and logos are their owners' trademarks: show them only to identify the merchant on the document."}},"type":"object","required":["brand","name","kind"],"title":"MerchantBrand"},"Processing":{"properties":{"engine":{"type":"string","title":"Engine"},"mode":{"type":"string","title":"Mode"},"ocr_provider":{"type":"string","title":"Ocr Provider"},"pages":{"type":"integer","title":"Pages"},"tiling":{"type":"object","title":"Tiling"},"timings_ms":{"additionalProperties":{"type":"integer"},"type":"object","title":"Timings Ms"},"source":{"type":"string","title":"Source"}},"additionalProperties":true,"type":"object","required":["engine","mode","ocr_provider","pages","tiling","timings_ms","source"],"title":"Processing"},"QualityFeedback":{"properties":{"document_type":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Document Type"},"schema_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Schema Version"},"extraction_id":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Extraction Id"},"platform":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Platform"},"engine_version":{"anyOf":[{"type":"string","maxLength":48},{"type":"null"}],"title":"Engine Version"},"outcomes":{"items":{"$ref":"#/components/schemas/FieldOutcome"},"type":"array","maxItems":64,"title":"Outcomes"},"arithmetic":{"anyOf":[{"type":"string","pattern":"^(consistent|inconsistent|unknown)$"},{"type":"null"}],"title":"Arithmetic"},"sample":{"anyOf":[{"$ref":"#/components/schemas/QualitySample"},{"type":"null"}]}},"type":"object","required":["outcomes"],"title":"QualityFeedback"},"QualityFeedbackAck":{"properties":{"object":{"type":"string","title":"Object","default":"quality_feedback"},"recorded":{"type":"boolean","title":"Recorded"},"sample_kept":{"type":"boolean","title":"Sample Kept"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["recorded","sample_kept"],"title":"QualityFeedbackAck"},"QualitySample":{"properties":{"share":{"type":"boolean","title":"Share","description":"Explicitly share this misread's text. Honoured only under an 'enhanced' telemetry policy.","default":false},"ocr":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Ocr","description":"{width, height, lines: [{text, x, y, w, h, confidence}]}"},"device_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Device Values"},"cloud_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Cloud Values"}},"type":"object","title":"QualitySample"},"Review":{"properties":{"required":{"type":"boolean","title":"Required"},"reasons":{"items":{"$ref":"#/components/schemas/ReviewReason"},"type":"array","title":"Reasons"}},"type":"object","required":["required","reasons"],"title":"Review"},"ReviewReason":{"properties":{"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"},"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}},"type":"object","required":["field","code","message"],"title":"ReviewReason"},"SchemaModel":{"properties":{"id":{"type":"string","title":"Id"},"object":{"type":"string","title":"Object","default":"schema"},"document_type":{"type":"string","title":"Document Type"},"version":{"type":"integer","title":"Version"},"status":{"type":"string","title":"Status"},"breaking":{"type":"boolean","title":"Breaking"},"field_count":{"type":"integer","title":"Field Count"},"published_at":{"type":"string","title":"Published At"},"definition":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Definition"},"json_schema":{"anyOf":[{"type":"object"},{"type":"null"}],"title":"Json Schema"}},"additionalProperties":true,"type":"object","required":["id","document_type","version","status","breaking","field_count","published_at"],"title":"SchemaModel"},"Usage":{"properties":{"days":{"type":"integer","title":"Days"},"requests":{"type":"integer","title":"Requests"},"documents":{"type":"integer","title":"Documents"},"pages":{"type":"integer","title":"Pages"},"error_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Error Rate"},"latency_ms":{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"null"}]},"type":"object","title":"Latency Ms"},"by_day":{"items":{"type":"object"},"type":"array","title":"By Day"}},"additionalProperties":true,"type":"object","required":["days","requests","documents","pages","error_rate","latency_ms","by_day"],"title":"Usage"}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A secret key (rv_live_…, rv_test_…) or a client token (rv_ct_…)."}}},"security":[{"bearer":[]}],"webhooks":{"extraction.completed":{"post":{"summary":"extraction.completed","description":"An extraction finished.\n\nVerify `ReceViz-Signature: t=<unix>,v1=<hex>` = HMAC-SHA256(secret, `<t>.<raw body>`) and reject a `t` older than 5 minutes.","parameters":[{"name":"ReceViz-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"ReceViz-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"ReceViz-Event-Type","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"event"},"type":{"const":"extraction.completed"},"api_version":{"type":"string"},"created":{"type":"integer"},"livemode":{"type":"boolean"},"application":{"type":"string"},"data":{"type":"object","properties":{"object":{"$ref":"#/components/schemas/Extraction"}}}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds; anything else is retried."}}}},"extraction.failed":{"post":{"summary":"extraction.failed","description":"An asynchronous extraction could not be processed.\n\nVerify `ReceViz-Signature: t=<unix>,v1=<hex>` = HMAC-SHA256(secret, `<t>.<raw body>`) and reject a `t` older than 5 minutes.","parameters":[{"name":"ReceViz-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"ReceViz-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"ReceViz-Event-Type","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"event"},"type":{"const":"extraction.failed"},"api_version":{"type":"string"},"created":{"type":"integer"},"livemode":{"type":"boolean"},"application":{"type":"string"},"data":{"type":"object","properties":{"object":{"$ref":"#/components/schemas/Extraction"}}}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds; anything else is retried."}}}},"verification.completed":{"post":{"summary":"verification.completed","description":"VERIFIED mode verified at least one field.\n\nVerify `ReceViz-Signature: t=<unix>,v1=<hex>` = HMAC-SHA256(secret, `<t>.<raw body>`) and reject a `t` older than 5 minutes.","parameters":[{"name":"ReceViz-Signature","in":"header","required":true,"schema":{"type":"string"}},{"name":"ReceViz-Event-Id","in":"header","required":true,"schema":{"type":"string"}},{"name":"ReceViz-Event-Type","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"event"},"type":{"const":"verification.completed"},"api_version":{"type":"string"},"created":{"type":"integer"},"livemode":{"type":"boolean"},"application":{"type":"string"},"data":{"type":"object","properties":{"object":{"$ref":"#/components/schemas/Extraction"}}}}}}}},"responses":{"2XX":{"description":"Acknowledge within 10 seconds; anything else is retried."}}}}}}