---
title: "Search Documents By Name"
method: POST
path: "/search/documents"
---

# Search Documents By Name

`POST /search/documents`

Search documents by filename using full-text search.

`request.filters` accepts the same operator set as `/retrieve/chunks`: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`,
`$lte`, `$in`, `$nin`, `$exists`, `$type`, `$regex` (with optional `i` flag), `$contains`, and the logical
operators `$and`, `$or`, `$nor`, `$not`. Comparison clauses honor typed metadata (`number`, `decimal`,
`datetime`, `date`).

## Headers

- `authorization` string, nullable

## Request body

- SearchDocumentsRequest — Request model for searching documents by name
  - `query` string, required — Search query for document names/filenames
  - `limit` integer — Number of documents to return
  - `filters` object, nullable — Optional metadata filters for documents
  - `folder_name` union — Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list of paths.
    - string
    - string[]
  - `folder_depth` integer, nullable — Folder scope depth: 0/None exact, -1 all descendants, n>0 include descendants up to n levels.
  - `end_user_id` string, nullable — Optional end-user scope for the search

## Response `200`

Successful Response

- Document[]
  - `external_id` string
  - `content_type` string, required
  - `filename` string, nullable
  - `metadata` object
  - `metadata_types` object
  - `storage_info` object
  - `system_metadata` object
  - `additional_metadata` object
  - `chunk_ids` string[]
  - `summary_storage_key` string, nullable
  - `summary_version` integer, nullable
  - `summary_bucket` string, nullable
  - `summary_updated_at` string, nullable
  - `folder_name` string, nullable
  - `end_user_id` string, nullable
  - `app_id` string, nullable
  - `folder_path` string, nullable
  - `folder_id` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/morphik-org/apis/fastapi.md) · [All operations](https://skmtc.net/morphik-org/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/morphik-org/fastapi/versions/2d9291c3821d/schema)
