Skip to main content
GET
/
v2
/
workflows
/
{workflow_id}
/
files
/
{collection_id}
/
results
curl -X GET 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/files/b2c3d4e5-f6a7-8901-bcde-f12345678901/results/' \
  -H 'Authorization: Bearer YOUR_API_KEY'
{
  "collection_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
  "verification_url": "https://app.anyformat.ai/workflows/.../files/...",
  "parse": {
    "markdown": "<DOCUMENT id=\"1\" page=\"1\">..."
  },
  "extraction": {
    "invoice_number": {
      "value": "INV-001",
      "value_override": null,
      "verification_status": "not_verified",
      "confidence": 95.0,
      "evidence": [{"text": "Invoice #INV-001", "page_number": 1}]
    },
    "total_amount": {
      "value": 1250.00,
      "value_override": null,
      "verification_status": "not_verified",
      "confidence": 92.0,
      "evidence": [{"text": "Total: $1,250.00", "page_number": 1}]
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.anyformat.ai/llms.txt

Use this file to discover all available pages before exploring further.

Retrieve processing results for a file collection. Returns results from all configured workflow nodes (parse, extraction, classification, etc.) in a flat dictionary keyed by node category.
The collection_id in the URL is the id returned by POST /v2/workflows/{workflow_id}/files/ or POST /v2/workflows/{workflow_id}/run/.
The endpoint returns:
  • 200 OK with results when processing has completed successfully
  • 412 Precondition Failed while processing is in progress (retryable)
  • 422 Unprocessable Entity when the extraction is in a terminal state (failed or cancelled) — distinguish via error_code
HTTPerror_codeMeaningRetry the GET?
200Results available
412PRECONDITION_FAILEDStill processing (pending, queued, in_progress)Yes, with backoff
422EXTRACTION_FAILEDJob did not complete successfullyNo — polling will not change the state. Possible next steps: review the document, retry the upload, or open the collection in the AnyFormat dashboard.
422EXTRACTION_CANCELLEDJob was cancelledNo. Possible next steps: review the document, retry the upload, or open the collection in the AnyFormat dashboard.
Prefer webhooks over polling for production integrations. Webhooks deliver results immediately without consuming your rate limit.

Polling Example with Backoff

import time
import anyformat
from anyformat import Anyformat

client = Anyformat()
workflow_id = "550e8400-e29b-41d4-a716-446655440000"
file_id = "b2c3d4e5-f6a7-8901-bcde-f12345678901"

max_attempts = 60
base_delay = 5

for attempt in range(max_attempts):
    try:
        results = client.files.get_results(workflow_id, file_id)
        print(results)
        break
    except anyformat.APIStatusError as e:
        error_code = (e.body or {}).get("error_code")
        if error_code == "PRECONDITION_FAILED":
            # Still processing — back off and retry
            delay = min(base_delay * (1.5 ** min(attempt, 5)), 30)
            time.sleep(delay)
        elif error_code in ("EXTRACTION_FAILED", "EXTRACTION_CANCELLED"):
            # Terminal — polling will not change this. Review the document, retry the upload, or check the AnyFormat dashboard.
            print(f"Extraction terminal: {error_code}")
            break
        elif e.status_code == 429:
            time.sleep(10)
        else:
            print(f"Error: {e.message}")
            break
else:
    print("Polling timed out — consider using webhooks for production")
curl -X GET 'https://api.anyformat.ai/v2/workflows/550e8400-e29b-41d4-a716-446655440000/files/b2c3d4e5-f6a7-8901-bcde-f12345678901/results/' \
  -H 'Authorization: Bearer YOUR_API_KEY'
{
  "collection_id": "069dcc2c-e14c-7606-8000-2ee4fb17b4e1",
  "verification_url": "https://app.anyformat.ai/workflows/.../files/...",
  "parse": {
    "markdown": "<DOCUMENT id=\"1\" page=\"1\">..."
  },
  "extraction": {
    "invoice_number": {
      "value": "INV-001",
      "value_override": null,
      "verification_status": "not_verified",
      "confidence": 95.0,
      "evidence": [{"text": "Invoice #INV-001", "page_number": 1}]
    },
    "total_amount": {
      "value": 1250.00,
      "value_override": null,
      "verification_status": "not_verified",
      "confidence": 92.0,
      "evidence": [{"text": "Total: $1,250.00", "page_number": 1}]
    }
  }
}
The extraction and parse keys are always present in the success response — they are explicitly null when the corresponding node didn’t run. See Response Formats for the canonical shape with field-by-field documentation.

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/settings. Send as Authorization: Bearer <key>.

Path Parameters

workflow_id
string
required
collection_id
string
required

Response

Successful Response

Canonical response shape for the file-collection results endpoint.

Returned with HTTP 200 once processing completes. Returns 412 while processing is in progress; poll until 200, or use webhooks.

collection_id
string
required

The file collection's UUID. Same value as the id returned by POST /v2/workflows/{wid}/run/.

verification_url
string | null

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
ParseResult · object

Parse-node output (rendered markdown). null when the workflow has no parse node. Always present in the response.

classifications
ClassificationResult · object[]

Per-classifier-node verdicts. Empty when the workflow has no classifier.

splits
SplitResult · object[]

Splitter output: category-level geometry with optional partitions. Empty when the workflow has no splitter.

extractions
Extraction · object[]

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
Extraction · object
deprecated

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.