Skip to main content

List Files

Returns a list of all files associated with a case.

Endpoint

GET /api/files

Authentication

Requires API Key authentication.

Query Parameters

ParameterTypeRequiredDescription
caseIdstringYesCase ID to list files for

Response

Returns an array of file objects.

{
"success": true,
"data": [
{
"id": "file_abc123def456",
"case_id": "case_xyz789",
"file_name": "front_damage.jpg",
"file_size": 2456789,
"file_type": "image/jpeg",
"status": "ready",
"file_source": "plaintiff",
"file_category": "crash_analysis_plaintiff",
"vehicle_index": 0,
"s3_key": "cases/case_xyz789/uploads/front_damage.jpg",
"url": "https://storage.silentwitness.ai/...",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:31:00Z"
},
{
"id": "file_def456ghi789",
"case_id": "case_xyz789",
"file_name": "rear_damage.jpg",
"file_size": 1987654,
"file_type": "image/jpeg",
"status": "ready",
"file_source": "plaintiff",
"file_category": "crash_analysis_plaintiff",
"vehicle_index": 0,
"s3_key": "cases/case_xyz789/uploads/rear_damage.jpg",
"url": "https://storage.silentwitness.ai/...",
"created_at": "2024-01-15T10:32:00Z",
"updated_at": "2024-01-15T10:33:00Z"
}
]
}

Example

curl -X GET "https://api.silentwitness.ai/api/files?caseId=case_abc123def456" \
-H "X-API-Key: $API_KEY"

Response Fields

FieldTypeDescription
idstringUnique file identifier
case_idstringCase this file belongs to
file_namestringOriginal file name
file_sizeintegerFile size in bytes
file_typestringMIME type (e.g., image/jpeg)
statusstringFile status: processing, ready, error
file_sourcestringSource: plaintiff, defense
file_categorystringCategory for workflow organization
vehicle_indexintegerVehicle index (0=plaintiff, 1=defendant)
urlstringDirect URL to download the file
created_atdatetimeWhen the file was uploaded
updated_atdatetimeWhen the file was last updated

Errors

CodeDescription
400Missing caseId parameter
401Unauthorized - Invalid or missing token
500Internal server error