What Does This Endpoint Do?
This endpoint allows you to permanently remove a file from WorqHat storage. Think of it like deleting a file from your computer’s trash - once deleted, the file cannot be recovered.When to Use Delete File
You’ll find this endpoint useful when you need to:- Clean up old files: Remove outdated or unnecessary files
- Implement data retention policies: Delete files that are beyond your retention period
- Free up storage space: Remove large files to make room for new ones
- Handle user requests: Delete user data upon request (e.g., for privacy compliance)
- Remove temporary files: Clean up files that were only needed temporarily
- Manage storage costs: Delete files to reduce storage usage and costs
How It Works
- You provide the file ID (obtained when you uploaded the file)
- The API locates the file in your organization’s storage
- The API permanently deletes the file from storage
- The API returns confirmation of the deletion
Code Examples
Example 1: Basic File Deletion
This example shows how to delete a file using its ID.- Node.js
- Python
- Go
- cURL
Example 2: Batch File Deletion
This example shows how to delete multiple files in sequence.- Node.js
- Python
- Go
- cURL
Request Parameters
The unique identifier of the file to delete. This is the ID that was returned when you uploaded the file.Example:
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"Response Fields Explained
true if the file was deleted successfully, false otherwise.A human-readable message describing the result of the deletion operation.
The timestamp when the file was deleted (ISO 8601 format).
Example Response
Common Errors and How to Fix Them
| Error | Cause | Solution |
|---|---|---|
| ”File not found” | The file ID doesn’t exist or has already been deleted | Check that the file ID is correct and the file still exists |
| ”Invalid file ID” | The file ID format is incorrect | Use a valid UUID format for the file ID |
| ”Unauthorized” | Invalid or missing API key | Check that you’re using a valid API key |
| ”File access denied” | You don’t have permission to delete this file | Ensure the file belongs to your organization |
Tips for Safe File Deletion
- Double-check file IDs before deleting to avoid accidental deletions
- Implement confirmation steps in user interfaces before deletion
- Keep backups of important files before deletion
- Use batch deletion carefully to avoid deleting too many files at once
- Log deletion activities for audit purposes
- Consider soft deletion for files that might need to be recovered
- Test deletion in development before using in production

