Skip to main content

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

ParameterTypeRequiredDescription
fileIdstringYesFile 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

CodeDescription
401Unauthorized - Invalid or missing token
403Forbidden - Access denied to this file
404File not found
500Internal 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