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

# Create Schema

> Creates a new parsing schema.
Each user can have multiple active schemas.
Schema names must be unique per user (for active schemas).




## OpenAPI

````yaml POST /api/v1/schemas
openapi: 3.0.0
info:
  title: Invaro Document Processing API
  description: API for processing bank statements and invoices using OCR and AI
  version: 1.0.0
  contact:
    name: Invaro Support
    email: support@invaro.ai
    url: https://docs.invaro.ai
servers:
  - url: https://api.invaro.ai/api/v1
    description: Production API
security:
  - bearerAuth: []
paths:
  /api/v1/schemas:
    post:
      tags:
        - Schema Management
      summary: Create Schema
      description: |-
        Creates a new parsing schema.
        Each user can have multiple active schemas.
        Schema names must be unique per user (for active schemas).
      operationId: createSchema
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - type
                - schema_string
              properties:
                name:
                  type: string
                  description: Name for the schema (unique per user)
                  example: invoice_schema_v1
                type:
                  type: string
                  description: Type of document the schema is for
                  enum:
                    - invoice
                    - bank_statement
                  example: invoice
                description:
                  type: string
                  description: Optional description for the schema
                  example: Schema for parsing standard invoices
                schema_string:
                  type: object
                  description: The schema definition itself
                  properties:
                    fields:
                      type: array
                      items:
                        type: string
                      example:
                        - invoice_number
                        - date
                        - total
      responses:
        '200':
          description: Schema created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/SchemaObject'
components:
  schemas:
    SchemaObject:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: b3376c85-86e0-476e-aee9-5f05afaa05ea
        user_id:
          type: string
          format: uuid
          example: b4825725-605b-4374-a64e-c40896b5a0e8
        name:
          type: string
          example: invoice_schema_v1
        type:
          type: string
          enum:
            - invoice
            - bank_statement
          example: invoice
        description:
          type: string
          example: Schema for parsing standard invoices
        schema_string:
          type: string
          description: JSON string representation of the schema fields
          example: '{"fields": [...]} Gzip Base64 format'
        version:
          type: integer
          example: 1
        is_active:
          type: boolean
          example: true
        created_at:
          type: string
          format: date-time
          example: '2024-01-18T12:34:56Z'
        updated_at:
          type: string
          format: date-time
          example: '2024-01-18T12:34:56Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````