Create Case
Creates a new case in your account. You can include vehicles, occupants, and accident information in a single request.
POST /api/cases
Request Body
{
"name": "string",
"plaintiff_name": "string",
"defendant_name": "string",
"attorney_name": "string",
"side": "plaintiff | defense",
"analysis_type": "accident_only | accident_injury | delta_v_only | biomechanics_only",
"organization_id": "string",
"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
Required Fields
-
plaintiff_namestring, required Plaintiff name (injured party). Used for auto-generating case name if not provided. -
defendant_namestring, required Defendant name (at-fault party). Used for auto-generating case name if not provided. -
attorney_namestring, required Attorney name handling the case
Optional Fields
-
namestring, optional Case name or title. If not provided, auto-generated as "PlaintiffLastName v. DefendantLastName" (e.g., "Smith v. Johnson") -
sidestring, optional Which party the attorney represents. One of:plaintiffordefense. Defaults toplaintiff. -
analysis_typestring, optional Type of analysis to run on this case. Defaults toaccident_only.Value Description Requires Occupants? accident_onlyCrash analysis only (default) No accident_injuryCrash analysis + biomechanics Yes delta_v_onlyDelta-V calculation only No biomechanics_onlyBiomechanics analysis only Yes See Analysis Types Guide for detailed usage and examples.
-
organization_idstring, optional Organization ID to associate the case with
Accident Information
-
accidentobject, optional Accident informationaccident.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 involved in the accidentvehicles[].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
Occupants
-
occupantsarray of objects, optional List of vehicle occupants for biomechanics analysisoccupants[].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": {
"case": {
"id": "case_abc123def456",
"name": "Smith v. Johnson",
"plaintiff_name": "John Smith",
"defendant_name": "Mike Johnson",
"attorney_name": "Jane Attorney",
"side": "plaintiff",
"analysis_type": "accident_only",
"has_edr": false,
"account_id": "acc_xyz789",
"organization_id": "org_abc123",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"invoice": {
"id": "inv_xyz789",
"amount": 299.00,
"status": "pending"
}
}
}
Examples
Basic case creation (auto-generated name)
Create a case with just the required fields. The case name will be auto-generated as "Smith v. Johnson":
curl -X POST "https://api.silentwitness.ai/api/cases" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"plaintiff_name": "John Smith",
"defendant_name": "Mike Johnson",
"attorney_name": "Jane Attorney"
}'
Basic case creation (custom name)
Create a case with a custom name:
curl -X POST "https://api.silentwitness.ai/api/cases" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Smith v. Johnson - Car Accident 2024",
"plaintiff_name": "John Smith",
"defendant_name": "Mike Johnson",
"attorney_name": "Jane Attorney"
}'
Full case with all data
Create a case with vehicles, occupants, and accident information in a single request. The case name will be auto-generated as "Smith v. Johnson":
curl -X POST "https://api.silentwitness.ai/api/cases" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"plaintiff_name": "John Smith",
"defendant_name": "Mike Johnson",
"attorney_name": "Jane Attorney",
"organization_id": "org_abc123",
"accident": {
"description": "Rear-end collision at red light. Defendant struck plaintiff from behind while plaintiff was stopped.",
"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"
}
],
"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"
}
]
}'
Errors
| Code | Description |
|---|---|
| 400 | Invalid request body - missing required fields |
| 401 | Unauthorized - Invalid or missing API key |
| 500 | Internal server error |
Recommended Workflow
After creating a case with all data:
1. POST /api/cases → Create case with vehicles, occupants, accident info
2. POST /api/files/upload → Upload plaintiff damage photos
3. PUT /api/cases/:id → Link file IDs to plaintiff vehicle
4. POST /api/reports → Create report (auto-triggers delta-v calculation)
5. GET /api/reports/:id → Poll for completion
See Update Case for linking uploaded file IDs. See Create Report and Get Report for the Stripe-style reports API.