Skip to main content

Response Formats

The anyformat API returns JSON responses. This page covers the response shapes used across the API.

Paginated List Responses

Endpoints that return multiple items use paginated responses:
{
  "count": 25,
  "page": 1,
  "page_size": 20,
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Invoice Data Processing",
      "description": "Processes invoice data from PDF documents",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-20T14:22:00Z"
    }
  ]
}
FieldDescription
countTotal number of items across all pages
pageCurrent page number (1-indexed)
page_sizeNumber of items per page (max 100)
resultsArray of items for the current page

Workflow Results Format

The results endpoint (/v2/workflows/{id}/results/) always returns unified JSON. The response is keyed by filename, with each file containing parse and extraction data.
curl "https://api.anyformat.ai/v2/workflows/{id}/results/" \
  -H "Authorization: Bearer YOUR_API_KEY"
Use the file_id query parameter to filter results to a single file:
curl "https://api.anyformat.ai/v2/workflows/{id}/results/?file_id=FILE_UUID" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Structure

Each file entry in the response contains a results object with two possible keys:
KeyPresenceDescription
parseAlwaysContains markdown with the visual document markdown (may include base64 images)
extractionOnly when the workflow has extraction fieldsContains extracted field values with confidence scores

Example Response

{
  "invoice-001.pdf": {
    "results": {
      "parse": {
        "markdown": "<DOCUMENT filename=\"invoice-001.pdf\">\n# Invoice\n..."
      },
      "extraction": {
        "invoice_number": {
          "value": "INV-12345",
          "confidence": 95.2
        },
        "total_amount": {
          "value": "1250.00",
          "confidence": 92.0
        }
      }
    }
  }
}
For parse-only workflows (no extraction fields), the extraction key is omitted:
{
  "document.pdf": {
    "results": {
      "parse": {
        "markdown": "<DOCUMENT filename=\"document.pdf\">\n# Meeting Notes\n...</DOCUMENT>"
      }
    }
  }
}

Extraction Result Field Structure

Each extracted field in the extraction object contains:
{
  "field_name": {
    "value": "extracted_value",
    "confidence": 95.2
  }
}
PropertyDescription
valueThe extracted value
confidenceConfidence score (0-100)

Supported Endpoints

EndpointDescription
GET /v2/workflows/{id}/results/Unified JSON results for all files in a workflow
GET /v2/workflows/{id}/results/?file_id=UUIDResults filtered to a single file
GET /v2/files/{id}/extraction/Extraction results for a single file