Skip to main content

Create Report

Create a new accident reconstruction report using uploaded vehicle damage photos, vehicle metadata, and accident context.

VehicleData Structure

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

FieldTypeRequiredDescription
imageFileIdsstring[]YesArray of file IDs for vehicle damage photos (1-20 files)
edrFileIdstringNoEDR (Event Data Recorder) file ID
vehicleMakerstringNoVehicle manufacturer (e.g., "Toyota")
vehicleModelstringNoVehicle model (e.g., "Camry")
vehicleYearstringNo4-digit year (e.g., "2020")
vehicleVinstringNo17-character Vehicle Identification Number
seatbeltbooleanNoSeatbelt worn (default: true)
airbagsDeployedenumNoUNKNOWN (default), YES, or NO

Request Parameters

ParameterTypeRequiredDescription
caseIdstringYesCase ID to associate the report with
plaintiffVehicleDataYesPlaintiff vehicle data
defendantVehicleDataNoDefendant vehicle data (omit for single-vehicle)
accidentDescriptionstringNoNarrative description of the accident
accidentDatestringNoDate in YYYY-MM-DD format
accidentTimestringNoTime in HH:MM format
accidentLocationstringNoLocation description or address

Response

Returns:

  • reportId: Unique report identifier

Examples

Vehicle Collision

import "github.com/silentwitness/go-sdk"

silentwitness.Key = "sk_test_..."

// Two-vehicle crash with full metadata
response, err := silentwitness.Reports.Create(ctx, &silentwitness.CreateCrashReportRequest{
CaseId: silentwitness.String("case_xyz789"),

// Plaintiff vehicle
Plaintiff: &silentwitness.VehicleData{
ImageFileIds: []string{"file_p1", "file_p2", "file_p3"},
EdrFileId: silentwitness.String("edr_plaintiff"),
VehicleMaker: silentwitness.String("Toyota"),
VehicleModel: silentwitness.String("Camry"),
VehicleYear: silentwitness.String("2020"),
VehicleVin: silentwitness.String("1HGBH41JXMN109186"),
Seatbelt: silentwitness.Bool(true),
AirbagsDeployed: silentwitness.AirbagsDeployed(silentwitness.AirbagsDeployedYes),
},

// Defendant vehicle
Defendant: &silentwitness.VehicleData{
ImageFileIds: []string{"file_d1", "file_d2"},
VehicleMaker: silentwitness.String("Honda"),
VehicleModel: silentwitness.String("Accord"),
VehicleYear: silentwitness.String("2019"),
Seatbelt: silentwitness.Bool(true),
AirbagsDeployed: silentwitness.AirbagsDeployed(silentwitness.AirbagsDeployedYes),
},

// Accident context
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)

Errors

CodeDescription
INVALID_ARGUMENTInvalid parameters, file IDs, or format violations
NOT_FOUNDOne or more files not found
FAILED_PRECONDITIONFiles not ready for processing
RESOURCE_EXHAUSTEDRate limit exceeded
UNAUTHENTICATEDInvalid or missing API key