{"openapi":"3.1.0","info":{"title":"Parsefox API","description":"Turn documents into schema-shaped JSON with evidence and verification for every value.","version":"0.1.0"},"paths":{"/v1/extractions":{"post":{"tags":["Extractions"],"summary":"Create an extraction","operationId":"create_extraction_v1_extractions_post","parameters":[{"name":"wait","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":0,"default":0,"title":"Wait"}},{"name":"include","in":"query","required":false,"schema":{"type":"string","default":"","title":"Include"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Retrying with the same key returns the original job.","schema":{"type":"string","maxLength":128}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Extractions"],"summary":"List extractions","operationId":"list_extractions_v1_extractions_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"schema_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Id"}},{"name":"schema_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Schema Version"}},{"name":"template_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"}},{"name":"document_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"}},{"name":"key_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Id"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created Before"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Extractions V1 Extractions Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/schema-suggestions":{"post":{"summary":"Suggest a schema","operationId":"suggest_schema_v1_schema_suggestions_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestSchemaRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Schema suggestions"]}},"/v1/extractions/{job_id}":{"get":{"tags":["Extractions"],"summary":"Get an extraction","operationId":"get_extraction_v1_extractions__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"wait","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":0,"default":0,"title":"Wait"}},{"name":"include","in":"query","required":false,"schema":{"type":"string","default":"","title":"Include"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/extractions/{job_id}/cancel":{"post":{"tags":["Extractions"],"summary":"Cancel an extraction","operationId":"cancel_extraction_v1_extractions__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/extractions/{job_id}/result":{"get":{"tags":["Extractions"],"summary":"Get the result","operationId":"get_extraction_result_v1_extractions__job_id__result_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"include","in":"query","required":false,"schema":{"type":"string","default":"","title":"Include"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Extraction Result V1 Extractions  Job Id  Result Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/extractions/{job_id}/result/export":{"get":{"summary":"Export the result","operationId":"export_v1_extractions__job_id__result_export_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Extractions"]}},"/v1/documents/{document_id}":{"delete":{"tags":["Documents"],"summary":"Delete a document","description":"Delete a document with its runs, results and files now, before its retention ends.","operationId":"delete_document_v1_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get a document","operationId":"get_document_v1_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentDetailResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/documents":{"get":{"tags":["Documents"],"summary":"List documents","operationId":"list_documents_v1_documents_get","parameters":[{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Documents V1 Documents Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Upload a document","operationId":"upload_document_v1_documents_post","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/DocumentUploadResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/api-keys":{"get":{"tags":["API keys"],"summary":"List API keys","operationId":"list_api_keys_v1_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key","operationId":"create_api_key_v1_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/api-keys/{key_id}/revoke":{"post":{"tags":["API keys"],"summary":"Revoke an API key","operationId":"revoke_api_key_v1_api_keys__key_id__revoke_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates":{"get":{"tags":["Templates"],"summary":"List templates","operationId":"list_template_catalog_v1_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Template Catalog V1 Templates Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/{template_id}":{"get":{"tags":["Templates"],"summary":"Get a template","operationId":"get_template_v1_templates__template_id__get","parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Template V1 Templates  Template Id  Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/schemas":{"get":{"tags":["Schemas"],"summary":"List schemas","operationId":"list_schemas_v1_schemas_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Archived"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Schemas V1 Schemas Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Schemas"],"summary":"Create a schema","operationId":"create_schema_v1_schemas_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Schema V1 Schemas Post"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/schemas/{schema_id}":{"get":{"tags":["Schemas"],"summary":"Get a schema","operationId":"get_schema_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":{"type":"object","additionalProperties":true,"title":"Response Get Schema V1 Schemas  Schema Id  Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Schemas"],"summary":"Rename or archive a schema","operationId":"update_schema_v1_schemas__schema_id__patch","parameters":[{"name":"schema_id","in":"path","required":true,"schema":{"type":"string","title":"Schema Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Schema V1 Schemas  Schema Id  Patch"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/schemas/{schema_id}/versions":{"post":{"tags":["Schemas"],"summary":"Publish a schema version","operationId":"create_schema_version_v1_schemas__schema_id__versions_post","parameters":[{"name":"schema_id","in":"path","required":true,"schema":{"type":"string","title":"Schema Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Schema Version V1 Schemas  Schema Id  Versions Post"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Schemas"],"summary":"List schema versions","operationId":"list_schema_versions_v1_schemas__schema_id__versions_get","parameters":[{"name":"schema_id","in":"path","required":true,"schema":{"type":"string","title":"Schema Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Schema Versions V1 Schemas  Schema Id  Versions Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/schemas/{schema_id}/versions/{version}":{"get":{"tags":["Schemas"],"summary":"Get a schema version","operationId":"get_schema_version_v1_schemas__schema_id__versions__version__get","parameters":[{"name":"schema_id","in":"path","required":true,"schema":{"type":"string","title":"Schema Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Schema Version V1 Schemas  Schema Id  Versions  Version  Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","operationId":"list_endpoints_v1_webhooks_get","parameters":[{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Endpoints V1 Webhooks Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint","operationId":"create_endpoint_v1_webhooks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Endpoint V1 Webhooks Post"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{endpoint_id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook endpoint","operationId":"get_endpoint_v1_webhooks__endpoint_id__get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Endpoint V1 Webhooks  Endpoint Id  Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Webhooks"],"summary":"Update a webhook endpoint","operationId":"update_endpoint_v1_webhooks__endpoint_id__patch","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Endpoint V1 Webhooks  Endpoint Id  Patch"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint","operationId":"delete_endpoint_v1_webhooks__endpoint_id__delete","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Endpoint V1 Webhooks  Endpoint Id  Delete"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{endpoint_id}/rotate-secret":{"post":{"tags":["Webhooks"],"summary":"Rotate the signing secret","operationId":"rotate_endpoint_secret_v1_webhooks__endpoint_id__rotate_secret_post","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rotate Endpoint Secret V1 Webhooks  Endpoint Id  Rotate Secret Post"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhooks/{endpoint_id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"List deliveries","operationId":"list_deliveries_v1_webhooks__endpoint_id__deliveries_get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Deliveries V1 Webhooks  Endpoint Id  Deliveries Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/webhook-deliveries/{delivery_id}/resend":{"post":{"tags":["Webhooks"],"summary":"Resend a delivery","operationId":"resend_delivery_v1_webhook_deliveries__delivery_id__resend_post","parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resend Delivery V1 Webhook Deliveries  Delivery Id  Resend Post"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"tags":["Account"],"summary":"Get usage and spend","description":"Live spend over the last `days` days; test mode is free and not listed.","operationId":"get_usage_v1_usage_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":366,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage V1 Usage Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/ledger":{"get":{"tags":["Account"],"summary":"List credit ledger entries","description":"Every credit and charge on the account, newest first.","operationId":"list_ledger_v1_ledger_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Ledger V1 Ledger Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/health/live":{"get":{"summary":"Liveness","operationId":"health_live_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Live Health Live Get"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Health"],"security":[]}},"/health/ready":{"get":{"summary":"Readiness","operationId":"health_ready_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Health"],"security":[]}},"/v1/documents/{document_id}/units/{unit_id}/preview":{"get":{"summary":"Render a unit preview","operationId":"preview_v1_documents__document_id__units__unit_id__preview_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"unit_id","in":"path","required":true,"schema":{"type":"string","title":"Unit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview V1 Documents  Document Id  Units  Unit Id  Preview Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/documents/{document_id}/units/{unit_id}/location":{"post":{"summary":"Locate a quote","operationId":"locate_v1_documents__document_id__units__unit_id__location_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"unit_id","in":"path","required":true,"schema":{"type":"string","title":"Unit Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Locate V1 Documents  Document Id  Units  Unit Id  Location Post"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/extractions/{job_id}/result/manifest":{"get":{"summary":"Get the result manifest","operationId":"manifest_v1_extractions__job_id__result_manifest_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Extractions"]}},"/v1/extractions/{job_id}/result/collections":{"get":{"summary":"Get a result collection","operationId":"collection_v1_extractions__job_id__result_collections_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Extractions"]}},"/v1/extractions/{job_id}/result/parts":{"get":{"summary":"Get result parts","operationId":"parts_v1_extractions__job_id__result_parts_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"after","in":"query","required":false,"schema":{"type":"string","default":"","title":"After"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Extractions"]}},"/v1/schema-suggestions/{job_id}":{"get":{"summary":"Get a schema suggestion","operationId":"get_suggestion_v1_schema_suggestions__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Schema suggestions"]}},"/v1/schema-suggestions/{job_id}/cancel":{"post":{"summary":"Cancel a schema suggestion","operationId":"cancel_suggestion_v1_schema_suggestions__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Schema suggestions"]}},"/v1/documents/{document_id}/content":{"get":{"summary":"Download the original file","operationId":"get_original_v1_documents__document_id__content_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/documents/{document_id}/units":{"get":{"summary":"List document units","operationId":"list_units_v1_documents__document_id__units_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Units V1 Documents  Document Id  Units Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/documents/{document_id}/units/{unit_id}/text":{"get":{"summary":"Get unit text","operationId":"get_unit_text_v1_documents__document_id__units__unit_id__text_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"unit_id","in":"path","required":true,"schema":{"type":"string","title":"Unit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/documents/{document_id}/units/{unit_id}/images/{image_index}":{"get":{"summary":"Get a unit image","operationId":"get_unit_image_v1_documents__document_id__units__unit_id__images__image_index__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}},{"name":"unit_id","in":"path","required":true,"schema":{"type":"string","title":"Unit Id"}},{"name":"image_index","in":"path","required":true,"schema":{"type":"integer","title":"Image Index"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/documents/{document_id}/estimate":{"post":{"summary":"Estimate extraction cost","operationId":"estimate_extraction_v1_documents__document_id__estimate_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExtractionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Documents"]}},"/v1/extractions/{job_id}/decisions":{"get":{"summary":"Get extraction decisions","operationId":"get_extraction_decisions_v1_extractions__job_id__decisions_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionsListResponse"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Extractions"]}},"/v1/me":{"get":{"summary":"Get the current workspace","operationId":"get_current_tenant_profile_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Current Tenant Profile V1 Me Get"}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Account"]}}},"components":{"schemas":{"Body_upload_document_v1_documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_document_v1_documents_post"},"CreateExtractionRequest":{"properties":{"document_id":{"type":"string","title":"Document Id"},"schema":{"additionalProperties":true,"type":"object","title":"Schema"},"instructions":{"type":"string","maxLength":16000,"title":"Instructions","default":""},"model_profile":{"type":"string","enum":["default","always_vision","text_only","decision_no_verify"],"title":"Model Profile","default":"default"}},"type":"object","required":["document_id","schema"],"title":"CreateExtractionRequest"},"DecisionItemResponse":{"properties":{"decision_id":{"type":"string","title":"Decision Id"},"unit_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit Id"},"field_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field Path"},"kind":{"type":"string","title":"Kind"},"model_id":{"type":"string","title":"Model Id"},"version":{"type":"string","title":"Version"},"scores":{"additionalProperties":true,"type":"object","title":"Scores"},"selected":{"title":"Selected"},"latency_ms":{"type":"integer","title":"Latency Ms"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["decision_id","kind","model_id","version","scores","latency_ms","created_at"],"title":"DecisionItemResponse"},"DecisionsListResponse":{"properties":{"job_id":{"type":"string","title":"Job Id"},"decisions":{"items":{"$ref":"#/components/schemas/DecisionItemResponse"},"type":"array","title":"Decisions"},"offset":{"type":"integer","title":"Offset","default":0},"limit":{"type":"integer","title":"Limit","default":100},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["job_id","decisions"],"title":"DecisionsListResponse"},"DocumentDetailResponse":{"properties":{"document_id":{"type":"string","title":"Document Id"},"filename":{"type":"string","title":"Filename"},"media_type":{"type":"string","title":"Media Type"},"sha256":{"type":"string","title":"Sha256"},"bytes":{"type":"integer","title":"Bytes"},"status":{"type":"string","title":"Status"},"units_count":{"type":"integer","title":"Units Count"},"conversion_warnings":{"items":{"type":"string"},"type":"array","title":"Conversion Warnings"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["document_id","filename","media_type","sha256","bytes","status","units_count","created_at"],"title":"DocumentDetailResponse"},"DocumentUploadResponse":{"properties":{"document_id":{"type":"string","title":"Document Id"},"filename":{"type":"string","title":"Filename"},"media_type":{"type":"string","title":"Media Type"},"sha256":{"type":"string","title":"Sha256"},"status":{"type":"string","title":"Status"}},"type":"object","required":["document_id","filename","media_type","sha256","status"],"title":"DocumentUploadResponse"},"EndpointCreate":{"properties":{"url":{"type":"string","maxLength":2048,"minLength":8,"title":"Url"},"events":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Events"},"description":{"type":"string","maxLength":255,"title":"Description","default":""},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode","description":"Console sessions only: 'live' (default) or 'test'."}},"type":"object","required":["url"],"title":"EndpointCreate"},"EndpointUpdate":{"properties":{"url":{"anyOf":[{"type":"string","maxLength":2048,"minLength":8},{"type":"null"}],"title":"Url"},"events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Events"},"description":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Description"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"EndpointUpdate"},"Error":{"type":"object","title":"Error","required":["error_id","code","message"],"properties":{"error_id":{"type":"string","description":"Include it when contacting support."},"code":{"type":"string","description":"Stable machine-readable code."},"message":{"type":"string","description":"Human-readable explanation."}}},"ExtractionCreate":{"properties":{"document_id":{"type":"string","maxLength":80,"minLength":1,"title":"Document Id"},"schema_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schema Id"},"schema_version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Schema Version"},"template_id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Template Id"},"schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Schema"},"instructions":{"type":"string","maxLength":16000,"title":"Instructions","default":""},"model_profile":{"type":"string","maxLength":40,"title":"Model Profile","default":"default"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Up to 20 keys (1-40 characters) with values up to 500 characters. Numbers and booleans are stored as strings. In test mode, test_outcome picks the result."}},"additionalProperties":false,"type":"object","required":["document_id"],"title":"ExtractionCreate"},"KeyCreate":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"},"mode":{"type":"string","pattern":"^(live|test)$","title":"Mode","default":"test"}},"type":"object","required":["name"],"title":"KeyCreate"},"LocationRequest":{"properties":{"quote":{"type":"string","maxLength":16000,"title":"Quote","default":""},"start":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"End"},"artifact_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artifact Sha256"}},"type":"object","title":"LocationRequest"},"SchemaCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"schema":{"additionalProperties":true,"type":"object","title":"Schema"},"instructions":{"type":"string","maxLength":16000,"title":"Instructions","default":""}},"type":"object","required":["name","schema"],"title":"SchemaCreate"},"SchemaUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"archived":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Archived"}},"type":"object","title":"SchemaUpdate"},"SuggestSchemaRequest":{"properties":{"document_ids":{"items":{"type":"string","maxLength":80,"minLength":1},"type":"array","maxItems":5,"minItems":1,"title":"Document Ids"},"max_cost_usd":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Cost Usd"}},"type":"object","required":["document_ids"],"title":"SuggestSchemaRequest"},"VersionCreate":{"properties":{"schema":{"additionalProperties":true,"type":"object","title":"Schema"},"instructions":{"type":"string","maxLength":16000,"title":"Instructions","default":""},"base_version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Base Version","description":"Reject the new version if the latest version is no longer this one."}},"type":"object","required":["schema"],"title":"VersionCreate"}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A Parsefox API key: pf_live_… or pf_test_…."}}},"tags":[{"name":"Documents","description":"Upload files and inspect their pages and units."},{"name":"Extractions","description":"Extract schema-shaped JSON from a document."},{"name":"Schemas","description":"Versioned JSON Schemas saved in your workspace."},{"name":"Templates","description":"Built-in schemas to start from."},{"name":"Schema suggestions","description":"Draft a schema from example documents."},{"name":"Webhooks","description":"Signed event delivery to your endpoints."},{"name":"API keys","description":"Live and test keys for the API."},{"name":"Account","description":"The workspace behind the current key."},{"name":"Health","description":"Liveness and readiness probes."}],"security":[{"bearerAuth":[]}]}