Files API
Files represent uploaded evidence such as vehicle damage photos and EDR (Event Data Recorder) files. Files are associated with cases and used for crash analysis.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | /api/files/upload | Upload file |
GET | /api/files | List files |
GET | /api/files/:fileId | Get file |
DELETE | /api/files/:fileId | Delete file |
File Object
{
"fileId": "file_abc123def456",
"fileName": "front_damage.jpg",
"status": "ready",
"downloadUrl": "https://api.silentwitness.ai/api/files/file_abc123/download",
"url": "https://storage.silentwitness.ai/..."
}
Supported File Types
The API accepts exactly five file types. The server detects the type from the file's bytes — the Content-Type header your client sends is not trusted.
| Type | MIME type | Typical use |
|---|---|---|
| JPEG | image/jpeg | Vehicle damage photos |
| PNG | image/png | Vehicle damage photos |
| GIF | image/gif | Vehicle damage photos |
| WebP | image/webp | Vehicle damage photos |
application/pdf | EDR / crash reports, medical records, other documents |
Vehicle Damage Photos
- Formats: JPEG, PNG, GIF, WebP
- Max size: 50MB per file
- Quantity: 1-20 photos per vehicle (4-8 recommended)
EDR (Event Data Recorder) Files
- Formats: PDF
- Max size: 50MB per file
- Quantity: 1 file per vehicle
Uploads outside these types are rejected at the upload endpoint with 400 Bad Request. HEIC, HEIF, DOC, DOCX, CSV, ZIP, and CDR files are not supported — convert them to a supported format before uploading.
File Categories
When uploading files, specify the category:
| Category | Description |
|---|---|
vehicle_photo | Vehicle damage photos |
edr_document | Event Data Recorder report (PDF) |
tcr_document | Traffic Collision Report (PDF) |
Use the vehicle_role field (plaintiff or defendant) to specify which vehicle the file belongs to. Defaults to plaintiff.
File Status
| Status | Description |
|---|---|
processing | File is being uploaded |
ready | File is ready for use |
error | Upload failed |
Workflow
- Create a case first
- Upload files with case ID
- Files are automatically linked to the case
- Use files in crash analysis and report generation
Next Steps
- Upload a File
- Create a Case (required before uploading)