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

# Asynchronous Parse

> Queue one or more documents for parsing. Accepts a single input string or a list of up to 50 inputs for batch processing.

Single input returns a `V2Response` with `record_id` for status polling. List input returns a `BatchResponse` with per-item status.

> **Tip:** You can save and reuse parse settings by creating a config via [Create Config](/docs/api-reference-v2/configuration-management/create-config). Pass the returned `config_id` instead of repeating `parse_config` each time.



## OpenAPI

````yaml /openapi-extraction-v2.json post /api/v2/parse/async
openapi: 3.1.0
info:
  title: Nanonets V2 API
  description: >-
    Stateful document processing API with file management, reusable configs, and
    JSON-body endpoints for parse, extract, and classify operations.


    **Key differences from V1:**

    - JSON request bodies instead of multipart/form-data

    - Upload files once via `POST /files`, then reference them with
    `file://<uuid>` URIs

    - Save and reuse processing configurations via `config://<uuid>` URIs

    - Batch processing via list inputs on async endpoints (up to 50 items)

    - Document classification with `document` and `split` modes
  version: 2.0.0
  contact:
    name: Nanonets Support
    email: info@nanonets.com
servers:
  - url: https://extraction-api.nanonets.com
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v2/parse/async:
    post:
      tags:
        - Document Parsing
      summary: Asynchronous Parse
      description: >-
        Queue one or more documents for parsing. Accepts a single input string
        or a list of up to 50 inputs for batch processing.


        Single input returns a `V2Response` with `record_id` for status polling.
        List input returns a `BatchResponse` with per-item status.


        > **Tip:** You can save and reuse parse settings by creating a config
        via [Create
        Config](/docs/api-reference-v2/configuration-management/create-config).
        Pass the returned `config_id` instead of repeating `parse_config` each
        time.
      operationId: v2_parse_async
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ParseRequest'
            examples:
              single:
                summary: Single document
                value:
                  input: file://a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  parse_config:
                    output_format: markdown
              batch:
                summary: Batch (up to 50)
                value:
                  input:
                    - file://a1b2c3d4-e5f6-7890-abcd-ef1234567890
                    - https://example.com/doc2.pdf
                  config_id: config://b2c3d4e5-f6a7-8901-bcde-f12345678901
      responses:
        '202':
          description: Job(s) queued
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/V2Response'
                  - $ref: '#/components/schemas/BatchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    ParseRequest:
      type: object
      required:
        - input
      properties:
        input:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
              maxItems: 50
          description: '`file://<uuid>` URI or public URL. Async accepts a list (max 50).'
        config_id:
          type: string
          description: '`config://<uuid>` of a saved parse config'
        parse_config:
          $ref: '#/components/schemas/ParseConfig'
    V2Response:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
        message:
          type: string
        record_id:
          type: string
          description: Job ID for retrieving results
        file_id:
          type: string
          description: '`file://<uuid>` reference'
        config_id:
          type: string
          description: '`config://<uuid>` reference'
        status:
          type: string
          enum:
            - completed
            - processing
            - failed
        result:
          $ref: '#/components/schemas/V2Result'
        processing_time:
          type: number
          description: Time in seconds
        filename:
          type: string
        output_format:
          type: string
        file_size:
          type: integer
          description: Size in bytes
    BatchResponse:
      type: object
      required:
        - success
        - message
        - total
        - items
      properties:
        success:
          type: boolean
        message:
          type: string
        batch_id:
          type: string
          format: uuid
        total:
          type: integer
        items:
          type: array
          items:
            $ref: '#/components/schemas/BatchItemStatus'
    ParseConfig:
      type: object
      properties:
        output_format:
          type: string
          enum:
            - markdown
            - html
          default: markdown
          description: Output format
        custom_instructions:
          type: string
          maxLength: 8000
          description: Custom parsing instructions
        prompt_mode:
          type: string
          enum:
            - append
            - replace
          default: append
          description: >-
            `append`: add to base prompt, `replace`: use only custom
            instructions
        markdown_options:
          type: string
          description: Markdown-specific options (e.g. `financial-docs`)
        include_metadata:
          type: string
          description: 'Comma-separated: `confidence_score`, `bounding_boxes`'
    V2Result:
      type: object
      properties:
        content:
          oneOf:
            - type: string
            - type: object
            - type: array
          description: Extracted or parsed content
        elements:
          type: array
          items:
            type: object
          description: >-
            Element-wise breakup with bounding boxes (parse only, when metadata
            requested)
        overall_confidence:
          type: integer
          minimum: 0
          maximum: 100
          description: Document-level confidence score
        page_confidence:
          type: object
          additionalProperties:
            type: integer
          description: Per-page confidence scores
        confidence_source:
          type: string
          description: Source of confidence scores
    BatchItemStatus:
      type: object
      required:
        - input
        - status
      properties:
        input:
          type: string
        record_id:
          type: string
        file_id:
          type: string
        status:
          type: string
          enum:
            - queued
            - completed
            - failed
        error:
          type: string
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    ValidationError:
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
        msg:
          type: string
        type:
          type: string
  responses:
    BadRequest:
      description: Invalid input
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key as Bearer token: `Authorization: Bearer YOUR_API_KEY`'

````