Endpoint
Authentication
Requires Bearer token authentication via theAuthorization header.
Path Parameters
The UUID of the server
Request Body
The root directory for delete operations (all paths are relative to this)
Array of file/directory paths to delete (relative to root)
Response
Returns204 No Content on success.
Example Request
Behavior
- Both files and directories can be deleted
- Directories are deleted recursively (all contents removed)
- Operations are performed concurrently for better performance
- If a file doesn’t exist, the operation is skipped (no error)
- Ignored files (
.pteroignore) are protected and cannot be deleted - Path traversal is prevented
- Symlinks are followed and the target is deleted
Error Responses
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
File is on the ignore list or path traversal attempt
404 Not Found
404 Not Found
Server does not exist
500 Internal Server Error
500 Internal Server Error
Failed to delete file (permission error, file in use, etc.)
Use Cases
- Clean up temporary files
- Remove old logs
- Delete unused plugins
- Clear cache directories
- Remove outdated backups
- Batch delete operations
Source Reference
Implementation:router/router_server_files.go (postServerDeleteFiles function)