Add
[POST] .../v1/folder/add
Creates a new folder. Use this method to create a personal or public folder in REGOS file storage before uploading files into it. The request body is required, name is required, parent_id is optional and defaults to the root folder and access_level defaults to personal when it is not sent. The method validates that the parent folder exists, the current request user can write into it, the folder tree depth does not exceed five levels and the same owner does not already have an active folder with the same name in that parent. The caller must have folder add permission and the folders module must be supported by the database version; missing body, invalid name or access_level, denied permission, unsupported database version, duplicate folder names, parent ACL failures, depth violations and database errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| access_level | String | Optional | Folder access level. Optional and defaults to personal; public is also allowed for public API calls. Allowed values: system, personal, public. |
| name | String | Required | Folder name. Required and limited to 200 characters. |
| parent_id | Int64 | Optional | Parent folder identifier. Optional; when absent or non-positive, the root folder (id = 1) is used by the current endpoint. |
Request Example
{
"name": "Invoices",
"parent_id": 1,
"access_level": "personal"
}
Response Parameters
| Name | Type | Description |
|---|---|---|
| ok | Boolean | Indicates whether the request completed successfully. |
| result | Insert | Created record result. |
Response Example
{
"ok": true,
"result": {
"new_id": 10
}
}