Skip to main content

Folders

Folders are used to organize test cases within a project. Use our REST API to manage folders by retrieving details, creating new folders, updating existing folders, deleting folders, and moving folders within a project.

Note: All API endpoints are secured using Role-Based Access Control (RBAC). Ensure that your account has the necessary permissions to retrieve or modify data.

Get folder details

GET /api/v2/projects/{project-id}/folders/{folder-id}

Invoking this API will fetch detailed information about a folder within a project associated with your username and access key. Provide both the project identifier and the folder identifier.

Request parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/PR-2223/folders/54
  • project-id* String

    A unique string identifier for the project.

  • folder-id* Integer

    A unique string identifier of the folder whose details are to be retrieved.

Response Attributes 200 OK json

Response

{
  "success": true,
  "folder": {
    "id": 54,
    "name": "test folder name",
    "description": "folder description",
    "parent_id": 25,
    "cases_count": 0,
    "sub_folders_count": 0,
    "links": {
      "sub_folders": "/api/v2/projects/PR-1/folders/54/sub-folders"
    }
  }
}
  • success Boolean

    API call is executed successfully.

  • id Integer

    A unique numeric identifier for the folder.

  • name String

    The name of the folder.

  • description String

    A brief overview detailing the folder’s purpose.

  • parent_id Integer

    The identifier of the parent folder; if null, the folder is created at the root level.

  • cases_count Integer

    Number of test cases directly inside the folder.

  • sub_folders_count Integer

    The number of direct sub-folders within the folder.

  • links Object

    An object containing related API endpoints.

  • sub_folders String

    The URL endpoint to retrieve the folder’s sub-folders.

Get list of folders in a project

GET /api/v2/projects/{project-id}/folders

Invoking this API will fetch the list of folders in a projects associated with your username and access key. To access the list of folders in a project, you will need the id of the project.

This list is paginated; for more information, refer Pagination.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
https://test-management.browserstack.com/api/v2/projects/PR-54/folders?p=1
  • project-id* String

    Identifier of the project.

  • page-number Integer

    Page number to retrieve which is used as a query parameter. By default, this endpoint returns page 1.

Response Attributes 200 OK json

Response


{
  "success": true,
  "folders": [
    {
      "id": 1310,
      "name": "Login",
      "parent_id": 1309,
      "sub_folders_count": 1,
      "links": {
        "sub_folders": "/api/v2/projects/PR-54/folders/1310/sub-folders"
      }
    },
    {
      "id": 1312,
      "name": "Logout",
      "parent_id": 1309,
      "sub_folders_count": 0,
      "links": {
        "sub_folders": "/api/v2/projects/PR-54/folders/1312/sub-folders"
      }
    }
  ]
  "info": {
    "page": 2,
    "page_size": 30,
    "count": 4,
    "prev": null,
    "next": null
  }
}
  • success Boolean

    API call is executed successfully.

  • folders Array

    This list has information about a specific folder.

    SHOW VALUES
    • id Integer

      ID of the main folder.

    • name String

      Name of the folder.

    • parent_id Integer

      ID of the parent folder.

    • sub_folders_count Integer

      Number of sub-folders within the main folder.

    • links Object

      API endpoint url of the sub-folders.

    • sub_folders String

      The URL endpoint to retrieve the folder’s sub-folders.

Create a folder

POST /api/v2/projects/{project-id}/folders

Invoking this API to create a new folder within a project. To create a folder, you will need the id of the project. If the parent_id is set to null, the folder will be created at the root level.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-1/folders
  • project-id* String

    A unique string identifier for the project.

Request Body

Request Body

{
  "folder": {
    "name": "Test Management login",
    "description": "This is the description of this folder",
    "parent_id": 1200
  }
}
  • name* String

    The name of the folder.

  • description* String

    A brief overview detailing the folder’s purpose.

  • parent_id* Integer

    The identifier of the parent folder; if null, the folder is created at the root level.

Response Attributes 200 OK json

Response

