---
title: "Get Document By Filename"
method: GET
path: "/documents/filename/{filename}"
tags: ["Documents"]
---

# Get Document By Filename

`GET /documents/filename/{filename}`

Get document by filename.

Args:
    filename: Filename of the document to retrieve
    auth: Authentication context
    folder_name: Optional folder to scope the operation to
    end_user_id: Optional end-user ID to scope the operation to

Returns:
    Document: Document metadata if found and accessible

## Path parameters

- `filename` string, required

## Query parameters

- `folder_name` union
  - string
  - string[]
- `end_user_id` string, nullable

## Headers

- `authorization` string

## Response `200`

Successful Response

- Document — Represents a document stored in the database documents collection
  - `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

---

[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)
