Skip to main content

Create Report

Create a new accident reconstruction report using uploaded vehicle damage photos, vehicle metadata, and accident context. The API uses machine learning to compute crash dynamics (Delta-V, PDOF, impact type) from the uploaded evidence.

VehicleData Structure

Each vehicle (plaintiff and defendant) includes the following fields:

API FieldSDK FieldTypeRequiredDescription
image_file_idsImageFileIdsstring[]ConditionalVehicle damage photo file IDs (1-20 files). Required if edr_file_id not provided.
edr_file_idEdrFileIdstringConditionalEDR (Event Data Recorder) file ID. Required if image_file_ids not provided.
vehicle_makerVehicleMakerstringNoVehicle manufacturer (e.g., "Toyota")
vehicle_modelVehicleModelstringNoVehicle model (e.g., "Camry")
vehicle_yearVehicleYearstringNo4-digit year (e.g., "2020")
vehicle_vinVehicleVINstringNo17-character Vehicle Identification Number
vehicle_typeVehicleTypestringNoVehicle type: "sedan", "suv", "truck", "van", "coupe", "compact", "motorcycle"
Seatbelt & Airbag Data

Seatbelt and airbag information is provided per-occupant, not per-vehicle. This allows accurate modeling when different occupants have different safety equipment status (e.g., driver wearing seatbelt but passenger not). See OccupantData structure below for seatbeltWorn and airbagDeployed fields.

Evidence Requirements

At least one of imageFileIds or edrFileId must be provided. You can provide both for more accurate analysis.

Request Parameters

API FieldSDK FieldTypeRequiredDescription
case_idCaseIDstringYesCase ID to associate the report with
typeTypeReportTypeYesReport type: technical_report
plaintiffPlaintiffVehicleDataYesPlaintiff vehicle data
defendantDefendantVehicleDataNoDefendant vehicle data (omit for single-vehicle crashes)
accident_descriptionAccidentDescriptionstringNoNarrative description of the accident
accident_dateAccidentDatestringNoDate in YYYY-MM-DD format
accident_timeAccidentTimestringNoTime in HH:MM format
accident_locationAccidentLocationstringNoLocation description or address
occupantsOccupantsOccupantData[]NoOccupant data for integrated biomechanics analysis (1-10 occupants)

Report Types

ValueDescription
technical_reportAccident reconstruction with crash dynamics
research_scrutinizerNot implemented yet
cross_examinationNot implemented yet

Computed Fields

The following crash parameters are computed automatically by ML inference from your uploaded evidence. You do not provide these as inputs:

  • Delta-V (change in velocity) - Computed from damage patterns or EDR data
  • PDOF (Principal Direction of Force) - Inferred from damage location and severity
  • Impact Type (frontal, rear, side) - Derived from PDOF angle
  • Collision Type - Derived from PDOF angle
  • Peak Acceleration - Computed from EDR data when available

Response

Returns:

  • reportId: The created report identifier

Examples

Basic Two-Vehicle Collision

package main

import (
"context"
"fmt"
"log"
"os"

silentwitness "github.com/silentwitness/sw-go-sdk"
)

func main() {
// Create client
client := silentwitness.NewClient(silentwitness.Config{
APIKey: os.Getenv("SW_API_KEY"),
})
defer client.Close()

ctx := context.Background()

// Upload vehicle damage photos first (see Files API)
// plaintiffFileIDs := []string{"file_abc123", "file_def456"}

// Create technical report with explicit type
response, err := client.CreateReport(ctx, &silentwitness.CreateReportParams{
CaseID: "case_xyz789",
Type: silentwitness.ReportTypeTechnicalReport,
Plaintiff: &silentwitness.VehicleDataParams{
ImageFileIds: plaintiffFileIDs,
VehicleMaker: silentwitness.String("Toyota"),
VehicleModel: silentwitness.String("Camry"),
VehicleYear: silentwitness.String("2020"),
VehicleVIN: silentwitness.String("4T1BF1FK5LU123456"),
VehicleType: silentwitness.String("sedan"),
// Seatbelt/airbag data is per-occupant - see OccupantDataParams
},
Defendant: &silentwitness.VehicleDataParams{
VehicleMaker: silentwitness.String("Ford"),
VehicleModel: silentwitness.String("F-150"),
VehicleYear: silentwitness.String("2019"),
VehicleType: silentwitness.String("truck"),
},
AccidentDescription: silentwitness.String("Intersection collision, defendant ran red light"),
AccidentDate: silentwitness.String("2024-03-15"),
AccidentTime: silentwitness.String("14:30"),
AccidentLocation: silentwitness.String("Main St & 5th Ave, Springfield"),
})
if err != nil {
log.Fatal(err)
}

fmt.Printf("Report ID: %s\n", response.ReportID)
}

