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

# Batch Classify

> Classify multiple messages in a single request. Maximum 100 messages per request.



## OpenAPI

````yaml opic-api.json post /intent-classify/batch
openapi: 3.0.3
info:
  title: OPIC (Operations Intent Classifier) API
  description: >-
    Multi-class intent classification for ecommerce customer messages. Analyze
    incoming customer messages and conversations to predict the underlying
    intent for customer support pipelines, chatbots, and operational routing
    systems.
  version: 1.0.0
  contact:
    email: support@usehandled.io
servers:
  - url: https://api.usehandled.io/api/v1/ipaas/inference
    description: Production
security:
  - bearerAuth: []
paths:
  /intent-classify/batch:
    post:
      tags:
        - Intent Classification
      summary: Batch Classify
      description: >-
        Classify multiple messages in a single request. Maximum 100 messages per
        request.
      operationId: batchClassifyIntent
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchClassifyRequest'
            example:
              messages:
                - id: msg_001
                  message: Where is my order?
                - id: msg_002
                  message: 'I want a refund for order #4521'
                - id: msg_003
                  message: Do you have this in blue?
              top_k: 1
      responses:
        '200':
          description: Successful batch classification
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchClassifyResponse'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    BatchClassifyRequest:
      type: object
      required:
        - messages
      properties:
        messages:
          type: array
          description: List of message objects (max 100 per request)
          maxItems: 100
          items:
            type: object
            required:
              - id
              - message
            properties:
              id:
                type: string
                description: Unique identifier for the message
              message:
                type: string
                description: The message text to classify
                maxLength: 2048
        top_k:
          type: integer
          description: Number of top intents per message
          default: 1
          minimum: 1
          maximum: 5
    BatchClassifyResponse:
      type: object
      properties:
        request_id:
          type: string
          description: Unique identifier for the batch request
        results:
          type: array
          description: Classification results for each message
          items:
            type: object
            properties:
              id:
                type: string
                description: The message ID from the request
              top_intent:
                type: string
                description: The highest-confidence intent
              confidence:
                type: number
                description: Confidence score for the top intent
        latency_ms:
          type: integer
          description: Server-side inference time in milliseconds
        model_version:
          type: string
          description: Version of the model used
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error code
        message:
          type: string
          description: Human-readable error message
        request_id:
          type: string
          description: Request identifier for debugging
  responses:
    InvalidRequest:
      description: Malformed request body or missing required fields
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: INVALID_REQUEST
            message: 'Missing required field: message'
            request_id: req_err_001
    Unauthorized:
      description: Missing or invalid API token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: UNAUTHORIZED
            message: Invalid or expired API token
            request_id: req_err_002
    PayloadTooLarge:
      description: Batch request exceeds 100 messages
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Too many requests - check rate limits
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Unexpected server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token from your Handled dashboard

````