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

# Classify raw email

> Classify a raw email file (.eml) to determine if it contains a purchase order.



## OpenAPI

````yaml POST /order/raw/classify
openapi: 3.1.0
info:
  title: DocOpsAI API
  version: 0.1.0
  description: >
    AI-based order processing application that extracts information from email
    attachments and forwards to backend systems. Provides endpoints for order
    management, customer and product CRUD, email watching, and template
    parameter configuration.
  contact:
    name: DevOps Company
servers:
  - url: https://start.aiotic.ai
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: healthcheck
    description: Service health monitoring
  - name: order
    description: Order document upload and processing
  - name: order_status
    description: Order processing status tracking
  - name: customer
    description: Customer record management with vector search
  - name: product
    description: Product record management
  - name: template_parameters
    description: Prompt template parameter management
  - name: email-watcher
    description: Email inbox monitoring and processing
paths:
  /order/raw/classify:
    post:
      tags:
        - order
      summary: Classify raw email
      description: >-
        Classify a raw email file (.eml) to determine if it contains a purchase
        order.
      operationId: classifyRawEmail
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: Email file in .eml format
      responses:
        '200':
          description: Email classified successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailClassificationResponse'
        '400':
          description: Invalid file format (not .eml)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Classification failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    EmailClassificationResponse:
      type: object
      required:
        - category
      properties:
        category:
          type: string
          enum:
            - purchase_order
            - order_confirmation
            - invoice
            - delivery_note
            - quotation
            - receipt
            - credit_note
            - unknown
          description: The classified category of the email
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Error message describing what went wrong
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        API key for authentication. Required on all endpoints except
        /healthcheck. Customer and product endpoints also accept a
        customer-specific API key.

````