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

# Create Config

> Save a reusable configuration for parse, extract, or classify operations. Returns a `config://<uuid>` URI that can be referenced in subsequent requests.

**Config types:**
- `parse` — output_format, custom_instructions, prompt_mode, markdown_options, include_metadata
- `extract` — output_format, json_options, csv_options, custom_instructions, prompt_mode, include_metadata
- `classify` — categories (list of {name, description}), mode (document or split)



## OpenAPI

````yaml /openapi-extraction-v2.json post /api/v2/configs
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/configs:
    post:
      tags:
        - Configuration Management
      summary: Create Config
      description: >-
        Save a reusable configuration for parse, extract, or classify
        operations. Returns a `config://<uuid>` URI that can be referenced in
        subsequent requests.


        **Config types:**

        - `parse` — output_format, custom_instructions, prompt_mode,
        markdown_options, include_metadata

        - `extract` — output_format, json_options, csv_options,
        custom_instructions, prompt_mode, include_metadata

        - `classify` — categories (list of {name, description}), mode (document
        or split)
      operationId: v2_create_config
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfigCreateRequest'
            examples:
              parse_config:
                summary: Parse config (Markdown)
                value:
                  name: markdown-parser
                  type: parse
                  params:
                    output_format: markdown
                    custom_instructions: Format dates as YYYY-MM-DD
              extract_config:
                summary: Extract config (JSON with fields)
                value:
                  name: invoice-extractor
                  type: extract
                  params:
                    output_format: json
                    json_options:
                      - invoice_number
                      - date
                      - total
                      - vendor
              classify_config:
                summary: Classify config (split mode)
                value:
                  name: document-splitter
                  type: classify
                  params:
                    categories:
                      - name: Invoice
                        description: Bills and invoices
                      - name: Receipt
                        description: Payment receipts
                      - name: Contract
                        description: Legal agreements
                    mode: split
      responses:
        '201':
          description: Config created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfigResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    ConfigCreateRequest:
      type: object
      required:
        - name
        - type
        - params
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: Human-readable config name
        type:
          type: string
          enum:
            - parse
            - extract
            - classify
          description: Config type
        params:
          type: object
          description: Configuration parameters (varies by type)
    ConfigResponse:
      type: object
      required:
        - success
        - config_id
        - name
        - type
        - params
      properties:
        success:
          type: boolean
        config_id:
          type: string
          description: '`config://<uuid>` URI'
          example: config://b2c3d4e5-f6a7-8901-bcde-f12345678901
        name:
          type: string
        type:
          type: string
          enum:
            - parse
            - extract
            - classify
        params:
          type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    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`'

````