Skip to main content

Get or create folders, several levels at once.

POST/api/v1/folders/batch-createfolders:write

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.

Scopefolders:write
AsynchronousNo
MCP toolbatch_create_folders
Portal permissionscreate_folders

Parameters​

NameInTypeRequiredDescription
Docwize-Versionheaderstring (date)Optional
Idempotency-KeyheaderstringOptionalmax 255

Request body​

Content typeType
application/jsonBatchBodyOfv1FolderEnsureItemInput

Responses​

StatusDescriptionBody
200Success.application/json object or object
400invalid_version, malformed_jsonapplication/problem+json Problem
401token_expired, unauthenticatedapplication/problem+json Problem
403forbidden, insufficient_scope, token_owner_inactiveapplication/problem+json Problem
405method_not_allowedapplication/problem+json Problem
406not_acceptableapplication/problem+json Problem
409conflict, idempotency_in_progressapplication/problem+json Problem
413payload_too_largeapplication/problem+json Problem
415unsupported_media_typeapplication/problem+json Problem
421wrong_regionapplication/problem+json Problem
422idempotency_key_reused, validation_failedapplication/problem+json Problem
500internal_errorapplication/problem+json Problem
503tenant_unavailable, unavailableapplication/problem+json Problem
504timeoutapplication/problem+json Problem

Errors​

The problem codes this operation can answer with. Each code links to its page.

Schemas​

BatchBodyOfv1FolderEnsureItemInput​

FieldTypeRequiredDescription
atomicbooleanRequired
itemsarray of FolderEnsureItemInputRequired

Folder​

FieldTypeRequiredDescription
codestringRequired
folder_idstringRequired
has_childrenbooleanRequiredWhether the folder has child folders the caller can see.
namestringRequired
parent_folder_idstring or nullRequirednull for a root folder
pathstring or nullRequiredCurrent ancestor names joined by ->; null without View Folder Tree or current access to every ancestor.
projectobject or nullRequiredThe project the folder is mapped to; null when none, when the caller cannot see it, or without projects:read and View Projects.

FolderEnsureItemInput​

FieldTypeRequiredDescription
codestring or nullOptionalThe code of a folder this item creates; a generated unique one when absent. An existing folder keeps its code.
namestringRequiredThe folder's name.
parent_folder_idstring or nullOptionalThe folder to find or create it in; null or absent for a top folder, unless parent_item_index names one.
parent_item_indexinteger or nullOptionalThe 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.
securitystring: parent, none, user, group or nullOptionalWho a folder this item creates is shared with besides you: parent (the default), group, none or user, as create_folder.