Skip to main content

Create Report

Creates a new report for a case.

Endpoint

POST /api/reports

Request Body

FieldTypeRequiredDescription
case_idstringYesThe ID of the case to generate the report for
typestringYesThe type of report to generate. Currently supported: technical_report
optionsobjectNoOptional configuration for report generation
options.include_biomechanicsbooleanNoWhether to include biomechanics analysis (default: false)
options.use_demo_databooleanNoUse synthetic demo data instead of ML inference (default: false). See below.

Demo Data Option

When use_demo_data is set to true, the system uses pre-generated synthetic crash parameters instead of running the ML inference model. This is useful for:

  • SDK testing: Validate your integration without waiting for ML processing
  • Development environments: Test report generation without a configured ML model
  • Quick demonstrations: Generate reports immediately with realistic sample data

Demo data provides representative delta-v values and crash parameters that produce a valid technical report, but does not reflect actual analysis of uploaded vehicle photos.

Request Example

curl -X POST https://api.silentwitness.ai/api/reports \
-H "X-API-Key: sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"case_id": "case_abc123",
"type": "technical_report",
"options": {
"include_biomechanics": true
}
}'

Response

Success (200 OK)

{
"success": true,
"data": {
"id": "rpt_xyz789",
"case_id": "case_abc123",
"type": "technical_report",
"status": "pending",
"progress": {
"message": "Starting analysis..."
},
"output": null,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
}

Error (400 Bad Request)

{
"success": false,
"error": "case_id is required"
}
{
"success": false,
"error": "Invalid report type: invalid_type. Supported types: technical_report"
}

Notes

  • The report generation is asynchronous. The response returns immediately with status: "pending".
  • Poll GET /api/reports/:id to check the status and get the final output URLs.
  • For technical_report type, the workflow automatically:
    • Triggers delta-v calculation if vehicle images are available
    • Runs biomechanics analysis if include_biomechanics is true and occupants are defined
    • Generates the final PDF and DOCX reports