{"openapi":"3.1.0","info":{"title":"AnyFormat API","description":"Document extraction and workflow automation API.\n\nAnyFormat lets you define extraction workflows that pull structured data from any document — PDFs, images, scanned files, or plain text. Upload a file, run it through a workflow, and get back structured fields with confidence scores and source evidence.\n\n## Quick start\n\n1. **Create a workflow** in the [AnyFormat dashboard](https://app.anyformat.ai) and define the fields you want to extract.\n2. **Run the workflow** via `POST /v2/workflows/{workflow_id}/run/` with a file attached.\n3. **Fetch results** via `GET /v2/workflows/{workflow_id}/files/{collection_id}/results/` once processing completes.\n\n## Authentication\n\nAll endpoints (except `/health/`) require a Bearer token in the `Authorization` header:\n\n```\nAuthorization: Bearer <your-api-key>\n```\n\nGet your API key from [app.anyformat.ai/settings](https://app.anyformat.ai/settings).\n\n## Versioning\n\nAll endpoints use the `/v2/` path prefix. All responses include `X-API-Version`.\n","version":"2.0.0"},"servers":[{"url":"https://api.anyformat.ai","description":"API server"}],"paths":{"/health/":{"get":{"tags":["health"],"summary":"Health Check","description":"Returns 200 OK if the service is running. No authentication required.\n\nUse this endpoint to verify API connectivity before making authenticated calls.","operationId":"health_check_health__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthCheckResponse"}}}}}}},"/v2/webhooks/":{"get":{"tags":["webhooks"],"summary":"List webhooks","description":"List all webhook subscriptions for the authenticated organization.\n\nReturns a list of webhooks. Secrets are excluded from the list response\nfor security — they are only returned once, when the webhook is created.","operationId":"list_webhooks_v2_webhooks__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WebhookListItem"},"type":"array","title":"Response List Webhooks V2 Webhooks  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]},"post":{"tags":["webhooks"],"summary":"Create webhook","description":"Create a new webhook subscription for your organization.\n\nThe webhook URL must use HTTPS. AnyFormat will send POST requests to this URL\nwhen the subscribed events occur. The response includes a `secret` that you\nshould use to verify webhook signatures.\n\nSupported events:\n- `extraction.completed` — fired when a file extraction finishes successfully.\n- `extraction.failed` — fired when a file extraction fails.","operationId":"create_webhook_v2_webhooks__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]}]}},"/v2/webhooks/{webhook_id}/":{"delete":{"tags":["webhooks"],"summary":"Delete webhook","description":"Delete a webhook subscription by ID.\n\nAfter deletion, AnyFormat will stop sending events to the webhook URL.\nThis action is irreversible.","operationId":"delete_webhook_v2_webhooks__webhook_id___delete","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"webhook_id","in":"path","required":true,"schema":{"type":"string","title":"Webhook Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/files/{collection_id}/":{"delete":{"tags":["files"],"summary":"Delete file collection","description":"Delete a file collection and all its files permanently.\n\nThis removes all uploaded files and any extraction results associated with\nthe collection. This action is irreversible.","operationId":"delete_file_v2_files__collection_id___delete","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/workflows/{workflow_id}/files/":{"get":{"tags":["files"],"summary":"List file collections","description":"List file collections for a workflow.\n\nA file collection groups one or more uploaded files together. Each collection\nhas a status indicating the extraction progress: `pending`, `processing`,\n`completed`, or `failed`.","operationId":"v2_list_workflow_files","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_CollectionListItem_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["files"],"summary":"Create file collection","description":"Upload one or more files to a workflow, creating a new file collection.\n\nUse this when you want to upload files without immediately running extraction.\nTo upload and extract in one step, use `POST /v2/workflows/{workflow_id}/run/` instead.\n\nSupported file types: PDF, PNG, JPG, TIFF, TXT, DOCX, XLSX, CSV, and more.","operationId":"v2_create_workflow_file","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v2_create_workflow_file"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCollectionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/workflows/{workflow_id}/files/{collection_id}/results/":{"get":{"tags":["files"],"summary":"Get file results","description":"Retrieve the extraction results for a file collection.\n\nReturns the structured data extracted from each file, including field values,\nconfidence scores, and source evidence (text excerpts and page numbers). Also\nincludes a `verification_url` linking to the AnyFormat dashboard for human review.\n\nPossible non-200 responses:\n\n- **412 `PRECONDITION_FAILED`** — extraction still in progress; retry with backoff.\n- **422 `EXTRACTION_FAILED`** — extraction did not complete successfully; terminal.\n  Polling will not transition the collection out of this state. Possible\n  next steps: review the document, retry the upload, or open the\n  collection in the AnyFormat dashboard for more context.\n- **422 `EXTRACTION_CANCELLED`** — extraction was cancelled; terminal.\n  Possible next steps: review the document, retry the upload, or open\n  the collection in the AnyFormat dashboard.\n\nUse webhooks (`extraction.completed` event) to avoid polling.","operationId":"v2_get_file_results","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"collection_id","in":"path","required":true,"schema":{"type":"string","title":"Collection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/workflows/":{"post":{"tags":["workflows"],"summary":"Create workflow","description":"Create a workflow from a strongly-typed graph (atomic).\n\nProvide an explicit list of typed `nodes` (parse / classify / splitter /\nextract) and `edges` between them. The full workflow — fields, nodes,\nrouting — is created in a single transaction.","operationId":"v2_create_workflow","security":[{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["workflows"],"summary":"List workflows","description":"List all workflows in your organization with pagination.\n\nWorkflows can be filtered by status and sorted by any field.","operationId":"v2_list_workflows","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/workflows/{workflow_id}/":{"get":{"tags":["workflows"],"summary":"Get workflow","description":"Retrieve a single workflow by its ID, including its configured extraction fields.","operationId":"v2_get_workflow","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["workflows"],"summary":"Delete workflow","description":"Delete a workflow and all associated file collections and extraction results.\n\nThis action is irreversible.","operationId":"v2_delete_workflow","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/workflows/{workflow_id}/run/":{"post":{"tags":["workflows"],"summary":"Run workflow","description":"Upload a file and immediately run the extraction workflow on it.\n\nThis is the primary endpoint for document extraction. It creates a file collection,\nuploads the file, and starts extraction in one step. The response includes a collection\n`id` that you can use to poll for results via\n`GET /v2/workflows/{workflow_id}/files/{collection_id}/results/`.\n\nProvide the file as a binary upload in the `file` field, or send raw text in the\n`text` field for text-only extraction.","operationId":"v2_run_workflow","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v2_run_workflow"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunResponseV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/workflows/{workflow_id}/upload/":{"post":{"tags":["workflows"],"summary":"Upload file","description":"Upload a file to a workflow without running extraction.\n\nUse this when you want to stage files for later processing. For upload-and-extract\nin one step, use `POST /v2/workflows/{workflow_id}/run/` instead.","operationId":"v2_upload_file","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_v2_upload_file"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadFileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/workflows/{workflow_id}/runs/":{"get":{"tags":["workflows"],"summary":"List workflow runs","description":"List all extraction runs for a workflow with pagination.\n\nEach run corresponds to a file collection that was processed by the workflow.\nUse the run's `id` (collection UUID) with\n`GET /v2/workflows/{workflow_id}/files/{id}/results/` to fetch detailed results.","operationId":"v2_list_workflow_runs","security":[{"ApiKeyAuth":[]}],"parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Block":{"properties":{"id":{"type":"string","title":"Id","description":"Stable block identifier in the form `p<page>_b<index>`."},"type":{"type":"string","title":"Type","description":"Semantic type: `text`, `title`, `section-header`, `table`, `picture`, `other`."},"page":{"type":"integer","title":"Page","description":"1-indexed page number this block belongs to."},"bbox":{"additionalProperties":{"type":"number"},"type":"object","title":"Bbox","description":"Normalised bounding box in [0, 1] page coordinates with keys `x0`/`y0`/`x1`/`y1`."},"layout_confidence":{"type":"number","title":"Layout Confidence","description":"0-100 YOLO layout detection confidence for this block."},"parse_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Parse Confidence","description":"0-100 parse confidence calibrated from LLM logprobs. `null` when logprobs were unavailable (e.g. text-bytes strategy)."},"content":{"type":"string","title":"Content","description":"Raw section body — markdown for text/title blocks, HTML for tables, `<figure-content>` for pictures."},"hyperlinks":{"items":{"$ref":"#/components/schemas/Hyperlink"},"type":"array","title":"Hyperlinks","description":"Hyperlinks found in the content via `[text](uri)` markdown syntax."},"rows":{"anyOf":[{"items":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array"},"type":"array"},{"type":"null"}],"title":"Rows","description":"2D array of table cells for `type=table` blocks — each cell is `{cell_id, text}`. `null` for non-table blocks."},"image_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Base64","description":"Inline base64-encoded cropped image for `type=picture` blocks. Currently `null` for all blocks — image hydration is performed client-side by the SDK consumer."}},"type":"object","required":["id","type","page","bbox","layout_confidence","content"],"title":"Block","description":"One semantic block of a parsed document — a structured alternative to\nwalking `<a id></a>` anchors in `markdown`.\n\nAll blocks expose the common fields (`id`, `type`, `page`, `bbox`,\n`confidence`, `content`). Type-specific structured data lives in the\noptional fields (`rows` for tables, `image_base64` for pictures).\nConsumers can switch on `type` to access the per-type fields, or treat\n`content` as the universal fallback."},"Body_v2_create_workflow_file":{"properties":{"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"Body_v2_create_workflow_file"},"Body_v2_run_workflow":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"}},"type":"object","title":"Body_v2_run_workflow"},"Body_v2_upload_file":{"properties":{"file":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"File"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"}},"type":"object","title":"Body_v2_upload_file"},"BooleanField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"boolean","title":"Data Type"}},"additionalProperties":false,"type":"object","required":["name","description","data_type"],"title":"BooleanField"},"ClassificationResult":{"properties":{"category":{"type":"string","title":"Category","description":"The category the document was classified as."},"confidence":{"type":"number","title":"Confidence","description":"0-100 model confidence in the verdict."},"evidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence","description":"Free-form evidence text (the snippets the classifier cited). `null` when none captured."}},"type":"object","required":["category","confidence"],"title":"ClassificationResult","description":"One classifier verdict for the collection."},"ClassifyCategory":{"properties":{"id":{"type":"string","minLength":1,"title":"Id","description":"Stable category id used as the edge `branch` value when routing."},"name":{"type":"string","minLength":1,"title":"Name","description":"Display name shown to the LLM."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the LLM."}},"additionalProperties":false,"type":"object","required":["id","name","description"],"title":"ClassifyCategory"},"ClassifyNode":{"properties":{"id":{"type":"string","minLength":1,"title":"Id","description":"Stable identifier for this node within the graph."},"type":{"type":"string","const":"classify","title":"Type"},"user_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Prompt","description":"Optional prompt prefix for the classifier."},"categories":{"items":{"$ref":"#/components/schemas/ClassifyCategory"},"type":"array","minItems":1,"title":"Categories"}},"additionalProperties":false,"type":"object","required":["id","type","categories"],"title":"ClassifyNode"},"CollectionListItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier of the file collection.","examples":["069dcc2c-e14c-7606-8000-2ee4fb17b4e1"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Human-readable name for the collection.","examples":["Collection for Invoice Processing"]},"status":{"type":"string","title":"Status","description":"Processing status: `pending`, `queued`, `in_progress`, `processed`, `error`, or `cancelled`.","examples":["processed"]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when the collection was created (ISO 8601)."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Timestamp when the collection was last updated (ISO 8601)."}},"type":"object","required":["id","status"],"title":"CollectionListItem","description":"A file collection entry in list responses. Each collection groups one or more uploaded files and tracks their extraction status."},"CreateCollectionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier of the newly created file collection.","examples":["069dcc2c-e14c-7606-8000-2ee4fb17b4e1"]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Human-readable name for the collection."},"files":{"items":{"$ref":"#/components/schemas/FileItem"},"type":"array","title":"Files","description":"List of files included in the collection, with their upload status."},"workflow_id":{"type":"string","title":"Workflow Id","description":"The UUID of the workflow this collection belongs to.","examples":["0686bb97-8c30-70f0-8000-97669e000eb8"]}},"type":"object","required":["id","files","workflow_id"],"title":"CreateCollectionResponse","description":"Response from creating a file collection. Contains the collection ID and the status of each uploaded file."},"DateField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"date","title":"Data Type"}},"additionalProperties":false,"type":"object","required":["name","description","data_type"],"title":"DateField"},"DatetimeField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"datetime","title":"Data Type"}},"additionalProperties":false,"type":"object","required":["name","description","data_type"],"title":"DatetimeField"},"Edge":{"properties":{"source":{"type":"string","minLength":1,"title":"Source"},"target":{"type":"string","minLength":1,"title":"Target"},"branch":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Branch","description":"Source-port label for branch routing. Required when leaving a classify or splitter node by category/rule."}},"additionalProperties":false,"type":"object","required":["source","target"],"title":"Edge","description":"A directed edge between two nodes. ``branch`` carries the source-port label\nused for routing out of ``classify`` (category id) or ``splitter`` (rule id) nodes."},"EnumField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"enum","title":"Data Type"},"enum_options":{"items":{"$ref":"#/components/schemas/EnumOption"},"type":"array","minItems":1,"title":"Enum Options"}},"additionalProperties":false,"type":"object","required":["name","description","data_type","enum_options"],"title":"EnumField"},"EnumOption":{"properties":{"name":{"type":"string","minLength":1,"title":"Name"},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the model."}},"additionalProperties":false,"type":"object","required":["name","description"],"title":"EnumOption"},"Evidence":{"properties":{"text":{"type":"string","title":"Text","description":"The exact source-text snippet that supports the extracted value."},"page_number":{"type":"integer","title":"Page Number","description":"1-indexed page number where the snippet was found."}},"type":"object","required":["text","page_number"],"title":"Evidence","description":"A snippet of source text supporting an extracted value, with the page it came from."},"ExtractNode":{"properties":{"id":{"type":"string","minLength":1,"title":"Id","description":"Stable identifier for this node within the graph."},"type":{"type":"string","const":"extract","title":"Type"},"mode":{"type":"string","enum":["standard","agentic"],"title":"Mode","default":"standard"},"extraction_schema":{"$ref":"#/components/schemas/ExtractionSchema","description":"Schema for the fields this node extracts. Required. The backend executor populates this from the ORM field tree before constructing the typed node; nothing else should be able to build an ExtractNode without it."},"lookup_files":{"items":{"type":"string"},"type":"array","title":"Lookup Files","description":"Smart-lookup reference document URIs persisted on the extract node."},"lookup_suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lookup Suggestion","description":"Free-form hint shown to the smart-lookup matcher."},"lookup_file_uploads":{"items":{"$ref":"#/components/schemas/LookupFileUpload"},"type":"array","title":"Lookup File Uploads","description":"Inline lookup-file content for the typed create call. The backend uploads each entry to S3 and stores the resulting URI in ``lookup_files``; this field is never persisted in GraphNode.config."},"lookup_schema":{"items":{"oneOf":[{"$ref":"#/components/schemas/StringField"},{"$ref":"#/components/schemas/IntegerField"},{"$ref":"#/components/schemas/FloatField"},{"$ref":"#/components/schemas/BooleanField"},{"$ref":"#/components/schemas/DateField"},{"$ref":"#/components/schemas/DatetimeField"},{"$ref":"#/components/schemas/EnumField"},{"$ref":"#/components/schemas/MultiSelectField"},{"$ref":"#/components/schemas/ObjectField"}],"discriminator":{"propertyName":"data_type","mapping":{"boolean":"#/components/schemas/BooleanField","date":"#/components/schemas/DateField","datetime":"#/components/schemas/DatetimeField","enum":"#/components/schemas/EnumField","float":"#/components/schemas/FloatField","integer":"#/components/schemas/IntegerField","multi_select":"#/components/schemas/MultiSelectField","object":"#/components/schemas/ObjectField","string":"#/components/schemas/StringField"}}},"type":"array","title":"Lookup Schema","description":"Typed schema of fields the smart-lookup pass should produce. The *backend* derives this from the field tree (FieldWorkflowVersion rows whose source is SMART_LOOKUP) and attaches it to the node before the message hits the wire — the worker then reads it directly off the node, with no DB round-trip. Default empty: a node without smart-lookup fields carries an empty list."},"use_images":{"type":"boolean","title":"Use Images","default":false}},"additionalProperties":false,"type":"object","required":["id","type","extraction_schema"],"title":"ExtractNode"},"ExtractedField":{"properties":{"value":{"anyOf":[{},{"type":"null"}],"title":"Value","description":"The extracted value. Type depends on the field's `data_type` (string, number, date, etc.). `null` when extraction could not produce a value."},"value_override":{"anyOf":[{},{"type":"null"}],"title":"Value Override","description":"A human-supplied override of the extracted `value`, if one was set during verification. `null` when no override exists."},"verification_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Status","description":"Verification state for this datapoint (e.g. `not_verified`, `verified`). `null` when not yet reviewed."},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","description":"Model confidence in the extracted value, on a 0-100 scale. `null` when the backend did not produce a confidence (e.g. manual entry)."},"evidence":{"items":{"$ref":"#/components/schemas/Evidence"},"type":"array","title":"Evidence","description":"Source-text snippets the model used to derive this value."}},"type":"object","required":["value"],"title":"ExtractedField","description":"One extracted field's value, confidence, and supporting evidence."},"Extraction":{"properties":{"split_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Split Name","description":"The split category this extraction belongs to. `null` for linear workflows."},"partition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partition","description":"The partition value within the split. `null` when the split has no partitions."},"fields":{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ExtractedField"},{"items":{"additionalProperties":{"$ref":"#/components/schemas/ExtractedField"},"type":"object"},"type":"array"}]},"type":"object","title":"Fields","description":"Extracted fields keyed by field name. Same shape as the legacy top-level `extraction`."}},"type":"object","required":["fields"],"title":"Extraction","description":"One unit of extracted data. For linear (parse->extract) workflows there\nis exactly one entry with `split_name=null` and `partition=null`. For split\nworkflows there is one entry per (split, partition) pair; join with\n`splits[]` by `split_name` to look up geometry."},"ExtractionSchema":{"properties":{"fields":{"items":{"oneOf":[{"$ref":"#/components/schemas/StringField"},{"$ref":"#/components/schemas/IntegerField"},{"$ref":"#/components/schemas/FloatField"},{"$ref":"#/components/schemas/BooleanField"},{"$ref":"#/components/schemas/DateField"},{"$ref":"#/components/schemas/DatetimeField"},{"$ref":"#/components/schemas/EnumField"},{"$ref":"#/components/schemas/MultiSelectField"},{"$ref":"#/components/schemas/ObjectField"}],"discriminator":{"propertyName":"data_type","mapping":{"boolean":"#/components/schemas/BooleanField","date":"#/components/schemas/DateField","datetime":"#/components/schemas/DatetimeField","enum":"#/components/schemas/EnumField","float":"#/components/schemas/FloatField","integer":"#/components/schemas/IntegerField","multi_select":"#/components/schemas/MultiSelectField","object":"#/components/schemas/ObjectField","string":"#/components/schemas/StringField"}}},"type":"array","minItems":1,"title":"Fields","description":"Field definitions making up this extract's output."}},"additionalProperties":false,"type":"object","required":["fields"],"title":"ExtractionSchema","description":"Schema describing what an extract node produces. Modeled as a typed\nobject (not a bare ``list[AnyField]``) so metadata can be added later\n(versioning, derived flags, output-shape hints) without another\nwire-format break.\n\nEvery extraction schema must declare at least one field. The backend\nexecutor populates this list from ``FieldWorkflowVersion`` rows\n*before* constructing the typed ExtractNode; extract nodes without\nany assigned fields are skipped at the executor layer rather than\nsent to the worker with an empty schema."},"FileItem":{"properties":{"filename":{"type":"string","title":"Filename","description":"Name of the uploaded file.","examples":["invoice.pdf"]},"status":{"type":"string","title":"Status","description":"Upload status: `uploaded` or `failed`.","examples":["uploaded"]}},"type":"object","required":["filename","status"],"title":"FileItem","description":"A single file within a collection, showing its name and upload status."},"FilePages":{"properties":{"file_id":{"type":"string","title":"File Id","description":"The file's UUID."},"file_name":{"type":"string","title":"File Name","description":"The file's display name."},"pages":{"items":{"type":"integer"},"type":"array","title":"Pages","description":"1-indexed page numbers from this file."}},"type":"object","required":["file_id","file_name","pages"],"title":"FilePages","description":"A file's contribution of pages to a split or partition. 1-indexed."},"FloatField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"float","title":"Data Type"}},"additionalProperties":false,"type":"object","required":["name","description","data_type"],"title":"FloatField"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthCheckResponse":{"properties":{"message":{"type":"string","title":"Message","description":"Status message. Returns `\"ok\"` when the service is healthy.","examples":["ok"]}},"type":"object","required":["message"],"title":"HealthCheckResponse","description":"Health check response confirming the API is operational."},"Hyperlink":{"properties":{"text":{"type":"string","title":"Text","description":"The display text of the link."},"uri":{"type":"string","title":"Uri","description":"The link target (URL, mailto:, etc.)."}},"type":"object","required":["text","uri"],"title":"Hyperlink","description":"A hyperlink found inside a block's content."},"IntegerField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"integer","title":"Data Type"}},"additionalProperties":false,"type":"object","required":["name","description","data_type"],"title":"IntegerField"},"LookupFileUpload":{"properties":{"filename":{"type":"string","minLength":1,"title":"Filename"},"content":{"type":"string","minLength":1,"title":"Content","description":"Base64-encoded file bytes."}},"additionalProperties":false,"type":"object","required":["filename","content"],"title":"LookupFileUpload","description":"Inline lookup-file content carried on the typed create call.\n\nThe backend reads ``filename`` + ``content`` (base64-encoded bytes),\nuploads the file to S3 during workflow create, and stores the resulting\nURI in ``ExtractNode.lookup_files``. This field is stripped from the\npersisted ``GraphNode.config`` — it is create-input only."},"MultiSelectField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"multi_select","title":"Data Type"},"enum_options":{"items":{"$ref":"#/components/schemas/EnumOption"},"type":"array","minItems":1,"title":"Enum Options"}},"additionalProperties":false,"type":"object","required":["name","description","data_type","enum_options"],"title":"MultiSelectField"},"ObjectField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"object","title":"Data Type"},"nested_fields":{"items":{"oneOf":[{"$ref":"#/components/schemas/StringField"},{"$ref":"#/components/schemas/IntegerField"},{"$ref":"#/components/schemas/FloatField"},{"$ref":"#/components/schemas/BooleanField"},{"$ref":"#/components/schemas/DateField"},{"$ref":"#/components/schemas/DatetimeField"},{"$ref":"#/components/schemas/EnumField"},{"$ref":"#/components/schemas/MultiSelectField"},{"$ref":"#/components/schemas/ObjectField"}],"discriminator":{"propertyName":"data_type","mapping":{"boolean":"#/components/schemas/BooleanField","date":"#/components/schemas/DateField","datetime":"#/components/schemas/DatetimeField","enum":"#/components/schemas/EnumField","float":"#/components/schemas/FloatField","integer":"#/components/schemas/IntegerField","multi_select":"#/components/schemas/MultiSelectField","object":"#/components/schemas/ObjectField","string":"#/components/schemas/StringField"}}},"type":"array","minItems":1,"title":"Nested Fields"}},"additionalProperties":false,"type":"object","required":["name","description","data_type","nested_fields"],"title":"ObjectField"},"PaginatedResponse_CollectionListItem_":{"properties":{"results":{"items":{"$ref":"#/components/schemas/CollectionListItem"},"type":"array","title":"Results","description":"List of items for the current page."},"count":{"type":"integer","title":"Count","description":"Total number of items matching the query."},"page":{"type":"integer","title":"Page","description":"Current page number."},"page_size":{"type":"integer","title":"Page Size","description":"Number of results per page."}},"type":"object","required":["results","count","page","page_size"],"title":"PaginatedResponse[CollectionListItem]"},"ParseNode":{"properties":{"id":{"type":"string","minLength":1,"title":"Id","description":"Stable identifier for this node within the graph."},"type":{"type":"string","const":"parse","title":"Type"},"mode":{"type":"string","enum":["standard","agentic"],"title":"Mode","default":"standard"},"prompt_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Hint","description":"Free-form hint shown to the parse model to bias output."},"figure_enhancement":{"type":"boolean","title":"Figure Enhancement","default":false},"cache":{"type":"boolean","title":"Cache","default":true}},"additionalProperties":false,"type":"object","required":["id","type"],"title":"ParseNode"},"ParseResult":{"properties":{"markdown":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Markdown","description":"Document content rendered as structured markdown. Each block is preceded by an empty `<a id=\"p{page}_b{idx}\"></a>` anchor (invisible in any markdown renderer; the id joins to `blocks[].id` and can be used as an in-page link target). Image hydration for picture/figure blocks happens client-side. `null` if parsing failed."},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Plain markdown with structural HTML removed — `<DOCUMENT>` framing, block anchors, `<img>` tags, and `<figure-content>` wrappers stripped. Useful when feeding the parsed output into an LLM or a search index that doesn't need the block-level metadata. `null` if `markdown` is null."},"layout_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Layout Confidence","description":"Document-level YOLO layout confidence on a 0-100 scale, char-weighted mean across all blocks. `null` if no annotated sections."},"parse_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Parse Confidence","description":"Document-level parse confidence on a 0-100 scale, char-weighted mean of per-block LLM logprob scores. `null` when no blocks have logprob-based confidence."},"blocks":{"items":{"$ref":"#/components/schemas/Block"},"type":"array","title":"Blocks","description":"Structured per-block representation of the parsed document. One entry per `<a id></a>` anchor in document order, with type-specific structured data (`rows` for tables, `image_base64` for pictures) surfaced as first-class fields so consumers don't have to HTML-parse."}},"type":"object","required":["markdown"],"title":"ParseResult","description":"Parsed markdown for a file."},"ResultsResponse":{"properties":{"collection_id":{"type":"string","title":"Collection Id","description":"The file collection's UUID. Same value as the `id` returned by `POST /v2/workflows/{wid}/run/`."},"verification_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Url","description":"Link to the AnyFormat dashboard for human review of this collection's results. `null` if the dashboard URL cannot be constructed (e.g. no files in the collection, or the deployment has no frontend URL configured)."},"parse":{"anyOf":[{"$ref":"#/components/schemas/ParseResult"},{"type":"null"}],"description":"Parse-node output (rendered markdown). `null` when the workflow has no parse node. Always present in the response."},"classifications":{"items":{"$ref":"#/components/schemas/ClassificationResult"},"type":"array","title":"Classifications","description":"Per-classifier-node verdicts. Empty when the workflow has no classifier."},"splits":{"items":{"$ref":"#/components/schemas/SplitResult"},"type":"array","title":"Splits","description":"Splitter output: category-level geometry with optional partitions. Empty when the workflow has no splitter."},"extractions":{"items":{"$ref":"#/components/schemas/Extraction"},"type":"array","title":"Extractions","description":"Flat list of extraction datapoints. Linear workflows produce one entry with `split_name=null` and `partition=null`. Split workflows produce one entry per (split, partition). Empty when no extraction has run yet."},"extraction":{"anyOf":[{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ExtractedField"},{"items":{"additionalProperties":{"$ref":"#/components/schemas/ExtractedField"},"type":"object"},"type":"array"}]},"type":"object"},{"type":"null"}],"title":"Extraction","description":"**Deprecated** — use `extractions` instead. Extracted fields keyed by field name, populated only for linear workflows (single extract node, no splitter). `null` for split workflows; read `extractions[]` instead.","deprecated":true}},"type":"object","required":["collection_id"],"title":"ResultsResponse","description":"Canonical response shape for the file-collection results endpoint.\n\nReturned with HTTP 200 once processing completes. Returns 412 while processing is\nin progress; poll until 200, or use webhooks."},"SplitPartition":{"properties":{"name":{"type":"string","title":"Name","description":"The partition value (free-form string)."},"files":{"items":{"$ref":"#/components/schemas/FilePages"},"type":"array","title":"Files"},"confidence":{"type":"integer","title":"Confidence","description":"0-100 minimum confidence across the partition's ranges."}},"type":"object","required":["name","files","confidence"],"title":"SplitPartition","description":"A partition value within a split (e.g. `1234-5678` under `Account Holdings`)."},"SplitResult":{"properties":{"name":{"type":"string","title":"Name","description":"The split's category name."},"files":{"items":{"$ref":"#/components/schemas/FilePages"},"type":"array","title":"Files","description":"Per-file page lists, union of all partitions."},"confidence":{"type":"integer","title":"Confidence","description":"0-100 aggregate confidence (min across partitions)."},"partitions":{"items":{"$ref":"#/components/schemas/SplitPartition"},"type":"array","title":"Partitions"}},"type":"object","required":["name","files","confidence"],"title":"SplitResult","description":"A category-level split: which pages of which files fall under it, plus\nany partitions inside it. Extraction data lives under `extractions[]` —\njoin by `split_name`."},"SplitterNode":{"properties":{"id":{"type":"string","minLength":1,"title":"Id","description":"Stable identifier for this node within the graph."},"type":{"type":"string","const":"splitter","title":"Type"},"rules":{"items":{"$ref":"#/components/schemas/SplitterRule"},"type":"array","minItems":1,"title":"Rules"}},"additionalProperties":false,"type":"object","required":["id","type","rules"],"title":"SplitterNode"},"SplitterRule":{"properties":{"id":{"type":"string","minLength":1,"title":"Id"},"name":{"type":"string","minLength":1,"title":"Name"},"description":{"type":"string","minLength":1,"title":"Description"},"partition_key":{"type":"string","title":"Partition Key","default":""}},"additionalProperties":false,"type":"object","required":["id","name","description"],"title":"SplitterRule"},"StringField":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","description":"Field name. Used as the key in the extraction response."},"description":{"type":"string","minLength":1,"title":"Description","description":"Free-form description shown to the extraction model."},"lookup":{"type":"boolean","title":"Lookup","default":false},"data_type":{"type":"string","const":"string","title":"Data Type"}},"additionalProperties":false,"type":"object","required":["name","description","data_type"],"title":"StringField"},"UploadFileResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Upload result: `uploaded` on success.","examples":["uploaded"]},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Name of the uploaded file.","examples":["invoice.pdf"]}},"type":"object","required":["status"],"title":"UploadFileResponse","description":"Confirmation that a file was uploaded successfully without triggering extraction."},"ValidateNode":{"properties":{"id":{"type":"string","minLength":1,"title":"Id","description":"Stable identifier for this node within the graph."},"type":{"type":"string","const":"validate","title":"Type"},"rules":{"items":{"$ref":"#/components/schemas/ValidationRule"},"type":"array","minItems":1,"title":"Rules"}},"additionalProperties":false,"type":"object","required":["id","type","rules"],"title":"ValidateNode"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"ValidationRule":{"properties":{"id":{"type":"string","minLength":1,"title":"Id","description":"Stable rule id; round-trips through ValidationResult.rule_id."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Optional human-readable rule name shown on the rule card in the Studio. Stored verbatim on the GraphNode config and surfaced back through the config endpoint so renames round-trip."},"description":{"type":"string","minLength":1,"title":"Description","description":"Natural-language description shown to the validation model."},"severity":{"type":"string","enum":["error","warning"],"title":"Severity","default":"error"},"source_fields":{"items":{"type":"string"},"type":"array","title":"Source Fields","description":"Persistent ids of fields this rule references."}},"additionalProperties":false,"type":"object","required":["id","description"],"title":"ValidationRule"},"WebhookCreateRequest":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"The HTTPS URL to receive webhook events. Must be publicly accessible.","examples":["https://example.com/webhooks/anyformat"]},"events":{"items":{"type":"string"},"type":"array","title":"Events","description":"List of event types to subscribe to. Available events: `extraction.completed`, `extraction.failed`.","examples":[["extraction.completed","extraction.failed"]]}},"type":"object","required":["url"],"title":"WebhookCreateRequest","description":"Request to create a new webhook subscription."},"WebhookListItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier of the webhook."},"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"The URL receiving webhook events.","examples":["https://example.com/webhooks/anyformat"]},"events":{"items":{"type":"string"},"type":"array","title":"Events","description":"Event types this webhook is subscribed to.","examples":[["extraction.completed","extraction.failed"]]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the webhook is currently active.","examples":[true]},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the webhook was created (ISO 8601)."}},"type":"object","required":["id","url","events","is_active","created_at"],"title":"WebhookListItem","description":"Webhook subscription details (secret excluded for security)."},"WebhookResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier of the webhook."},"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"The URL receiving webhook events.","examples":["https://example.com/webhooks/anyformat"]},"events":{"items":{"type":"string"},"type":"array","title":"Events","description":"Event types this webhook is subscribed to.","examples":[["extraction.completed","extraction.failed"]]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the webhook is currently active and receiving events.","examples":[true]},"secret":{"type":"string","title":"Secret","description":"Webhook signing secret. Use this to verify that incoming webhook requests are authentic. **Store securely — this value is only shown once at creation time.**"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Timestamp when the webhook was created (ISO 8601)."}},"type":"object","required":["id","url","events","is_active","secret","created_at"],"title":"WebhookResponse","description":"Webhook subscription details including the signing secret. The secret is only returned at creation time."},"WorkflowCreateRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name","examples":["Invoice or receipt"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","default":""},"nodes":{"items":{"oneOf":[{"$ref":"#/components/schemas/ParseNode"},{"$ref":"#/components/schemas/ClassifyNode"},{"$ref":"#/components/schemas/SplitterNode"},{"$ref":"#/components/schemas/ExtractNode"},{"$ref":"#/components/schemas/ValidateNode"}],"discriminator":{"propertyName":"type","mapping":{"classify":"#/components/schemas/ClassifyNode","extract":"#/components/schemas/ExtractNode","parse":"#/components/schemas/ParseNode","splitter":"#/components/schemas/SplitterNode","validate":"#/components/schemas/ValidateNode"}}},"type":"array","minItems":1,"title":"Nodes"},"edges":{"items":{"$ref":"#/components/schemas/Edge"},"type":"array","title":"Edges"}},"additionalProperties":false,"type":"object","required":["name","nodes"],"title":"WorkflowCreateRequest","description":"Public-surface workflow create body — typed graph of parse / classify / splitter / extract nodes.\n\nDefined as a thin subclass so the FastAPI-generated OpenAPI components\nentry is named ``WorkflowCreateRequest`` (FastAPI uses the model's\n``__name__``). Behaviour is fully inherited from\n``WorkflowDefinition`` in ``anyformat.workflow``."},"WorkflowListResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/WorkflowResponse"},"type":"array","title":"Results","description":"List of workflows for the current page."},"count":{"type":"integer","title":"Count","description":"Total number of workflows matching the query.","examples":[4]},"page":{"type":"integer","title":"Page","description":"Current page number.","examples":[1]},"page_size":{"type":"integer","title":"Page Size","description":"Number of results per page.","examples":[20]}},"type":"object","required":["results","count","page","page_size"],"title":"WorkflowListResponse","description":"Paginated list of workflows."},"WorkflowResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier of the workflow (UUID).","examples":["0686bb97-8c30-70f0-8000-97669e000eb8"]},"name":{"type":"string","title":"Name","description":"Human-readable name of the workflow.","examples":["Invoice Processing"]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description of what this workflow extracts.","examples":["A workflow for processing invoices and retrieving invoice details."]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when the workflow was created (ISO 8601)."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Timestamp when the workflow was last modified (ISO 8601)."},"fields":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Fields","description":"List of extraction field definitions configured for this workflow. `null` if not yet configured."}},"type":"object","required":["id","name"],"title":"WorkflowResponse","description":"A workflow defines the extraction template — what fields to extract from documents, their types, and validation rules."},"WorkflowRunListItem":{"properties":{"id":{"type":"string","title":"Id","description":"The collection UUID for this run. Use this ID with `GET /v2/workflows/{workflow_id}/files/{id}/results/` to fetch results.","examples":["069dcc2c-e14c-7606-8000-2ee4fb17b4e1"]},"status":{"type":"string","title":"Status","description":"Processing status: `pending`, `queued`, `in_progress`, `processed`, `error`, or `cancelled`.","examples":["processed"]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when the run started (ISO 8601)."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"Timestamp when the run status was last updated (ISO 8601)."}},"type":"object","required":["id","status"],"title":"WorkflowRunListItem","description":"An extraction run entry, representing one execution of a workflow on a file collection."},"WorkflowRunListResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/WorkflowRunListItem"},"type":"array","title":"Results","description":"List of runs for the current page."},"count":{"type":"integer","title":"Count","description":"Total number of runs for this workflow.","examples":[3]},"page":{"type":"integer","title":"Page","description":"Current page number.","examples":[1]},"page_size":{"type":"integer","title":"Page Size","description":"Number of results per page.","examples":[20]}},"type":"object","required":["results","count","page","page_size"],"title":"WorkflowRunListResponse","description":"Paginated list of workflow runs."},"WorkflowRunResponseV2":{"properties":{"id":{"type":"string","title":"Id","description":"The collection UUID for this run. Use this ID to poll for results via `GET /v2/workflows/{workflow_id}/files/{id}/results/`.","examples":["069dcc2c-e14c-7606-8000-2ee4fb17b4e1"]},"status":{"type":"string","title":"Status","description":"Initial status of the run, typically `success` (meaning the run was accepted, not that extraction is complete).","examples":["success"]},"workflow_id":{"type":"string","title":"Workflow Id","description":"The UUID of the workflow that was executed.","examples":["0686bb97-8c30-70f0-8000-97669e000eb8"]},"version_id":{"type":"string","title":"Version Id","description":"The workflow version this run was bound to (the latest version at submission time). Lets callers verify which schema produced the results — useful right after an edit.","examples":["FGaV4I2JAA"]}},"type":"object","required":["id","status","workflow_id","version_id"],"title":"WorkflowRunResponseV2","description":"Response after triggering a workflow run. Contains the collection ID to use for polling extraction results."}},"securitySchemes":{"ApiKeyAuth":{"type":"http","description":"API key issued from app.anyformat.ai/settings. Send as `Authorization: Bearer <key>`.","scheme":"bearer"}}},"tags":[{"name":"workflows","description":"Workflows define extraction templates — what fields to extract from documents. Create workflows, upload files, run extractions, and fetch results."},{"name":"files","description":"File collections group uploaded documents and track their extraction progress. Upload files, check status, and retrieve extraction results."},{"name":"webhooks","description":"Webhook subscriptions for asynchronous event notifications. Get notified when extractions complete or fail."},{"name":"health","description":"Health check endpoints to verify API availability."}]}