Delete File
Deletes a file by its ID.
warning
Deleting a file is permanent and cannot be undone. The file will be removed from both the database and storage.
Endpoint
DELETE /api/files/:fileId
Authentication
Requires API Key authentication.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fileId | string | Yes | File ID |
Response
Returns a success confirmation.
{
"success": true,
"data": {
"message": "File deleted successfully"
}
}
Example
curl -X DELETE "https://api.silentwitness.ai/api/files/file_abc123def456" \
-H "X-API-Key: $API_KEY"
Errors
| Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing token |
| 403 | Forbidden - Access denied to this file |
| 404 | File not found |
| 500 | Internal server error |
Example Error
{
"success": false,
"error": "File not found"
}
Notes
- Files used in completed analyses may still be referenced in reports
- Consider the impact on existing analyses before deleting files