Skip to main content

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

FieldTypeRequiredDescription
filefileYesThe file to upload
caseIdstringYesCase ID to associate the file with
fileCategorystringNoFile category (see below)
vehicleIndexintegerNoVehicle index (0 for plaintiff, 1 for defendant)

File Categories

ValueDescription
crash_analysis_plaintiffPlaintiff vehicle photos
crash_analysis_defendantDefendant vehicle photos
research_scrutinizer_plaintiffResearch documents (plaintiff)
research_scrutinizer_defenseResearch documents (defense)

Supported File Types

TypeExtensionsUse Case
Images.jpg, .jpeg, .png, .gifVehicle damage photos
Documents.pdfEDR 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

CodeDescription
400Missing caseId, no file provided, empty file, or file too large
401Unauthorized - Invalid or missing token
404Case not found or access denied
500Internal server error

Example Error

{
"success": false,
"error": "caseId is required"
}

Notes

  • Maximum file size: 50MB
  • Files are automatically processed after upload
  • Status changes from processing to ready when complete
  • Empty files are not allowed