Get or create folders, several levels at once.
Each item is a folder named name under parent_folder_id (null: a top folder) or under the folder an earlier item made or found (parent_item_index, from 0), so a whole path is one call. A folder that already exists there is answered 200 with that folder and nothing changes; a new one 201 with its grants as create_folder gives them (security: parent by default, group, none or user) and the code it was given. An existing folder you cannot see is that item's 409, never handed back. Needs Create Folders and read access to every named parent. atomic is required.
| |
|---|
| Scope | folders:write |
| Asynchronous | No |
| MCP tool | batch_create_folders |
| Portal permissions | create_folders |
Parameters
| Name | In | Type | Required | Description |
|---|
Docwize-Version | header | string (date) | Optional | |
Idempotency-Key | header | string | Optional | max 255 |
Request body
Responses
Errors
The problem codes this operation can answer with. Each code links to its page.
Schemas
BatchBodyOfv1FolderEnsureItemInput
Folder
| Field | Type | Required | Description |
|---|
code | string | Required | |
folder_id | string | Required | |
has_children | boolean | Required | Whether the folder has child folders the caller can see. |
name | string | Required | |
parent_folder_id | string or null | Required | null for a root folder |
path | string or null | Required | Current ancestor names joined by ->; null without View Folder Tree or current access to every ancestor. |
project | object or null | Required | The project the folder is mapped to; null when none, when the caller cannot see it, or without projects:read and View Projects. |
| Field | Type | Required | Description |
|---|
code | string or null | Optional | The code of a folder this item creates; a generated unique one when absent. An existing folder keeps its code. |
name | string | Required | The folder's name. |
parent_folder_id | string or null | Optional | The folder to find or create it in; null or absent for a top folder, unless parent_item_index names one. |
parent_item_index | integer or null | Optional | The position, from 0, of an earlier item of this request whose folder is the parent: a path in one call. Not with parent_folder_id. |
security | string: parent, none, user, group or null | Optional | Who a folder this item creates is shared with besides you: parent (the default), group, none or user, as create_folder. |