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

Args:
    request: SearchDocumentsRequest containing:
        - query: Search query for document names/filenames
        - limit: Number of documents to return (1-100)
        - filters: Optional metadata filters for documents
        - folder_name: Optional folder to scope search
        - end_user_id: Optional end-user ID to scope search
    auth: Authentication context

`request.filters` accepts the same operator set as `/retrieve/chunks`, including `$regex` (with optional `i`
flag) and `$contains` for substring matches.

Returns:
    List[Document]: List of matching documents ordered by relevance

## Headers

- `authorization` string

## 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 for the search. Accepts a single folder name or a list of folder names.
    - string
    - string[]
  - `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
  - `storage_info` object
  - `storage_files` StorageFileInfo[]
    - `bucket` string, required
    - `key` string, required
    - `version` integer
    - `filename` string, nullable
    - `content_type` string, nullable
    - `timestamp` string, date-time
  - `system_metadata` object
  - `additional_metadata` object
  - `chunk_ids` string[]
  - `folder_name` string, nullable
  - `end_user_id` string, nullable
  - `app_id` string, nullable

## Other responses

- `422` — Validation Error

## Changes

- **2025-11-05** `9ade02dd7b1d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/morphik-org/apis/fastapi/changes/search/documents/post.md)

---

[API](https://skmtc.dev/morphik-org/apis/fastapi.md) · [All operations](https://skmtc.dev/morphik-org/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/morphik-org/fastapi/revisions/9ade02dd7b1d/schema)
