Upload File
Uploads a file to an existing case. Files can be vehicle damage photos or EDR data.
Endpoint
POST /api/files/upload
Authentication
Requires API Key authentication.
Request
This endpoint uses multipart/form-data for file upload.
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The file to upload |
caseId | string | Yes | Case ID to associate the file with |
fileCategory | string | No | File category (see below) |
vehicleIndex | integer | No | Vehicle index (0 for plaintiff, 1 for defendant) |
File Categories
| Value | Description |
|---|---|
crash_analysis_plaintiff | Plaintiff vehicle photos |
crash_analysis_defendant | Defendant vehicle photos |
research_scrutinizer_plaintiff | Research documents (plaintiff) |
research_scrutinizer_defense | Research documents (defense) |
Supported File Types
| Type | Extensions | Use Case |
|---|---|---|
| Images | .jpg, .jpeg, .png, .gif | Vehicle damage photos |
| Documents | .pdf | EDR reports, medical records |
File Constraints
- Maximum file size: 50MB
- Empty files: Not allowed
- Supported image formats: JPEG, PNG, GIF
- Supported document formats: PDF
Response
Returns the uploaded file information.
{
"success": true,
"data": {
"fileId": "file_abc123def456",
"fileName": "front_damage.jpg",
"status": "ready",
"downloadUrl": "https://api.silentwitness.ai/api/files/file_abc123/download",
"url": "https://storage.silentwitness.ai/..."
}
}
Example
curl -X POST "https://api.silentwitness.ai/api/files/upload" \
-H "X-API-Key: $API_KEY" \
-F "file=@/path/to/front_damage.jpg" \
-F "caseId=case_abc123def456" \
-F "fileCategory=crash_analysis_plaintiff" \
-F "vehicleIndex=0"
Upload EDR File
curl -X POST "https://api.silentwitness.ai/api/files/upload" \
-H "X-API-Key: $API_KEY" \
-F "file=@/path/to/edr_report.pdf" \
-F "caseId=case_abc123def456" \
-F "fileCategory=crash_analysis_plaintiff" \
-F "vehicleIndex=0"
Errors
| Code | Description |
|---|---|
| 400 | Missing caseId, no file provided, empty file, or file too large |
| 401 | Unauthorized - Invalid or missing token |
| 404 | Case not found or access denied |
| 500 | Internal server error |
Example Error
{
"success": false,
"error": "caseId is required"
}
Notes
- Maximum file size: 50MB
- Files are automatically processed after upload
- Status changes from
processingtoreadywhen complete - Empty files are not allowed