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

# Process document with OCR

> Submit a document for OCR processing to extract text, detect tables, forms, and other features. Supports PDFs, images, and scanned documents. Returns a job ID that can be used to track processing status.



## OpenAPI

````yaml /openapi.json post /ocr/v1/process
openapi: 3.1.0
info:
  title: Case.dev API
  description: >-
    The AI-native platform for legal technology. Build smarter legal
    applications with our suite of AI-powered APIs.
  version: 1.0.0
  contact:
    name: Case.dev Support
    email: support@casemark.com
    url: https://case.dev
  license:
    name: Proprietary
    url: https://case.dev/terms
servers:
  - url: https://api.case.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Vaults
    description: Secure document storage with semantic search and GraphRAG
  - name: Memory
    description: >-
      Persistent memory for AI agents with semantic search and 12 generic
      indexed tag fields
  - name: OCR
    description: Extract text from PDFs, images, and scanned documents
  - name: Voice
    description: Audio transcription and text-to-speech
  - name: LLMs
    description: Access 40+ language models through a unified API
  - name: Search
    description: Web search, AI answers, and deep research
  - name: Mail
    description: Managed inboxes for agent email workflows
  - name: Media
    description: Transcript retrieval and captioned media clip generation
  - name: Legal
    description: Legal research tools including citation verification
  - name: Privilege
    description: Privilege detection for e-discovery and litigation workflows
  - name: Compute
    description: Serverless GPU and CPU infrastructure
  - name: Format
    description: Document formatting and template rendering (MD/JSON to PDF/DOCX)
  - name: SuperDoc
    description: Document conversion and template automation
  - name: Webhooks
    description: Webhook endpoint management
  - name: System
    description: Public system metadata and discovery endpoints
  - name: Usage
    description: Usage reporting and webhook subscriptions
  - name: Database
    description: Serverless PostgreSQL databases with instant branching
  - name: Translation
    description: Language detection and translation for multilingual legal workflows
  - name: Skills
    description: Search and read legal AI skills for agents
  - name: Agents
    description: >-
      Create, manage, and execute AI agents with tool access, sandbox
      environments, and async run workflows
  - name: Matters
    description: Matter-native legal workspaces and orchestration primitives
  - name: Applications Projects
    description: Web application project management
  - name: Applications Deployments
    description: Web application deployment management
  - name: Applications Domains
    description: Custom domain configuration for applications
  - name: Applications Env Vars
    description: Environment variable management for applications
paths:
  /ocr/v1/process:
    post:
      tags:
        - OCR
      summary: Process document with OCR
      description: >-
        Submit a document for OCR processing to extract text, detect tables,
        forms, and other features. Supports PDFs, images, and scanned documents.
        Returns a job ID that can be used to track processing status.
      operationId: processOcrDocument
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - document_url
              properties:
                document_url:
                  type: string
                  description: URL or S3 path to the document to process
                  example: https://example.com/contract.pdf
                document_id:
                  type: string
                  description: Optional custom document identifier
                  example: contract-2024-001
                callback_url:
                  type: string
                  description: URL to receive completion webhook
                  example: https://your-app.com/webhooks/ocr-complete
                engine:
                  type: string
                  description: OCR engine to use
                  enum:
                    - doctr
                    - paddleocr
                  default: doctr
                  example: doctr
                features:
                  type: object
                  description: Additional processing options
                  properties:
                    embed:
                      type: object
                      description: Generate searchable PDF with text layer
                      additionalProperties: true
                    tables:
                      type: object
                      description: Extract tables as structured data
                      properties:
                        format:
                          type: string
                          enum:
                            - csv
                            - json
                          description: Output format for extracted tables
                      additionalProperties: true
                    forms:
                      type: object
                      description: Detect and extract form fields
                      additionalProperties: true
                  example:
                    embed: {}
                    tables:
                      format: csv
                result_bucket:
                  type: string
                  description: S3 bucket to store results
                  example: my-ocr-results
                result_prefix:
                  type: string
                  description: S3 key prefix for results
                  example: ocr/2024/
      responses:
        '201':
          description: OCR job created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique job identifier
                  status:
                    type: string
                    description: Current job status
                    enum:
                      - queued
                      - processing
                      - completed
                      - failed
                  document_id:
                    type: string
                    description: Document identifier
                  engine:
                    type: string
                    description: OCR engine used
                  page_count:
                    type: integer
                    description: Number of pages detected
                  created_at:
                    type: string
                    format: date-time
                    description: Job creation timestamp
                  estimated_completion:
                    type: string
                    format: date-time
                    description: Estimated completion time
              example:
                id: ocr_job_67890
                status: queued
                document_id: contract-2024-001
                engine: doctr
                page_count: 15
                created_at: '2024-01-15T10:30:00Z'
                estimated_completion: '2024-01-15T10:45:00Z'
        '400':
          description: Invalid request parameters
        '401':
          description: Invalid API key
        '403':
          description: Insufficient permissions for OCR service
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key starting with `sk_case_`

````