/api/user/folders/:id

View, update, or delete a specific folder by its ID.

Info

This endpoint requires authentication.

Path Parameters

NameTypeDescription
idstringThe 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

PropertyTypeDescription
isPublicboolean?Set folder to public/private.
namestring?Update folder name.
allowUploadsboolean?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

PropertyTypeDescription
idstringRequired. 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:

PropertyTypeDescription
delete"folder"Required. Deletes the folder.

To remove a file from the folder:

PropertyTypeDescription
delete"file"Required. Removes a file from the folder.
idstringRequired. 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.



Last updated: 6/1/2025
Edit this page on GitHub