Create and move folders with the REST API
Create, rename, and move folders through their exact REST endpoints, then verify the final parent while preserving names and avoiding tree conflicts.
Last reviewed
Dosya exposes separate folder routes for creation, renaming, and moving. A move can also apply the final name atomically, avoiding an intermediate destination collision.

Permissions and naming
Use a Full access credential with REST enabled. Creating requires the role permission create_folders; renaming and moving require rename_folders; verification through a listing requires access_files. A workspace pin works, while an API-key folder anchor does not work on REST.
A create path may be 500 characters across multiple segments. Rename and move names are single segments with a 100-character maximum.
Steps
- Create a disposable source with
POST /api/foldersand retain the returned leaf id plus its originalparent_id. - Rename it through
PUT /api/folders/:id/renameusing{ "name":"Quarterly archive" }, then require{ "ok":true,"name":"Quarterly archive" }. - Select a visible destination folder that is outside the source subtree and does not already contain the final name.
- Move with
PUT /api/folders/:id/moveand{ "parent_id":"fld_destination","name":"Published archive" }; use null to move to workspace root. - Confirm the move response reports the final
name, including the optional atomic rename rather than the old source label. - List the destination’s direct children and verify the folder id occurs there once, while the old parent’s listing no longer contains it.
Refusals to handle
A self-target answers Cannot move a folder into itself; a descendant target answers Cannot move a folder into its own subfolder. Dosya reports Destination folder not found when the target is absent or hidden, and You don't have permission to move folders when the current role lacks the operation.
A no-op move produces Folder is already here. A destination name collision is HTTP 409 with A folder with this name already exists in the target folder. Locked backup trees reject rename or relocation. Do not turn those responses into automatic alternate names unless the caller explicitly accepts that behavior.
The move and rename commit changes the shared tree and invalidates affected listings. It is reversible with another authorized operation, but clients can observe the new path immediately.
Expected result
The same folder id keeps its identity, the move response names its final label, and a destination listing shows the new parent relationship without a duplicate in the source.

Related guides
Was this helpful?
Loading helpfulness results…
Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.
Questions and replies
Ask about the steps in this guide. Questions are reviewed before publication.
Keep account details, credentials and private files out of public questions. Use private support for those.
Loading questions…
Sign in to your Dosya account to ask a question.