---
title: "Search vault documents"
method: POST
path: "/vault/{id}/search"
tags: ["Vaults"]
---

# Search vault documents

`POST /vault/{id}/search`

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.

## Path parameters

- `id` string, required

## Request body

- object
  - `query` string, required — Search query or question to find relevant documents
  - `method` 'vector' | 'graph' | 'hybrid' | 'global' | 'local' | 'fast' | 'entity' — Search method: 'global' for comprehensive questions, 'entity' for specific entities, 'fast' for quick similarity search, 'hybrid' for combined approach
  - `topK` integer — Maximum number of results to return
  - `filters` object — Filters to narrow search results to specific documents
    - `object_id` union — Filter to specific document(s) by object ID. Accepts a single ID or array of IDs.
      - string
      - string[]

## Response `200`

Search results with relevant documents and contextual answers

- object
  - `method` string — Search method used
  - `query` string — Original search query
  - `response` string — AI-generated answer based on search results (for global/entity methods)
  - `sources` object[]
    - `id` string
    - `filename` string
    - `pageCount` integer
    - `textLength` integer
    - `chunkCount` integer
    - `createdAt` string, date-time
    - `ingestionCompletedAt` string, date-time
  - `chunks` object[] — Relevant text chunks with similarity scores and page locations
    - `text` string — Preview of the chunk text (up to 500 characters)
    - `object_id` string — ID of the source document
    - `chunk_index` integer — Index of the chunk within the document (0-based)
    - `page_start` integer, nullable — PDF page number where the chunk begins (1-indexed). Null for non-PDF documents or documents ingested before page tracking was added.
    - `page_end` integer, nullable — 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` integer, nullable — 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` integer, nullable — 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.
    - `distance` number — Vector similarity distance (lower is more similar)
    - `score` number — Relevance score (deprecated, use distance or hybridScore)
    - `source` string — Source identifier (deprecated, use object_id)
  - `vault_id` string — ID of the searched vault

## Other responses

- `400` — Invalid request - missing vault ID or query
- `401` — Invalid API key
- `404` — Vault not found or access denied
- `500` — Search service error

---

[API](https://skmtc.net/casemark/apis/case-dev-api.md) · [All operations](https://skmtc.net/casemark/apis/case-dev-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/casemark/case-dev-api/versions/5b7e64e6d6f9/schema)
