---
title: "Move resources to the root"
method: POST
path: "/v1/workspaces/{workspace_id}/folders/root/resources"
tags: ["Folders"]
---

# Move resources to the root

`POST /v1/workspaces/{workspace_id}/folders/root/resources`

## Request

- Base URL: `https://api.stacksync.com`
- URL: `https://api.stacksync.com/v1/workspaces/{workspace_id}/folders/root/resources`
- Auth: HTTP bearer

Each resource leaves its folder for the root of the workspace. A retry is safe.

## Path parameters

- `workspace_id` integer, required

## Query parameters

- `region` 'besg' | 'usnv', required

## Request body

- MoveResourcesBody
  - `resources` ResourceToMove[], required
    - `resource_type` 'connection' | 'folder' | 'workflow' | 'workspace_variable' | 'sync' | 'api_proxy' | 'app_queue' | 'genie' | 'knowledge_base', required
    - `resource_id` string, uuid, required: Id of the resource
    - `region` 'besg' | 'usnv', required
  - `validate_only` boolean: Run every check of the move and answer what would move and what would not, with why, without moving anything: a refused request answers the error the move would

## Response `200`

OK

- MovedResources: The outcome of a move: each resource is moved on its own, so some can fail while others move
  - `folder_id` string, nullable, required: The destination folder; None for the root
  - `moved` MovedResource[], required
    - `resource_type` 'connection' | 'folder' | 'workflow' | 'workspace_variable' | 'sync' | 'api_proxy' | 'app_queue' | 'genie' | 'knowledge_base', required
    - `resource_id` string, required
    - `region` 'besg' | 'usnv', required
    - `resource_name` string, nullable: The name of the resource; None when it was not found
    - `source_folder_id` string, nullable: The folder it was in before the move; None at the root or when it was not found
  - `failed` ResourceNotMoved[], required
    - `resource_type` 'connection' | 'folder' | 'workflow' | 'workspace_variable' | 'sync' | 'api_proxy' | 'app_queue' | 'genie' | 'knowledge_base', required
    - `resource_id` string, required
    - `region` 'besg' | 'usnv', required
    - `resource_name` string, nullable: The name of the resource; None when it was not found
    - `source_folder_id` string, nullable: The folder it was in before the move; None at the root or when it was not found
    - `msg` string, required: Why this resource was not moved

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `409`: Conflict

---

[API](https://skmtc.dev/stacksync/apis/stacksync-api.md) - [All operations](https://skmtc.dev/stacksync/apis/stacksync-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stacksync/apis/stacksync-api/revisions/21f4ba4b214e?raw)
