> ## 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.

# Create Workflow

> Create a workflow from a typed graph of parse / classify / splitter / extract nodes in a single atomic transaction

<Tip>
  We recommend creating workflows in the [anyformat platform](https://app.anyformat.ai) where you can visually configure fields, test with sample documents, and iterate faster. Once your workflow is ready, copy its ID and use it with the API to run workflows programmatically.
</Tip>

`POST /v2/workflows/` creates a workflow from a strongly-typed graph. Use it to:

* **Configure parse-node settings** (standard or agentic mode, prompt hints, figure enhancement)
* **Build parse-only workflows** (no extract node — markdown only)
* **Route documents through classifiers or splitters** to multiple extract nodes
* **Run simple linear `parse → extract` workflows**

## Request Body

| Field         | Type    | Required | Description                                           |
| ------------- | ------- | -------- | ----------------------------------------------------- |
| `name`        | string  | Yes      | Workflow name                                         |
| `description` | string  | No       | Optional description                                  |
| `nodes`       | Node\[] | Yes      | At least one node; exactly one must be `type="parse"` |
| `edges`       | Edge\[] | No       | Directed edges; empty for parse-only workflows        |

### Parse Node

The entry-point node. Exactly one per workflow.

| Field                | Type                      | Default      | Description                                                                            |
| -------------------- | ------------------------- | ------------ | -------------------------------------------------------------------------------------- |
| `id`                 | string                    | —            | Stable identifier (e.g. `"parse_1"`)                                                   |
| `type`               | `"parse"`                 | —            | Discriminator                                                                          |
| `mode`               | `"standard" \| "agentic"` | `"standard"` | Use `"agentic"` for per-block LLM routing through typed strategies (text/table/figure) |
| `prompt_hint`        | string                    | `null`       | Domain hint shown to the parser (e.g. "medical lab report, preserve numerics exactly") |
| `figure_enhancement` | boolean                   | `false`      | Extract structured descriptions of charts and images (extra LLM cost)                  |

### Extract Node

Pulls structured fields from upstream parsed content.

| Field               | Type        | Required             | Description                                       |
| ------------------- | ----------- | -------------------- | ------------------------------------------------- |
| `id`                | string      | Yes                  | Stable identifier                                 |
| `type`              | `"extract"` | Yes                  | Discriminator                                     |
| `extraction_schema` | object      | Yes                  | `{ "fields": [...] }` — at least one field        |
| `use_images`        | boolean     | No (default `false`) | Pass rendered page images to the extraction model |

Field shape — see [Field Types](/concepts/field-types).

### Classify / Splitter Nodes

Branch routing nodes — see [Field Types](/concepts/field-types) and the splitter cookbook recipes.

### Edges

| Field    | Type   | Required    | Description                                                                                        |
| -------- | ------ | ----------- | -------------------------------------------------------------------------------------------------- |
| `source` | string | Yes         | Source node id                                                                                     |
| `target` | string | Yes         | Target node id                                                                                     |
| `branch` | string | Conditional | Required when leaving a `classify` (category id) or `splitter` (rule id) node; forbidden otherwise |

## Examples

### Linear parse → extract

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST 'https://api.anyformat.ai/v2/workflows/' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -d '{
      "name": "Invoice extractor",
      "nodes": [
        {"id": "parse_1", "type": "parse"},
        {
          "id": "extract_1",
          "type": "extract",
          "extraction_schema": {
            "fields": [
              {"name": "invoice_number", "description": "Invoice ID", "data_type": "string"},
              {"name": "total", "description": "Grand total", "data_type": "float"}
            ]
          }
        }
      ],
      "edges": [{"source": "parse_1", "target": "extract_1"}]
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.anyformat.ai/v2/workflows/",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={
          "name": "Invoice extractor",
          "nodes": [
              {"id": "parse_1", "type": "parse"},
              {
                  "id": "extract_1",
                  "type": "extract",
                  "extraction_schema": {
                      "fields": [
                          {"name": "invoice_number", "description": "Invoice ID", "data_type": "string"},
                          {"name": "total", "description": "Grand total", "data_type": "float"},
                      ]
                  },
              },
          ],
          "edges": [{"source": "parse_1", "target": "extract_1"}],
      },
  )
  workflow_id = response.json()["id"]
  ```
</CodeGroup>

### Parse-only with agentic mode

A workflow with just one `parse` node and no edges. Produces markdown only — no extraction.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST 'https://api.anyformat.ai/v2/workflows/' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -d '{
      "name": "Agentic parse-only",
      "nodes": [
        {
          "id": "parse_1",
          "type": "parse",
          "mode": "agentic"
        }
      ],
      "edges": []
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.anyformat.ai/v2/workflows/",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      json={
          "name": "Agentic parse-only",
          "nodes": [
              {
                  "id": "parse_1",
                  "type": "parse",
                  "mode": "agentic",
              }
          ],
          "edges": [],
      },
  )
  workflow_id = response.json()["id"]
  ```