{
  "success": true,
  "folder": {
    "id": 54,
    "name": "test folder name",
    "description": "folder description",
    "parent_id": 25,
    "cases_count": null,
    "sub_folders_count": null,
    "links": {
      "sub_folders": "/api/v2/projects/PR-1/folders/54/sub-folders"
    }
  }
}
  • success Boolean

    API call is executed successfully.

  • id Integer

    A unique numeric identifier for the folder.

  • name String

    The name of the folder.

  • description String

    A brief overview detailing the folder’s purpose.

  • parent_id Integer

    The identifier of the parent folder; if null, the folder is created at the root level.

  • cases_count Integer

    Number of test cases directly inside the folder.

  • sub_folders_count Integer

    The number of direct sub-folders within the folder.

  • links Object

    An object containing related API endpoints.

  • sub_folders String

    The URL endpoint to retrieve the folder’s sub-folders.

Update a folder

PATCH /api/v2/projects/{project-id}/folders/{folder-id}

Invoking this API allows you to update details of an existing folder within a project. To update a folder, you need the id of the project and the id of the folder.

Note: Partial updates are supported, so you may modify only the fields that need to be changed (e.g. name or description).

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X PATCH https://test-management.browserstack.com/api/v2/projects/PR-2223/folders/54
  • project-id* String

    A unique string identifier for the project.

  • folder-id* Integer

    A unique string identifier of the folder whose details are to be retrieved.

Request Body

Request Body

{
  "folder": {
    "name": "Test Management login",
    "description": "This is a description of this test folder."
  }
}
  • name* String

    The name of the folder.

  • description* String

    A brief overview detailing the folder’s purpose.

Response Attributes 200 OK json

Response

{
  "success": true,
  "folder": {
    "id": 54,
    "name": "test folder name",
    "description": "folder description",
    "parent_id": 25,
    "cases_count": 0,
    "sub_folders_count": 0,
    "links": {
      "sub_folders": "/api/v2/projects/PR-1/folders/54/sub-folders"
    }
  }
}
  • success Boolean

    API call is executed successfully.

  • id Integer

    A unique numeric identifier for the folder.

  • name String

    The name of the folder.

  • description String

    A brief overview detailing the folder’s purpose.

  • parent_id Integer

    The identifier of the parent folder; if null, the folder is created at the root level.

  • cases_count Integer

    Number of test cases directly inside the folder.

  • sub_folders_count Integer

    The number of direct sub-folders within the folder.

  • links Object

    An object containing related API endpoints.

  • sub_folders String

    The URL endpoint to retrieve the folder’s sub-folders.

Delete a folder

DELETE /api/v2/projects/{project-id}/folders/{folder-id}

Invoking this API will delete a folder. You need the id of the folder which you want to delete.

Warning: Using the delete API call will permanently remove the folder and all the associated data including test cases. This action cannot be undone.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-2223/folders/54
  • project-id* String

    A unique string identifier for the project.

  • folder-id* Integer

    A unique string identifier of the folder whose details are to be retrieved.

Response Attributes 200 OK json

Response

{
    "success": true
}
  • success Boolean

    API call is executed successfully.

Move a folder

POST /api/v2/projects/{project-id}/folders/{folder-id}/move

Invoking this API will move a folder and its associated sub-folders within the same project. You need the id of the project and id of the folder which you want to move. Ensure that the parent_id belongs to a folder within the same project.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST https://test-management.browserstack.com/api/v2/projects/PR-2223/folders/54/move
  • project-id* String

    A unique string identifier for the project.

  • folder-id* Integer

    A unique string identifier of the folder whose details are to be retrieved.

Request Body

Request Body

{
  "parent_id": 1200
}
  • parent_id Integer

    The identifier of the parent folder; if null, the folder is created at the root level.

Response Attributes 200 OK json

Response

{
  "success": true,
  "folder": {
    "id": 54,
    "name": "verify login workflow",
    "description": "This is the description of this folder",
    "parent_id": 30,
    "cases_count": 0,
    "sub_folders_count": 0,
    "links": {
      "sub_folders": "/api/v2/projects/PR-1/folders/54/sub-folders"
    }
  }
}
  • success Boolean

    API call is executed successfully.

  • id Integer

    A unique numeric identifier for the folder.

  • name String

    The name of the folder.

  • description String

    A brief overview detailing the folder’s purpose.

  • parent_id Integer

    The identifier of the parent folder; if null, the folder is created at the root level.

  • cases_count Integer

    Number of test cases directly inside the folder.

  • sub_folders_count Integer

    The number of direct sub-folders within the folder.

  • links Object

    An object containing related API endpoints.

  • sub_folders String

    The URL endpoint to retrieve the folder’s sub-folders.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Download Copy Check Circle