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
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
Request Body
{
"filePaths": [
"sessions/session-id/attachment-123.webp",
"storefront/products/product-456.jpg"
]
}
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
filePaths | array | Yes | Array of file paths (min: 1 file path) |
filePaths[] | string | Yes | File path in storage (min: 1 character) |
Response 200 OK
{
"success": true,
"deletedCount": 2,
"failedCount": 0,
"failedFiles": []
}
Response Fields
success(boolean): Whether the operation was successfuldeletedCount(number): Number of files successfully deletedfailedCount(number): Number of files that failed to deletefailedFiles(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
failedCountandfailedFilesfor failures