メインコンテンツまでスキップ

Move Folder

POST/apiv2/pub/folders/{folder_id}/movedocuments_write

Moves a folder to a new parent. All descendant paths and document mappings are updated atomically.

Request

Content-Type: application/json

Path parameters

ParameterTypeDescription
folder_idintegerFolder to move.

Body

FieldTypeRequiredDescription
new_parent_idintegerRequiredTarget parent. 0 = move to root.

Response

200 OK — The moved folder with updated full_path.


Errors

StatusReason
400Cannot move into own descendant
401Invalid or expired token
404Folder or target not found

cURL

curl -i -X POST "https://portal.docwize.com/apiv2/pub/folders/42/move" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"new_parent_id":99}'

{
"folder_id": 42,
"name": "Invoices",
"full_path": "Archive->Invoices",
"parent_id": 99,
"code": "a1b2c3d4-...",
"child_count": 3
}
{"detail": "Cannot move a folder into one of its own descendants"}
{"detail": "Folder not found or access denied"}