> ## 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.

# Search vault documents

> Search across vault documents using multiple methods including hybrid vector + graph search, GraphRAG global search, entity-based search, and fast similarity search. Returns relevant documents and contextual answers based on the search method.



## OpenAPI

````yaml /openapi.json post /vault/{id}/search
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:
  /vault/{id}/search:
    post:
      tags:
        - Vaults
      summary: Search vault documents
      description: >-
        Search across vault documents using multiple methods including hybrid
        vector + graph search, GraphRAG global search, entity-based search, and
        fast similarity search. Returns relevant documents and contextual
        answers based on the search method.
      operationId: searchVault
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Unique identifier of the vault to search
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - query
              properties:
                query:
                  type: string
                  description: Search query or question to find relevant documents
                method:
                  type: string
                  enum:
                    - vector
                    - graph
                    - hybrid
                    - global
                    - local
                    - fast
                    - entity
                  default: hybrid
                  description: >-
                    Search method: 'global' for comprehensive questions,
                    'entity' for specific entities, 'fast' for quick similarity
                    search, 'hybrid' for combined approach
                topK:
                  type: integer
                  default: 10
                  minimum: 1
                  maximum: 100
                  description: >-
                    Maximum number of results to return. Hybrid search supports
                    1 to 50; other methods may support up to 100.
                filters:
                  type: object
                  description: Filters to narrow search results to specific documents
                  properties:
                    object_id:
                      oneOf:
                        - type: string
                        - type: array
                          items:
                            type: string
                      description: >-
                        Filter to specific document(s) by object ID. Accepts a
                        single ID or array of IDs.
                  additionalProperties: true
      responses:
        '200':
          description: Search results with relevant documents and contextual answers
          content:
            application/json:
              schema:
                type: object
                properties:
                  method:
                    type: string
                    description: Search method used
                  query:
                    type: string
                    description: Original search query
                  response:
                    type: string
                    description: >-
                      AI-generated answer based on search results (for
                      global/entity methods)
                  sources:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        filename:
                          type: string
                        pageCount:
                          type: integer
                        textLength:
                          type: integer
                        chunkCount:
                          type: integer
                        createdAt:
                          type: string
                          format: date-time
                        ingestionCompletedAt:
                          type: string
                          format: date-time
                  chunks:
                    type: array
                    description: >-
                      Relevant text chunks with similarity scores and page
                      locations
                    items:
                      type: object
                      properties:
                        text:
                          type: string
                          description: Preview of the chunk text (up to 500 characters)
                        object_id:
                          type: string
                          description: ID of the source document
                        chunk_index:
                          type: integer
                          description: Index of the chunk within the document (0-based)
                        page_start:
                          type: integer
                          nullable: true
                          description: >-
                            PDF page number where the chunk begins (1-indexed).
                            Null for non-PDF documents or documents ingested
                            before page tracking was added.
                        page_end:
                          type: integer
                          nullable: true
                          description: >-
                            PDF page number where the chunk ends (1-indexed).
                            Null for non-PDF documents or documents ingested
                            before page tracking was added.
                        word_start_index:
                          type: integer
                          nullable: true
                          description: >-
                            Starting word index (0-based) in the OCR word list.
                            Use with GET /vault/:id/objects/:objectId/ocr-words
                            to retrieve bounding boxes for highlighting.
                        word_end_index:
                          type: integer
                          nullable: true
                          description: >-
                            Ending word index (0-based) in the OCR word list.
                            Use with GET /vault/:id/objects/:objectId/ocr-words
                            to retrieve bounding boxes for highlighting.
                        start_ms:
                          type: integer
                          description: >-
                            Source media timestamp for the first word in the
                            chunk. Present only for media-backed transcripts
                            with real word timing.
                        end_ms:
                          type: integer
                          description: >-
                            Source media timestamp for the last word in the
                            chunk. Present only for media-backed transcripts
                            with real word timing.
                        distance:
                          type: number
                          description: Vector similarity distance (lower is more similar)
                        score:
                          type: number
                          description: >-
                            Relevance score (deprecated, use distance or
                            hybridScore)
                        source:
                          type: string
                          description: Source identifier (deprecated, use object_id)
                  vault_id:
                    type: string
                    description: ID of the searched vault
        '400':
          description: Invalid request - missing vault ID or query
        '401':
          description: Invalid API key
        '404':
          description: Vault not found or access denied
        '500':
          description: Search service error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key starting with `sk_case_`

````