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",
"user_email": "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",
"airbag_deployed": "yes | no | partial | unknown",
"deployed_airbags": ["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",
"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 -
user_emailstring, optional Email of a team member in your account to link this case to. The email must belong to an existing user in the same account. If not provided, the case is linked to the authenticated user (web app) or has no user association (API key). Case-insensitive.
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[].airbag_deployedstring - Vehicle-level summary status:yes,no,partial, orunknown. If omitted, the API infersyesfrom anydeployed_airbagscodes (unless an existing record ispartial).vehicles[].deployed_airbagsarray of strings - Optional detail codes for the specific airbags that deployed. Existing integrations can omit this field and continue using onlyairbag_deployed. If this field is provided with one or more values andairbag_deployedis omitted, the API storesairbag_deployedasyes. Ifairbag_deployedisnoorunknown, this is stored as an empty array. See Vehicle Airbag Deployment for allowed values.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 analysis. Required foraccident_injuryanalysis type — report creation will return 422 (occupants_missing) if no occupants exist.When provided, each occupant must include all required fields or the request returns 400 (
occupant_field_required).Required fields:
occupants[].namestring, required - Occupant's full nameoccupants[].ageinteger, required - Age in years (must be > 0)occupants[].genderstring, required - One of:male,femaleoccupants[].height_inchesinteger, required - Height in inches (must be > 0)occupants[].weight_lbsinteger, required - Weight in pounds (must be > 0)occupants[].positionstring, required - Seating position:driver,front_passenger,rear_left,rear_center,rear_rightoccupants[].seatbelt_wornboolean, required - Whether seatbelt was worn
Optional fields:
occupants[].alleged_injuriesarray of strings - Injury types:head_brain,cervical_spine,thoracic_spine,lumbar_spine,shoulder,hip,knee,foot_ankleoccupants[].airbag_deployedstring - One of:yes,no,partial,unknownoccupants[].pre_existing_conditionsstring - Description of pre-existing medical 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"
}'
Create case linked to a team member (API key)
When using an API key, you can optionally link the case to a specific team member by providing their email:
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",
"user_email": "jane@lawfirm.com"
}'
If user_email is omitted, the case is created at the account level without a specific user association.
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",
"airbag_deployed": "yes",
"deployed_airbags": ["driver_frontal", "driver_knee"]
},
{
"role": "defendant",
"vehicle_maker": "Ford",
"vehicle_model": "F-150",
"vehicle_year": "2019",
"vehicle_type": "truck",
"airbag_deployed": "no"
}
],
"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"]
}
]
}'
Errors
| Code | Description |
|---|---|
| 400 | Invalid request body - missing required fields or invalid enum values |
| 400 | user_email not found in this account |
| 401 | Unauthorized - Invalid or missing API key |
| 500 | Internal server error |
Error Examples
Missing required field:
{
"success": false,
"error": "plaintiff_name is required",
"error_code": "bad_request",
"error_type": "invalid_request_error",
"request_id": "req_..."
}
Invalid enum value:
{
"success": false,
"error": "Invalid analysis_type: invalid_value. Must be one of: accident_only, accident_injury, delta_v_only, biomechanics_only",
"error_code": "bad_request",
"error_type": "invalid_request_error",
"request_id": "req_..."
}
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.