/api/user/folders/:id
View, update, or delete a specific folder by its ID.
This endpoint requires authentication.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The unique ID of the folder |
GET Request
Get a specific folder by its ID.
Response
Status: 200 OK
Content-Type: application/json
Returns a Folder object.
Error Responses
-
404 Not Found
If the folder with the specified ID does not exist.
PATCH Request
Update a specific folder by its ID.
Body
Content-Type: application/json
Property | Type | Description |
---|---|---|
isPublic | boolean? | Set folder to public/private. |
name | string? | Update folder name. |
allowUploads | boolean? | Allow/disallow anonymous uploads to this folder. |
Example
Update a folder to be public and allow uploads:
{"isPublic": true,"allowUploads": true}
Response
Status: 200 OK
Content-Type: application/json
Returns the updated Folder object.
Error Responses
-
400 Bad Request
If the request body is invalid or missing required fields.
-
404 Not Found
If the folder with the specified ID does not exist.
PUT Request
Add a file to this folder.
Body
Content-Type: application/json
Property | Type | Description |
---|---|---|
id | string | Required. File ID to add to this folder. |
Example
Add a file with ID file123
to the folder:
{"id": "file123"}
Response
Status: 200 OK
Content-Type: application/json
Returns the updated Folder object with the file added.
Error Responses
-
400 Bad Request
If the request body is invalid or missing required fields.
-
404 Not Found
If the folder with the specified ID does not exist or the file ID is invalid.
DELETE Request
Remove a file from a folder or delete the entire folder.
Body
Content-Type: application/json
To delete an entire folder:
Property | Type | Description |
---|---|---|
delete | "folder" | Required. Deletes the folder. |
To remove a file from the folder:
Property | Type | Description |
---|---|---|
delete | "file" | Required. Removes a file from the folder. |
id | string | Required. File ID to remove. |
Example
To delete the entire folder:
{"delete": "folder"}
To delete a specific file from the folder:
{"delete": "file","id": "file123"}
Response
Status: 200 OK
Content-Type: application/json
Returns the updated Folder object after the file is removed or the folder is deleted.
Error Responses
-
400 Bad Request
- File or folder ID missing/invalid.
- File not in folder, or already in folder.
- Invalid delete type.
-
404 Not Found
Folder or file not found.
-
403 Forbidden
The user does not own the folder or file.