Folders

List folders

This endpoint makes an HTTP GET request to retrieve a list of projects from a level of a folder's tree.

Request

  • Method: GET

  • Endpoint: https://api.creatopy.com/v1/folders

  • Query Parameters:

    • projectId (integer, required): The projectId in which will search the folders

    • parentId(integer, optional): Will search subfolders in folder with id equal to parentId value

curl --location 'https://api.creatopy.com/v1/folders' \
--header 'Authorization: Bearer eyJh...'

Response

Upon a successful execution, the response will have a status code of 200 and a JSON content type. The response body will contain the following structure:

JSON

{
    "response": {
        "folders": [
            {
                "id": 111111,
                "name": "Folder Name 1",
                "parentId": null,
                "createdByUser": {
                    "id": 22222,
                    "name": "User Name 1"
                },
                "isParent": null,
                "updatedAt": "2024-12-04T08:59:00.509Z",
                "createdAt": "2024-09-30T07:11:45.948Z",
                "updatedByUser": {
                    "id": 33333,
                    "name": "User name 2"
                }
            },
            {
                "id": 333333,
                "name": "Folder Name 2",
                "parentId": null,
                "createdByUser": {
                    "id": 44444,
                    "name": "User Name 3"
                },
                "isParent": null,
                "updatedAt": "2024-12-03T15:21:53.010Z",
                "createdAt": "2024-12-03T14:38:17.513Z",
                "updatedByUser": {
                    "id": 44444,
                    "name": "User Name 4"
                }
            },
            
        "path": [],
        "rootFolderHash": null
    }
}

If the parentId is not null in the request the JSON response will contain data about the path to that folder

Create Folder

This endpoint allows you to create a new folder.

Request

  • Method: POST

  • Endpoint: https://api.creatopy.com/v1/folders

  • Body:

    • name (string, required): The name of the folder.

    • projectId (integer, required): The ID of the project in which user will create the folder.

    • parentId (integer, optional): The ID of the folder in within the user will create the new folder.

Response

Upon a successful execution, the response will have a status code of 200 and a JSON content type. The response body will contain the following structure:

JSON

Delete Folder

This endpoint allows you to delete a folder.

Request

  • Method: DELETE

  • Endpoint: https://api.creatopy.com/v1/folders

  • Body:

    • folderId (integer, required): The ID of the folder you want to be deleted.

Response

Update Folder

This endpoint allows you to update a folder's name.

Request

  • Method: PUT

  • Endpoint: https://api.creatopy.com/v1/folders

  • Body:

    • name (string, required): The new name of the folder you want to be updated.

    • folderId (integer, required): The ID of the folder you want to be updated.

Response

Last updated