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:
| Field | Type | Required | Description |
|---|---|---|---|
imageFileIds | string[] | Yes | Array of file IDs for vehicle damage photos (1-20 files) |
edrFileId | string | No | EDR (Event Data Recorder) file ID |
vehicleMaker | string | No | Vehicle manufacturer (e.g., "Toyota") |
vehicleModel | string | No | Vehicle model (e.g., "Camry") |
vehicleYear | string | No | 4-digit year (e.g., "2020") |
vehicleVin | string | No | 17-character Vehicle Identification Number |
seatbelt | boolean | No | Seatbelt worn (default: true) |
airbagsDeployed | enum | No | UNKNOWN (default), YES, or NO |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
caseId | string | Yes | Case ID to associate the report with |
plaintiff | VehicleData | Yes | Plaintiff vehicle data |
defendant | VehicleData | No | Defendant vehicle data (omit for single-vehicle) |
accidentDescription | string | No | Narrative description of the accident |
accidentDate | string | No | Date in YYYY-MM-DD format |
accidentTime | string | No | Time in HH:MM format |
accidentLocation | string | No | Location description or address |
Response
Returns:
reportId: Unique report identifier
Examples
Vehicle Collision
- Go
- TypeScript
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)
import { setApiKey, createReport, AirbagsDeployed } from "@silentwitness/typescript-sdk";
setApiKey("sk_test_...");
// Two-vehicle crash with full metadata
const response = await createReport({
caseId: "case_xyz789",
// Plaintiff vehicle
plaintiff: {
imageFileIds: ["file_p1", "file_p2", "file_p3"],
edrFileId: "edr_plaintiff",
vehicleMaker: "Toyota",
vehicleModel: "Camry",
vehicleYear: "2020",
vehicleVin: "1HGBH41JXMN109186",
seatbelt: true,
airbagsDeployed: AirbagsDeployed.YES
},
// Defendant vehicle
defendant: {
imageFileIds: ["file_d1", "file_d2"],
vehicleMaker: "Honda",
vehicleModel: "Accord",
vehicleYear: "2019",
seatbelt: true,
airbagsDeployed: AirbagsDeployed.YES
},
// Accident context
accidentDescription: "Intersection collision, defendant ran red light",
accidentDate: "2024-03-15",
accidentTime: "14:30",
accidentLocation: "Main St & 5th Ave, Springfield"
});
console.log(`Report ID: ${response.reportId}`);
Errors
| Code | Description |
|---|---|
INVALID_ARGUMENT | Invalid parameters, file IDs, or format violations |
NOT_FOUND | One or more files not found |
FAILED_PRECONDITION | Files not ready for processing |
RESOURCE_EXHAUSTED | Rate limit exceeded |
UNAUTHENTICATED | Invalid or missing API key |