</CodeGroup>

<Note>
  **Agentic mode** routes each block through a typed strategy (text / table / figure) using Gemini for routing. The mode is binary — set `mode: "agentic"` and you get the full agentic pipeline. See the [Agentic Parse to Markdown](/guides/recipes/agentic-parse-to-markdown) recipe for an end-to-end walkthrough.
</Note>

### Classify-then-extract (branched)

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST 'https://api.anyformat.ai/v2/workflows/' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer YOUR_API_KEY' \
    -d '{
      "name": "Multi-doc",
      "nodes": [
        {"id": "parse_1", "type": "parse"},
        {
          "id": "classify_1",
          "type": "classify",
          "categories": [
            {"id": "INVOICE", "name": "Invoice", "description": "Vendor invoice."},
            {"id": "RECEIPT", "name": "Receipt", "description": "POS receipt."}
          ]
        },
        {
          "id": "extract_invoice",
          "type": "extract",
          "extraction_schema": {"fields": [{"name": "vendor", "description": "Vendor name.", "data_type": "string"}]}
        },
        {
          "id": "extract_receipt",
          "type": "extract",
          "extraction_schema": {"fields": [{"name": "merchant", "description": "Merchant name.", "data_type": "string"}]}
        }
      ],
      "edges": [
        {"source": "parse_1", "target": "classify_1"},
        {"source": "classify_1", "target": "extract_invoice", "branch": "INVOICE"},
        {"source": "classify_1", "target": "extract_receipt", "branch": "RECEIPT"}
      ]
    }'
  ```
</CodeGroup>

## Topology Rules

The endpoint enforces graph correctness — if any rule is violated, the request returns `400` and nothing is persisted.

| Rule                           | Message                                                                         |
| ------------------------------ | ------------------------------------------------------------------------------- |
| Exactly one parse node         | `workflow must contain exactly one \`parse\` node\`                             |
| Unique node ids                | `duplicate node ids: [...]`                                                     |
| Edges reference existing nodes | `edge source X not in nodes` / `edge target Y not in nodes`                     |
| Edge predecessor compatibility | `extract does not accept extract as predecessor`                                |
| Branch routing                 | `edge from classify X requires \`branch\` to be set\`                           |
| No fan-out from non-routers    | `node Y (extract) has 3 outgoing edges; only classify and splitter may fan out` |

## Response

`201 Created` returns the workflow resource:

```json theme={null}
{
  "id": "0686bb97-8c30-70f0-8000-97669e000eb8",
  "name": "Invoice extractor",
  "description": "",
  "created_at": "2026-05-11T10:00:00Z",
  "updated_at": "2026-05-11T10:00:00Z"
}
```

Save the `id` — you'll reuse it when uploading documents and fetching results.

## Next Steps

<CardGroup cols={2}>
  <Card title="Agentic Parse to Markdown" icon="wand-magic-sparkles" href="/guides/recipes/agentic-parse-to-markdown">
    End-to-end recipe: create → upload → results, with the new agentic parse mode
  </Card>

  <Card title="Parse-Only Workflow" icon="file-lines" href="/guides/recipes/parse-only-workflow">
    Convert documents to markdown without extraction
  </Card>

  <Card title="Field Types" icon="list" href="/concepts/field-types">
    All supported `data_type` values for extraction fields
  </Card>

  <Card title="Response Formats" icon="reply" href="/api-reference/response-formats">
    The shape of `parse`, `extractions`, `splits`, and `classifications` on the results endpoint
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /v2/workflows/
openapi: 3.1.0
info:
  title: AnyFormat API
  description: >
    Document extraction and workflow automation API.


    AnyFormat 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.


    ## Quick start


    1. **Create a workflow** in the [AnyFormat
    dashboard](https://app.anyformat.ai) and define the fields you want to
    extract.

    2. **Run the workflow** via `POST /v2/workflows/{workflow_id}/run/` with a
    file attached.

    3. **Fetch results** via `GET
    /v2/workflows/{workflow_id}/files/{collection_id}/results/` once processing
    completes.


    ## Authentication


    All endpoints (except `/health/`) require a Bearer token in the
    `Authorization` header:


    ```

    Authorization: Bearer <your-api-key>

    ```


    Get your API key from
    [app.anyformat.ai/settings](https://app.anyformat.ai/settings).


    ## Versioning


    All endpoints use the `/v2/` path prefix. All responses include
    `X-API-Version`.
  version: 2.0.0
servers:
  - url: https://api.anyformat.ai
    description: API server
security: []
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.
paths:
  /v2/workflows/:
    post:
      tags:
        - workflows
      summary: Create workflow
      description: |-
        Create a workflow from a strongly-typed graph (atomic).

        Provide an explicit list of typed `nodes` (parse / classify / splitter /
        extract) and `edges` between them. The full workflow — fields, nodes,
        routing — is created in a single transaction.
      operationId: v2_create_workflow
      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'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    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:
                  $ref: '#/components/schemas/ClassifyNode'
                extract:
                  $ref: '#/components/schemas/ExtractNode'
                parse:
                  $ref: '#/components/schemas/ParseNode'
                splitter:
                  $ref: '#/components/schemas/SplitterNode'
                validate:
                  $ref: '#/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.


        Defined as a thin subclass so the FastAPI-generated OpenAPI components

        entry is named ``WorkflowCreateRequest`` (FastAPI uses the model's

        ``__name__``). Behaviour is fully inherited from

        ``WorkflowDefinition`` in ``anyformat.workflow``.
    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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    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
    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
    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
            - max
          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:
                  $ref: '#/components/schemas/BooleanField'
                date:
                  $ref: '#/components/schemas/DateField'
                datetime:
                  $ref: '#/components/schemas/DatetimeField'
                enum:
                  $ref: '#/components/schemas/EnumField'
                float:
                  $ref: '#/components/schemas/FloatField'
                integer:
                  $ref: '#/components/schemas/IntegerField'
                multi_select:
                  $ref: '#/components/schemas/MultiSelectField'
                object:
                  $ref: '#/components/schemas/ObjectField'
                string:
                  $ref: '#/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
        row_extractor_enabled:
          type: boolean
          title: Row Extractor Enabled
          default: false
        page_sum_verification_enabled:
          type: boolean
          title: Page Sum Verification Enabled
          default: false
        context_tracker:
          type: string
          title: Context Tracker
          default: recalvi
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - extraction_schema
      title: ExtractNode
    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
    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

        used for routing out of ``classify`` (category id) or ``splitter`` (rule
        id) nodes.
    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
    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
    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
    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:
                  $ref: '#/components/schemas/BooleanField'
                date:
                  $ref: '#/components/schemas/DateField'
                datetime:
                  $ref: '#/components/schemas/DatetimeField'
                enum:
                  $ref: '#/components/schemas/EnumField'
                float:
                  $ref: '#/components/schemas/FloatField'
                integer:
                  $ref: '#/components/schemas/IntegerField'
                multi_select:
                  $ref: '#/components/schemas/MultiSelectField'
                object:
                  $ref: '#/components/schemas/ObjectField'
                string:
                  $ref: '#/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
        object (not a bare ``list[AnyField]``) so metadata can be added later
        (versioning, derived flags, output-shape hints) without another
        wire-format break.

        Every extraction schema must declare at least one field. The backend
        executor populates this list from ``FieldWorkflowVersion`` rows
        *before* constructing the typed ExtractNode; extract nodes without
        any assigned fields are skipped at the executor layer rather than
        sent to the worker with an empty schema.
    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.

        The backend reads ``filename`` + ``content`` (base64-encoded bytes),
        uploads the file to S3 during workflow create, and stores the resulting
        URI in ``ExtractNode.lookup_files``. This field is stripped from the
        persisted ``GraphNode.config`` — it is create-input only.
    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
    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
    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
    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
    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
    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
    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:
                  $ref: '#/components/schemas/BooleanField'
                date:
                  $ref: '#/components/schemas/DateField'
                datetime:
                  $ref: '#/components/schemas/DatetimeField'
                enum:
                  $ref: '#/components/schemas/EnumField'
                float:
                  $ref: '#/components/schemas/FloatField'
                integer:
                  $ref: '#/components/schemas/IntegerField'
                multi_select:
                  $ref: '#/components/schemas/MultiSelectField'
                object:
                  $ref: '#/components/schemas/ObjectField'
                string:
                  $ref: '#/components/schemas/StringField'
          type: array
          minItems: 1
          title: Nested Fields
      additionalProperties: false
      type: object
      required:
        - name
        - description
        - data_type
        - nested_fields
      title: ObjectField
    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
    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
  securitySchemes:
    ApiKeyAuth:
      type: http
      description: >-
        API key issued from app.anyformat.ai/settings. Send as `Authorization:
        Bearer <key>`.
      scheme: bearer

````