With Integrated Biomechanics Analysis

Include occupant data to automatically generate biomechanics analysis alongside the crash reconstruction:

// Technical report with biomechanics for one occupant
response, err := client.CreateReport(ctx, &silentwitness.CreateReportParams{
CaseID: "case_xyz789",
Type: silentwitness.ReportTypeTechnicalReport,
Plaintiff: &silentwitness.VehicleDataParams{
ImageFileIds: plaintiffFileIDs,
VehicleMaker: silentwitness.String("Toyota"),
VehicleModel: silentwitness.String("Camry"),
VehicleYear: silentwitness.String("2020"),
VehicleType: silentwitness.String("sedan"),
},
AccidentDescription: silentwitness.String("Rear-end collision at stoplight"),
AccidentDate: silentwitness.String("2024-03-15"),

// Include occupant for biomechanics analysis
// Seatbelt and airbag data is per-occupant, not per-vehicle
Occupants: []silentwitness.OccupantDataParams{
{
Name: silentwitness.String("Sarah Johnson"),
Age: silentwitness.Int32(42),
Gender: silentwitness.String("female"),
HeightInches: silentwitness.Int32(65), // 5'5"
WeightLbs: silentwitness.Int32(150),
Position: silentwitness.String("driver"),
AllegedInjuries: []string{
"cervical_spine", // Neck injury
"lumbar_spine", // Lower back injury
"shoulder", // Shoulder injury
},
InjurySeverity: silentwitness.String("moderate"),
PreExistingConditions: silentwitness.String("Prior lumbar disc herniation at L4-L5"),
SeatbeltWorn: silentwitness.Bool(true),
AirbagDeployed: silentwitness.String("no"),
Vehicle: silentwitness.String("plaintiff"),
SeatingLocation: silentwitness.String("front-left"),
},
},
})
if err != nil {
log.Fatal(err)
}

// The report includes integrated biomechanics analysis when occupants are provided
fmt.Printf("Technical Report ID: %s\n", response.ReportID)

OccupantData Structure (for Biomechanics)

When including occupants for integrated biomechanics analysis:

API FieldSDK FieldTypeRequiredDescription
nameNamestringNoOccupant name
ageAgeint32YesAge in years (1-120)
genderGenderstringYes"male", "female", or "other"
height_inchesHeightInchesint32NoHeight in inches (e.g., 70 for 5'10")
weight_lbsWeightLbsint32NoWeight in pounds
positionPositionstringYes"driver", "front_passenger", "rear_left", "rear_center", "rear_right"
alleged_injuriesAllegedInjuriesstring[]YesAt least one injury type (see below)
injury_severityInjurySeveritystringNo"minor", "moderate", "serious", "severe", "critical"
pre_existing_conditionsPreExistingConditionsstringNoPre-existing medical conditions
seatbelt_wornSeatbeltWornbooleanNoPer-occupant seatbelt usage (default: true)
airbag_deployedAirbagDeployedstringNoPer-occupant airbag status: "yes", "no", "partial", "unknown"
vehicleVehiclestringNo"plaintiff" or "defendant"
seating_locationSeatingLocationstringNo"front-left", "front-right", "rear-left", "rear-center", "rear-right"

Injury Types

  • head_brain - Traumatic brain injury, concussion
  • cervical_spine - Neck injuries, whiplash
  • thoracic_spine - Upper back injuries
  • lumbar_spine - Lower back injuries
  • shoulder - Shoulder injuries
  • hip - Hip injuries
  • knee - Knee injuries
  • foot_ankle - Foot and ankle injuries

Errors

CodeDescription
INVALID_ARGUMENTInvalid parameters, missing required fields, or format violations
NOT_FOUNDCase or file not found
FAILED_PRECONDITIONFiles not ready for processing
RESOURCE_EXHAUSTEDRate limit exceeded
UNAUTHENTICATEDInvalid or missing API key

Next Steps

After creating a report, poll for completion:

  • Get Result - Check status and download the PDF when ready