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

Folders

Create a folder

POST
/v1/workspaces/{workspace_id}/folders

At the root, or inside another folder of the same region (parent_folder_id). A folder_resource_id or name already used in the region of the workspace is refused with 409. With validate_only, every check runs and 204 answers, nothing is created.

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"

Header Parameters

Idempotency-Key?|

Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.

Defaultnull

Request Body

application/json
  1. body
folder_name*Folder Name
Length1 <= length <= 255
folder_resource_id?|

A unique, readable id of the folder in the region of the workspace (lowercase letters, digits and _); derived from the name when absent

Defaultnull
parent_folder_id?|

The folder to create it in; the root when absent

Defaultnull
validate_only?Validate Only

Run every check of the write and answer 204 without writing: a refused write answers the error the write would

Defaultfalse

Response Body

Created

application/json
  1. response
folder_id*Folder Id
folder_name*Folder Name
folder_resource_id*Folder Resource Id
parent_folder_id*|

The folder it is in; None at the root

region*Regions
Value in"besg""usnv"
Create a folder
curl -X POST 'https://api.stacksync.com/v1/workspaces/0/folders?region=besg' \  -H 'Content-Type: application/json' \  -d '{  "folder_name": "<folder_name>"}'
{  "folder_id": "<folder_id>",  "folder_name": "<folder_name>",  "folder_resource_id": "<folder_resource_id>",  "parent_folder_id": "<parent_folder_id>",  "region": "besg"}