Skip to main content
def create_folder(
    name: str,
    description: Optional[str] = None,
    full_path: Optional[str] = None,
    parent_id: Optional[str] = None,
) -> Folder

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

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"