> ## Documentation Index
> Fetch the complete documentation index at: https://morphik.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# add_document_to_folder

> Add an existing document to a folder

> [tab] Sync
>
> ```python theme={null}
> def add_document_to_folder(
>     folder_id_or_name: str,
>     document_id: str,
> ) -> Dict[str, str]
> ```

> [tab] Async
>
> ```python theme={null}
> async def add_document_to_folder(
>     folder_id_or_name: str,
>     document_id: str,
> ) -> Dict[str, str]
> ```

## Parameters

* `folder_id_or_name` (str): Folder identifier. Accepts the folder's UUID, name, or canonical path (e.g., `/projects/alpha/specs`; leading slash optional).
* `document_id` (str): Identifier of the document to move into the folder.

## Returns

* `Dict[str, str]`: Dictionary with `status` and `message` describing the result.

## Examples

> [tab] Sync
>
> ```python theme={null}
> from morphik import Morphik
>
> db = Morphik()
> folder = db.get_folder("marketing_docs")
>
> db.add_document_to_folder(folder.id, "doc_123")
> db.add_document_to_folder("/projects/alpha/specs", "doc_456")
> ```

> [tab] Async
>
> ```python theme={null}
> from morphik import AsyncMorphik
>
> async with AsyncMorphik() as db:
>     folder = await db.get_folder("marketing_docs")
>
>     await db.add_document_to_folder(folder.id, "doc_123")
>     await db.add_document_to_folder("/projects/alpha/specs", "doc_456")
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.