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

# create_folder

> Create a new folder for organizing documents

<Tabs>
  <Tab title="Sync">
    ```python theme={null}
    def create_folder(
        name: str,
        description: Optional[str] = None,
        full_path: Optional[str] = None,
        parent_id: Optional[str] = None,
    ) -> Folder
    ```
  </Tab>

  <Tab title="Async">
    ```python theme={null}
    async def create_folder(
        name: str,
        description: Optional[str] = None,
        full_path: Optional[str] = None,
        parent_id: Optional[str] = None,
    ) -> Folder
    ```
  </Tab>
</Tabs>

## Parameters

* `name` (str): Folder name (leaf segment when using nested paths). If `full_path` is omitted, this becomes the canonical path.
* `description` (str, optional): Optional description of the folder.
* `full_path` (str, optional): Canonical folder path (e.g., `"/projects/alpha/specs"`). Leading slash is optional; parents are created automatically.
* `parent_id` (str, optional): Explicit parent folder ID. Usually not needed—`full_path` handles hierarchy creation.

## Returns

* `Folder`: Newly created folder object.

## Examples

<Tabs>
  <Tab title="Sync">
    ```python theme={null}
    from morphik import Morphik

    db = Morphik()
    folder = db.create_folder("marketing_docs", description="All marketing collateral")

    # Create a nested folder (parents auto-created)
    nested = db.create_folder(
        name="specs",
        full_path="/projects/alpha/specs",
        description="All project specs",
    )
    print(nested.full_path)  # "/projects/alpha/specs"
    ```
  </Tab>

  <Tab title="Async">
    ```python theme={null}
    from morphik import AsyncMorphik

    async with AsyncMorphik() as db:
        folder = await db.create_folder("marketing_docs", description="All marketing collateral")

        nested = await db.create_folder(
            name="specs",
            full_path="/projects/alpha/specs",
            description="All project specs",
        )
        print(nested.full_path)  # "/projects/alpha/specs"
    ```
  </Tab>
</Tabs>
