You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance documentation for folder management and nested folder support across SDK methods. Update parameters to include folder_name and folder_depth for scoping in various document and graph operations. (#21)
Copy file name to clipboardExpand all lines: python-sdk/batch_get_chunks.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ description: "Retrieve specific chunks by their document ID and chunk number"
29
29
## Parameters
30
30
31
31
-`sources` (List[Union[ChunkSource, Dict[str, Any]]]): List of ChunkSource objects or dictionaries with document_id and chunk_number
32
-
-`folder_name` (str| List[str], optional): Optional folder scope. Accepts a single folder name or a list of folder names.
32
+
-`folder_name` (str| List[str], optional): Optional folder scope. Accepts canonical paths or a list of paths/names.
33
33
-`use_colpali` (bool, optional): Whether to request multimodal chunks when available. Defaults to True.
34
34
-`output_format` (str, optional): Controls how image chunks are returned. Set to `"url"` to receive presigned URLs; omit orset to `"base64"` (default) to receive base64 content.
35
35
@@ -100,4 +100,4 @@ Each `FinalChunkResult` object in the returned list has the following properties
100
100
-`metadata` (Dict[str, Any]): Document metadata
101
101
-`content_type` (str): Content type
102
102
-`filename` (Optional[str]): Original filename
103
-
-`download_url` (Optional[str]): URL to download full document
103
+
-`download_url` (Optional[str]): URL to download full document
Copy file name to clipboardExpand all lines: python-sdk/folders.mdx
+32-10Lines changed: 32 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: "Organize and isolate data into logical folder groups in Morphik"
7
7
8
8
Folders in Morphik provide a way to organize documents into logical groups. This is particularly useful for multi-project environments where you want to maintain separation between different contexts. Documents within a folder are isolated from those in other folders, allowing for clean organization and data separation.
9
9
10
-
> ℹ️ All folder APIs accept **either the folder’s UUID or its name**. Use whichever identifier you already have—Morphik resolves it automatically.
10
+
> ℹ️ All folder APIs accept **folder UUIDs, names, or canonical paths** (e.g., `"/projects/alpha/specs"`). Folder objects expose `full_path`, `parent_id`, `depth`, and `child_count`; documents and graphs expose `folder_path` to mirror server responses.
11
11
12
12
## Creating and Accessing Folders
13
13
@@ -20,9 +20,12 @@ Folders in Morphik provide a way to organize documents into logical groups. This
20
20
21
21
# Create a new folder
22
22
folder = db.create_folder("marketing_docs")
23
+
24
+
# Create a nested folder (parents created automatically)
@@ -88,6 +93,23 @@ Once you have a folder object, all operations performed on it are scoped to that
88
93
</Tab>
89
94
</Tabs>
90
95
96
+
## Nested Folders and Scope Depth
97
+
98
+
Folders can be nested arbitrarily. Use canonical paths (leading slash optional) to address them, and include descendant folders in retrieval/listing by setting `folder_depth`:
folder_depth=-1, # -1: all descendants, 0/None: exact only, n>0: include up to n levels
108
+
)
109
+
```
110
+
111
+
Folder-scoped helpers inherit the path automatically, so `folder.retrieve_chunks(..., folder_depth=-1)` will include its children.
112
+
91
113
## Folder Methods
92
114
93
115
All the core document operations available on the main Morphik client are also available on folder objects, but they are automatically scoped to the specific folder:
@@ -108,7 +130,7 @@ All the core document operations available on the main Morphik client are also a
108
130
109
131
## Managing Existing Documents and Folders
110
132
111
-
You can move previously ingested documents into a folder, remove them, or delete the entire folder. The SDK methods accept a folder name or UUID.
133
+
You can move previously ingested documents into a folder, remove them, or delete the entire folder. The SDK methods accept a folder UUID, name, or canonical path.
112
134
113
135
<Tabs>
114
136
<Tabtitle="Sync">
@@ -120,9 +142,9 @@ You can move previously ingested documents into a folder, remove them, or delete
120
142
121
143
document_id ="doc_123"
122
144
123
-
# Add an existing document to the folder (name or UUID works)
145
+
# Add an existing document to the folder (name/path or UUID works)
Copy file name to clipboardExpand all lines: python-sdk/get_folders_details.mdx
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ description: "Get detailed information about folders with optional document stat
40
40
41
41
## Parameters
42
42
43
-
-`identifiers` (List[str], optional): List of folder IDsornames. If None, returns all accessible folders.
43
+
-`identifiers` (List[str], optional): List of folder IDs, names, orcanonical paths (e.g., `/projects/alpha/specs`). If None, returns all accessible folders.
44
44
-`include_document_count` (bool, optional): Include total document count. Defaults to True.
45
45
-`include_status_counts` (bool, optional): Include document counts grouped by processing status. Defaults to False.
46
46
-`include_documents` (bool, optional): Include paginated document list. Defaults to False.
@@ -79,7 +79,7 @@ Filters follow the same JSON syntax across the API. See the [Metadata Filtering
79
79
80
80
# Get specific folders with status counts
81
81
response = db.get_folders_details(
82
-
identifiers=["reports", "invoices"],
82
+
identifiers=["/projects/reports", "invoices"],
83
83
include_status_counts=True,
84
84
)
85
85
for folder_detail in response.folders:
@@ -176,6 +176,8 @@ Filters follow the same JSON syntax across the API. See the [Metadata Filtering
0 commit comments