See Stacksync in action with a solution architect. Book a demo ↗
Folders

Folders

Move resources to the root

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

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

Authorization

Authorizationstringheaderrequired

Bearer <key>, where <key> is a workspace API key or a user API key. See Authentication.

Path Parameters

workspace_id*integer

The workspace. List the ones your key can reach with GET /v1/workspaces.

Query Parameters

region*Regions

Region of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them

Value in"besg""usnv"

Request Body

application/json
  1. body
resources*array<>
Items1 <= items <= 200
validate_only?Validate Only

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

Defaultfalse

Response Body

OK

application/json
  1. response

The outcome of a move: each resource is moved on its own, so some can fail while others move

folder_id*|

The destination folder; None for the root

moved*array<>
failed*array<>
Move resources to the root
curl -X POST 'https://api.stacksync.com/v1/workspaces/0/folders/root/resources?region=besg' \  -H 'Content-Type: application/json' \  -d '{  "resources": [    {      "resource_type": "connection",      "resource_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",      "region": "besg"    }  ]}'
{  "folder_id": "<folder_id>",  "moved": [    {      "resource_type": "connection",      "resource_id": "<resource_id>",      "region": "besg",      "resource_name": "<resource_name>",      "source_folder_id": "<source_folder_id>"    }  ],  "failed": [    {      "resource_type": "connection",      "resource_id": "<resource_id>",      "region": "besg",      "resource_name": "<resource_name>",      "source_folder_id": "<source_folder_id>",      "msg": "<msg>"    }  ]}