Update Case
Updates an existing case. All fields are optional - only include the fields you want to update.
PUT /api/cases/:id
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Case ID |
Request Body
{
"name": "string",
"plaintiff_name": "string",
"defendant_name": "string",
"attorney_name": "string",
"side": "plaintiff | defense",
"status": "active | archived",
"accident": {
"description": "string",
"date": "YYYY-MM-DD",
"time": "HH:MM",
"location": "string"
},
"vehicles": [
{
"role": "plaintiff | defendant",
"vehicle_maker": "string",
"vehicle_model": "string",
"vehicle_year": "string",
"vehicle_vin": "string",
"vehicle_type": "string",
"edr_file_id": "string",
"image_file_ids": ["string"]
}
],
"occupants": [
{
"name": "string",
"age": 0,
"gender": "male | female | other",
"height_inches": 0,
"weight_lbs": 0,
"position": "driver | front_passenger | rear_left | rear_center | rear_right",
"alleged_injuries": ["string"],
"seatbelt_worn": true,
"airbag_deployed": "yes | no | partial | unknown",
"injury_severity": "minor | moderate | serious | severe | critical",
"pre_existing_conditions": "string"
}
]
}
Parameters
Basic Fields
-
namestring, optional Case name or title (e.g., "Smith v. Johnson") -
plaintiff_namestring, optional Plaintiff name (injured party) -
defendant_namestring, optional Defendant name (opposing party) -
attorney_namestring, optional Attorney name handling the case -
sidestring, optional Which party the attorney represents. One of:plaintiffordefense. -
statusstring, optional Case status. One of:active,archived
Accident Information
-
accidentobject, optional Accident information. Only include fields you want to update.accident.descriptionstring - Narrative description of the accidentaccident.datestring - Date of accident inYYYY-MM-DDformataccident.timestring - Time of accident inHH:MMformataccident.locationstring - Location where the accident occurred
Vehicles
-
vehiclesarray of objects, optional List of vehicles to update. Only include the vehicles and fields you want to update.vehicles[].rolestring, required - Vehicle role:plaintiffordefendantvehicles[].vehicle_makerstring - Manufacturer (e.g., "Toyota")vehicles[].vehicle_modelstring - Model (e.g., "Camry")vehicles[].vehicle_yearstring - Year (e.g., "2020")vehicles[].vehicle_vinstring - Vehicle Identification Numbervehicles[].vehicle_typestring - Type:sedan,suv,truck,motorcycle, etc.vehicles[].edr_file_idstring - File ID of uploaded EDR datavehicles[].image_file_idsarray of strings - File IDs of uploaded damage photos (used for delta-v calculation)
Occupants
-
occupantsarray of objects, optional List of occupants. Note: This replaces all existing occupants when provided.occupants[].namestring - Occupant nameoccupants[].ageinteger, required - Age in yearsoccupants[].genderstring, required - One of:male,female,otheroccupants[].height_inchesinteger - Height in inchesoccupants[].weight_lbsinteger - Weight in poundsoccupants[].positionstring, required - Seating position:driver,front_passenger,rear_left,rear_center,rear_rightoccupants[].alleged_injuriesarray of strings - Injury types:head_brain,cervical_spine,thoracic_spine,lumbar_spine,shoulder,hip,knee,foot_ankleoccupants[].seatbelt_wornboolean - Whether seatbelt was wornoccupants[].airbag_deployedstring - One of:yes,no,partial,unknownoccupants[].injury_severitystring - One of:minor,moderate,serious,severe,criticaloccupants[].pre_existing_conditionsstring - Description of pre-existing conditions
Response
{
"success": true,
"data": {
"id": "case_abc123def456",
"name": "Smith v. Johnson",
"plaintiff_name": "John Smith",
"defendant_name": "Bob Johnson",
"attorney_name": "Jane Doe, Esq.",
"side": "plaintiff",
"has_edr": false,
"account_id": "acc_xyz789",
"organization_id": "org_abc123",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z"
}
}
Examples
Update case name
curl -X PUT "https://api.silentwitness.ai/api/cases/case_abc123" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Smith v. Johnson (Amended)"
}'
Link damage photos to plaintiff vehicle
After uploading photos via /api/files/upload, link them to enable automatic delta-v calculation:
curl -X PUT "https://api.silentwitness.ai/api/cases/case_abc123" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"vehicles": [
{
"role": "plaintiff",
"image_file_ids": [
"file_front_damage_001",
"file_rear_damage_002",
"file_side_damage_003"
]
}
]
}'
Update accident information and vehicles
curl -X PUT "https://api.silentwitness.ai/api/cases/case_abc123" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accident": {
"description": "Rear-end collision at red light. Defendant struck plaintiff from behind.",
"date": "2024-01-10",
"time": "14:30",
"location": "123 Main St, Los Angeles, CA"
},
"vehicles": [
{
"role": "plaintiff",
"vehicle_maker": "Toyota",
"vehicle_model": "Camry",
"vehicle_year": "2020",
"vehicle_vin": "4T1B11HK5LU123456",
"vehicle_type": "sedan"
},
{
"role": "defendant",
"vehicle_maker": "Ford",
"vehicle_model": "F-150",
"vehicle_year": "2019",
"vehicle_type": "truck"
}
]
}'
Update occupants
curl -X PUT "https://api.silentwitness.ai/api/cases/case_abc123" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"occupants": [
{
"name": "John Smith",
"age": 45,
"gender": "male",
"height_inches": 70,
"weight_lbs": 180,
"position": "driver",
"seatbelt_worn": true,
"airbag_deployed": "yes",
"alleged_injuries": ["cervical_spine", "lumbar_spine"],
"injury_severity": "moderate"
},
{
"name": "Jane Smith",
"age": 42,
"gender": "female",
"height_inches": 65,
"weight_lbs": 140,
"position": "front_passenger",
"seatbelt_worn": true,
"airbag_deployed": "yes",
"alleged_injuries": ["shoulder"],
"injury_severity": "minor"
}
]
}'
Archive a case
curl -X PUT "https://api.silentwitness.ai/api/cases/case_abc123" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "archived"
}'
Errors
| Code | Description |
|---|---|
| 400 | Invalid request body |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Access denied to this case |
| 404 | Case not found |
| 500 | Internal server error |