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

# Create Schema Endpoint



## OpenAPI

````yaml post /v1/extraction-schemas
openapi: 3.1.0
info:
  description: Async-first document extraction API.
  title: Folio API
  version: 1.0.0
servers:
  - description: Production (forthcoming)
    url: https://api.glialhealth.com
security: []
paths:
  /v1/extraction-schemas:
    post:
      tags:
        - extraction-schemas
      summary: Create Schema Endpoint
      operationId: create_schema_endpoint_v1_extraction_schemas_post
      parameters:
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExtractionSchemaCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractionSchemaResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - bearerAuth: []
components:
  schemas:
    ExtractionSchemaCreateRequest:
      description: Inline CustomSchema body plus an optional human-facing name.
      properties:
        document_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Type
        fields:
          items:
            $ref: '#/components/schemas/CustomFieldSpec'
          maxItems: 50
          minItems: 1
          title: Fields
          type: array
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        tables:
          items:
            $ref: '#/components/schemas/CustomTableSpec'
          maxItems: 10
          title: Tables
          type: array
      required:
        - fields
      title: ExtractionSchemaCreateRequest
      type: object
    ExtractionSchemaResponse:
      properties:
        created_at:
          format: date-time
          title: Created At
          type: string
        document_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Type
        fields:
          items:
            $ref: '#/components/schemas/CustomFieldSpec'
          title: Fields
          type: array
        id:
          title: Id
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        object:
          default: extraction_schema
          title: Object
          type: string
        tables:
          items:
            $ref: '#/components/schemas/CustomTableSpec'
          title: Tables
          type: array
      required:
        - id
        - name
        - document_type
        - fields
        - tables
        - created_at
      title: ExtractionSchemaResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CustomFieldSpec:
      properties:
        hint:
          anyOf:
            - type: string
            - type: 'null'
          title: Hint
        key:
          title: Key
          type: string
        pattern:
          anyOf:
            - type: string
            - type: 'null'
          title: Pattern
        required:
          default: false
          title: Required
          type: boolean
        type:
          default: string
          enum:
            - string
            - number
            - date
            - boolean
          title: Type
          type: string
      required:
        - key
      title: CustomFieldSpec
      type: object
    CustomTableSpec:
      properties:
        columns:
          items:
            type: string
          maxItems: 20
          minItems: 1
          title: Columns
          type: array
        key:
          title: Key
          type: string
      required:
        - key
        - columns
      title: CustomTableSpec
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Your Folio API key, sent as `Authorization: Bearer <api_key>`.'
      scheme: bearer
      type: http

````