Create Team Folder Hierarchy 

Description

The 'Create Team Folder Hierarchy' endpoint is used to create folder(s) with specific hierarchical structure under a predefined team in LEAPWORK. To create a folder hierarchy, enter folder titles one after another separated by the "/" symbol. After successful creation of a folder, the endpoint returns a HierarchyItemId. This is the hierarchy item id in which the folder hierarchy is going to be created. 

The ItemId parameter is the item id of a pre-existing flow or folder under which the new Item needs to be added. If the itemId is null or empty, the folder hierarchy will be created in the root folder.

Please note this endpoint will work with the LEAPWORK Enterprise Edition only. 

Please also note that hierarchies such as “..folder1/folder2/” and “..folder1//folder2“ are not allowed.

Request URL

http://{controllerMachine}:{controllerPort}/api/v4/hierarchy/create/folder/{teamid}/{itemId}

Input parameters

Field Type Description Comments
teamId string The teamId is a unique Id for the team defined under the LEAPWORK Enterprise Edition. teamId can be fetched from the Response Body of Get All Team endpoint
itemId string Unique identifier for items in the asset hierarchy The itemId can be from the following types of items:
- 'Folder'
- 'Flow'
- 'SubFlow'

Examples

Curl

curl -X PUT --header 'Accept: application/json' --header 'AccessKey: Mo87Nc4qDAtzJNDb' 'http://{controllerMachine}:{controllerPort}/api/v4/hierarchy/create/folder/{teamid}/{itemId}'

PowerShell 

$headers = @{}
$headers.Add("AccessKey","123qwe")
Invoke-WebRequest -Uri "http://autobotvm001:9001/api/v4/hierarchy/create/folder/9fb4ef50-6924-471d-8261-052aa8b572c9/8ee67a6b-703e-434e-b889-1d9371c2ae50?folder=Project1/Feature1" -ContentType "application/json" -Headers $headers -Method PUT 

Response Body

List of Variables

[
   {

     "$id": "1",

     "HierarchyItemId": "4fa4d1c3-cf08-40b3-861e-d88253458255"

    }
]

 

Response Object

Field Type Description Values
$id string ID of internal item (Folder/ Flow/Element etc.)  
HierarchyItemId string HierarchyItemId is Id of newly created Folder in the hierarchy.  


Response Code

200 (OK)

401 (Unauthorized, incorrect access key)

400 (Incorrect parameter 'folder' key or its value)

409 (API Returns 409 error, If ItemId cannot create folder or ItemId already contains folder item with the same title or ItemId already contains same hierarchy)

500 (Internal Server Error)