Create Folder

View as Markdown
## Create Folder Creates a new folder for the authenticated user. You can optionally create the folder **inside another folder** using `parent_id`. **Method:** `POST` **URL:** `{{base_url}}/folders` --- ## Authentication This endpoint requires authentication. Use a **Bearer token** in the `Authorization` header: ```http Authorization: Bearer {{access_token}} ``` --- ## Headers | Header | Value | |---|---| | Content-Type | application/json | | Authorization | Bearer {{access_token}} | --- ## Required Variables | Variable | Required | Description | |---|---|---| | `base_url` | Yes | Base API URL | | `access_token` | Yes | Authentication access token | --- ## Body (raw JSON) Send the request body as **raw JSON**. | Field | Type | Required | Description | |---|---|---|---| | `name` | string | Yes | Name of the new folder | | `parent_id` | integer | No | ID of the parent folder | Example request body: ```json { "name": "Campaign Photos", "parent_id": 10 } ``` Notes: - If `parent_id` is **null or omitted**, the folder will be created at the **root level**. - If `parent_id` is provided, the folder will be created **inside that folder**. --- ## Sample Request ```bash curl --request POST "{{base_url}}/folders" \ --header "Authorization: Bearer {{access_token}}" \ --header "Content-Type: application/json" \ --data '{ "name": "Campaign Photos", "parent_id": 10 }' ``` --- ## Sample Success Response A successful request typically returns **HTTP 200 OK**. ```json { "success": true, "message": "Folder created successfully", "data": { "user_id": 43028, "name": "Campaign Photos", "parent_id": 10, "is_system": false, "updated_at": "2026-03-10T06:25:32.000000Z", "created_at": "2026-03-10T06:25:32.000000Z", "id": 11 } } ``` --- ## Response Fields | Field | Type | Description | |---|---|---| | `id` | integer | Unique folder ID | | `user_id` | integer | Owner user ID | | `name` | string | Folder name | | `parent_id` | integer/null | Parent folder ID | | `is_system` | boolean | Indicates if the folder is a system folder | | `created_at` | datetime | Folder creation timestamp | | `updated_at` | datetime | Last update timestamp | --- ## Common Errors - **400 Bad Request** - Missing `name` - Invalid `parent_id` - **401 Unauthorized / 403 Forbidden** - Missing or invalid `Authorization` header - Expired `{{access_token}}` - **404 Not Found** - Provided `parent_id` does not exist --- ## Notes - Folder names **do not need to be unique**, but it's recommended for better organization. - Useful for creating **nested folder structures**. - The folder will belong to the **authenticated user** automatically.

Request

This endpoint expects an object.
namestringRequired
parent_idintegerRequired

Response

Created
dataobject
messagestring
successboolean