> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vern.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Extract structured data from a document

> Upload an unstructured file (PDF, Word document, or spreadsheet) and extract it against one or more of your templates. Reducto parses the file, an LLM designs a per-section extraction schema from the templates you name, and the extracted rows come back shaped like those templates.

The whole chain takes 30 seconds to several minutes, so this returns `202` immediately with an `extraction_id`. Poll `GET /extractions/{extraction_id}` until `status` is no longer `processing`.

This endpoint is **stateless**: nothing is written into your workbooks or sheets. The extracted rows are retained for 24 hours and then deleted. Capture them yourself if you need them longer.



## OpenAPI

````yaml /api-reference/openapi.json post /extractions
openapi: 3.1.0
info:
  title: Vern Migration API
  version: 1.0.0
  description: >-
    Run Vern as a headless migration engine. Create a migration, upload a
    customer's files, run the managed agent to generate a preview, then execute
    and export clean data. See the Migration API guides for concepts and
    walkthroughs.
servers:
  - url: https://app.vern.so/api/v1
security:
  - apiKey: []
tags:
  - name: Catalog
    description: Discover the sources and templates you set up in the Vern UI.
  - name: Migrations
    description: Create a migration workspace and upload a customer's files.
  - name: Runs
    description: 'Drive the managed agent: generate, refine, execute, answer, and observe.'
  - name: Export
    description: Download a migration's validated data as CSV.
  - name: Log
    description: The settled record of what a migration did.
  - name: Knowledge
    description: Durable context the agent reads before every run.
  - name: Exports
    description: Download imported data.
  - name: Extractions
    description: >-
      Turn an unstructured file into structured data, without running a
      migration.
paths:
  /extractions:
    post:
      tags:
        - Extractions
      summary: Extract structured data from a document
      description: >-
        Upload an unstructured file (PDF, Word document, or spreadsheet) and
        extract it against one or more of your templates. Reducto parses the
        file, an LLM designs a per-section extraction schema from the templates
        you name, and the extracted rows come back shaped like those templates.


        The whole chain takes 30 seconds to several minutes, so this returns
        `202` immediately with an `extraction_id`. Poll `GET
        /extractions/{extraction_id}` until `status` is no longer `processing`.


        This endpoint is **stateless**: nothing is written into your workbooks
        or sheets. The extracted rows are retained for 24 hours and then
        deleted. Capture them yourself if you need them longer.
      operationId: createExtraction
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    The document to extract. Max 100 MB. Supported: pdf, docx,
                    xlsx, xlsm, xls, xltx, xltm, csv.
                templates:
                  type: array
                  items:
                    type: string
                  description: >-
                    Template slugs to extract against, as returned by `GET
                    /templates`. Repeat the field or pass one comma-separated
                    value. Omit to use every active template.
                  example:
                    - lots
                    - owners
                instruction:
                  type: string
                  description: >-
                    Optional free-text guidance for the extraction, e.g. "only
                    the first schedule".
      responses:
        '202':
          description: Accepted. Poll the returned id for the result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractionAccepted'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          description: The file exceeds the 100 MB limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '502':
          description: The document could not be submitted to the parsing service.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Extraction is not available for your data region.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ExtractionAccepted:
      type: object
      required:
        - extraction_id
        - status
      properties:
        extraction_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - processing
        file_name:
          type: string
        templates:
          type: array
          items:
            type: string
          description: The template slugs this extraction runs against.
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
          description: After this, the result is deleted and GET returns 410.
    Error:
      type: object
      properties:
        error:
          type: string
          description: A human-readable error message.
      required:
        - error
  responses:
    BadRequest:
      description: Malformed request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: API key missing, malformed, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit hit — back off and retry.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Too many requests
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your Vern API key. Create one at Settings → API keys.

````