> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # MoveFolders # Package: sites # Namespace: SiteFoldersServiceV2 # Method link: https://dev.wix.com/docs/api-reference/account-level/sites/site-folders/move-folders.md ## Introduction Move folders to a specific folder or to root level. > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key. --- ## REST API ### Schema ``` Method: moveFolders Description: Move folders to a specific folder or to root level. > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key. URL: https://www.wixapis.com/site-folders/v2/folders/bulk/move Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: folderIds Method parameters: param name: folderIds | type: array | description: List of folders GUIDs. Limited to 1000 folders. | required: true param name: targetFolderId | type: targetFolderId | description: New parent GUID. Empty if folder is moved to root level. Return type: MoveFoldersResponse - name: folders | type: array | description: List of all the account's folders that were successfully moved. - name: id | type: string | description: Folder GUID. - name: name | type: string | description: Folder name. - name: createdDate | type: string | description: Date the folder was created. - name: updatedDate | type: string | description: Date the folder was last updated. - name: siteCount | type: integer | description: Number of sites in the folder. - name: parentId | type: string | description: Parent folder GUID. When empty, the site is at root level. - name: path | type: array | description: Path including all parent folders from root to the current folder, in order. When empty, the site or folder is at root level. - name: id | type: string | description: Folder GUID. - name: name | type: string | description: Folder name. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: folder_not_found | Description: Couldn't find the specified folder. ``` ### Examples ### MoveFolders ```curl curl -X PATCH 'https://www.wixapis.com/site-folders/v2/folders/bulk/move' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, text/plain, */*' \ -H 'Authorization: ' \ -H 'wix-account-id: f8d73a16-dbb2-428e-899e-092ceb49aa3f' -d '{"folderIds": ["f8dc078c-7642-4b2a-b662-d6569507bf57", "f8207974-6b78-428b-938f-f5d7ca98580d"], "targetFolderId": "836bc7cf-0477-432b-b792-3d36411c07bc"}' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.sites.SiteFoldersServiceV2.moveFolders(folderIds, options) Description: Move folders to a specific folder or to root level. > **Important**: You can only call this method when authenticated as a Wix user or by using an account level API key. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: folderIds Method parameters: param name: folderIds | type: array | description: List of folders GUIDs. Limited to 1000 folders. | required: true param name: options | type: MoveFoldersOptions none - name: targetFolderId | type: string | description: New parent GUID. Empty if folder is moved to root level. Return type: PROMISE - name: folders | type: array | description: List of all the account's folders that were successfully moved. - name: _id | type: string | description: Folder GUID. - name: name | type: string | description: Folder name. - name: _createdDate | type: Date | description: Date the folder was created. - name: _updatedDate | type: Date | description: Date the folder was last updated. - name: siteCount | type: integer | description: Number of sites in the folder. - name: parentId | type: string | description: Parent folder GUID. When empty, the site is at root level. - name: path | type: array | description: Path including all parent folders from root to the current folder, in order. When empty, the site or folder is at root level. - name: _id | type: string | description: Folder GUID. - name: name | type: string | description: Folder name. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: folder_not_found | Description: Couldn't find the specified folder. ``` ### Examples ### moveFolders ```javascript import { siteFolders } from '@wix/sites'; async function moveFolders(folderIds,options) { const response = await siteFolders.moveFolders(folderIds,options); }; ``` ### moveFolders (with elevated permissions) ```javascript import { siteFolders } from '@wix/sites'; import { auth } from '@wix/essentials'; async function myMoveFoldersMethod(folderIds,options) { const elevatedMoveFolders = auth.elevate(siteFolders.moveFolders); const response = await elevatedMoveFolders(folderIds,options); } ``` ### moveFolders (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { siteFolders } from '@wix/sites'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { siteFolders }, // Include the auth strategy and host as relevant }); async function moveFolders(folderIds,options) { const response = await myWixClient.siteFolders.moveFolders(folderIds,options); }; ``` ---