Skip to main content

Delete Storage Files (Batch) (v1)

Method & Path

DELETE /api/v1/workspace/:workspaceId/storage/files/batch

Description

Delete multiple files from workspace storage in a single operation.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with workspace permissions.

Headers

Authorization: Bearer <workspace_token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Request Body

{
"filePaths": [
"sessions/session-id/attachment-123.webp",
"storefront/products/product-456.jpg"
]
}

Request Body Schema

FieldTypeRequiredDescription
filePathsarrayYesArray of file paths (min: 1 file path)
filePaths[]stringYesFile path in storage (min: 1 character)

Response 200 OK

{
"success": true,
"deletedCount": 2,
"failedCount": 0,
"failedFiles": []
}

Response Fields

  • success (boolean): Whether the operation was successful
  • deletedCount (number): Number of files successfully deleted
  • failedCount (number): Number of files that failed to delete
  • failedFiles (array): Array of file paths that failed to delete

Common Errors

400 Bad Request: Missing or invalid file paths array

401 Unauthorized: Missing or invalid authentication token

404 Not Found: Workspace not found

500 Internal Server Error: Server error occurred while processing the request

Notes

  • This operation is permanent and cannot be undone
  • Storage quota is updated after deletion
  • All files must belong to the workspace
  • Partial success is possible - check failedCount and failedFiles for failures