---
title: "Search Files By Content"
method: GET
path: "/api/files/search/content"
tags: ["files", "files"]
---

# Search Files By Content

`GET /api/files/search/content`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/files/search/content`
- Auth: none declared

Semantic search over file *contents* (not filenames).

Embeds the query, vector-searches the workspace's RAG chunks via the RAG
orchestrator, then collapses chunk hits down to their source files —
keeping the best score + snippet per file — and returns full file records
ranked by relevance. This is the content-search counterpart to the
filename ILIKE search in `list_files`.

Degrades gracefully: a RAG outage yields an empty result set, never a 500.

## Query parameters

- `query` string, required: Semantic content query
- `threshold` number: Min similarity score
- `limit` integer: Max distinct files to return
- `file_type` string, nullable: Restrict to a type bucket: presentation | document | image

## Response `200`

Successful Response

- FileContentSearchResponse: Result wrapper for semantic file-content search.
  - `results` FileContentMatch[], required
    - `id` integer, required
    - `title` string, nullable
    - `description` string, nullable
    - `status` string, required
    - `ingest_type` string, required
    - `latest_version` integer, required
    - `mime_type` string, nullable
    - `byte_size` integer, nullable
    - `original_filename` string, nullable
    - `thread_id` integer, nullable
    - `source_url` string, nullable
    - `metadata` object
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `versions` FileVersionResponse[]
      - `id` integer, required
      - `file_id` integer, required
      - `version_number` integer, required
      - `storage_bucket` string, required
      - `storage_key` string, required
      - `mime_type` string, nullable
      - `byte_size` integer, nullable
      - `checksum_sha256` string, nullable
      - `created_at` string, date-time, required
      - `download_url` string, nullable
      - `thumbnail_url` string, nullable
    - `thumbnail_url` string, nullable
    - `chunk_count` integer: Number of RAG chunks for this file
    - `relevance` number: Best chunk similarity score 0.0-1.0
    - `snippet` string, nullable: Best matching text excerpt
  - `total` integer: Number of distinct files matched

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/77bef09a9209?raw)
