/api/user/files/transaction

Perform bulk actions on your files: delete, favorite/unfavorite, or move to a folder.

Info

This endpoint requires authentication.

PATCH
Request

Bulk update files: favorite/unfavorite them or move them to a folder.

Body

Content-Type: application/json

PropertyTypeDescription
filesstring[]Required. Array of file IDs to operate on.
favoriteboolean?If present, sets/unsets favorite status for the files.
folderstring?If present (and favorite is not), moves the files to this folder.

Examples

Favorite files:

{
"files": ["file1", "file2"],
"favorite": true
}

Unfavorite files:

{
"files": ["file1", "file2"],
"favorite": false
}

Move files to a folder:

{
"files": ["file1", "file2"],
"folder": "folderid"
}

Response

Status: 200 OK

Content-Type: application/json

PropertyTypeDescription
countnumberNumber of files updated.
namestring?Folder name, if files were moved to a folder.

Error Responses

  • 400 Bad Request

    • If the files array is missing or empty.
    • Invalid files
  • 404 Not Found

    • If any of the specified files do not exist.
    • If the specified folder does not exist when moving files.
    • The provided folder is not owned by the user.

DELETE
Request

Bulk delete files (and optionally delete from underlying datasource).

Body

PropertyTypeDescription
filesstring[]Required. Array of file IDs to delete.
delete_datasourceFilesboolean?If true, also deletes the files from underlying storage.

Response

Status: 200 OK

Content-Type: application/json

PropertyTypeDescription
countnumberNumber of files deleted.

Error Responses

  • 400 Bad Request

    • If the files array is missing or empty.
    • Invalid files
    • Missing required properties in the request body.


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