Create Report
Creates a new report for a case.
Endpoint
POST /api/reports
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
case_id | string | Yes | The ID of the case to generate the report for |
type | string | Yes | The type of report to generate. Currently supported: technical_report |
options | object | No | Optional configuration for report generation |
options.include_biomechanics | boolean | No | Whether to include biomechanics analysis (default: false) |
options.use_demo_data | boolean | No | Use 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/:idto check the status and get the final output URLs. - For
technical_reporttype, the workflow automatically:- Triggers delta-v calculation if vehicle images are available
- Runs biomechanics analysis if
include_biomechanicsis true and occupants are defined - Generates the final PDF and DOCX reports