Skip to content

Instantly share code, notes, and snippets.

@DriveQuantPublic
Created January 16, 2026 10:17
Show Gist options
  • Select an option

  • Save DriveQuantPublic/0b3e8225f606487882c2b1d43cae061c to your computer and use it in GitHub Desktop.

Select an option

Save DriveQuantPublic/0b3e8225f606487882c2b1d43cae061c to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: PushCrashReportData
version: '1.0'
description: ''
servers:
- url: 'https://api.example.com'
description: 'My Company API Server'
paths:
/push/crash/report:
post:
summary: 'Push crash report data'
operationId: post-push-crash-report
responses:
'200':
description: OK
'401':
description: Unauthorized
description: 'The push crash data API receives the crash data sent by the DriveKit SDK integrated into a mobile application, and allows DriveQuant to process and analyze crash events.'
parameters:
- schema:
type: string
in: header
description: 'Authorization header (preferably OAuth2 token)'
name: Authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CrashReport'
components:
schemas:
CrashReport:
type: object
required:
- info
- tripConditions
- driverFatigue
- aggressiveDriving
- phoneUsage
- riskFactors
properties:
info:
$ref: '#/components/schemas/CrashInfo'
tripConditions:
$ref: '#/components/schemas/TripConditions'
driverFatigue:
$ref: '#/components/schemas/DriverFatigue'
aggressiveDriving:
$ref: '#/components/schemas/AggressiveDriving'
phoneUsage:
$ref: '#/components/schemas/PhoneUsage'
speeding:
$ref: '#/components/schemas/Speeding'
riskFactors:
$ref: '#/components/schemas/RiskFactors'
CrashInfo:
type: object
required:
- crashId
- itinId
- userId
- teamName
- crashDate
- tripStartDate
- tripEndDate
properties:
crashId:
type: string
description: Unique identifier of the crash
example: "695cdaa9c48d52239bffa7da"
itinId:
type: string
description: Unique identifier of the itinerary
example: "695cdab2f1ac586b8354f596"
userId:
type: string
description: User unique identifier
example: "af1bc789-9acd-48c7-b017-088cc7725e21"
teamName:
type: string
description: Team name
example: "mycompany"
crashDate:
type: string
format: date-time
description: Crash date and time (ISO 8601)
example: "2025-10-18T09:40:57.330+0000"
tripStartDate:
type: string
format: date-time
description: Trip start date and time (ISO 8601)
example: "2025-10-18T14:02:13.330+0000"
tripEndDate:
type: string
format: date-time
description: Trip end date and time (ISO 8601)
example: "2025-10-18T14:24:56.330+0000"
TripConditions:
type: object
required:
- weather
- roadContext
- day
properties:
weather:
type: string
enum:
- UNAVAILABLE
- UNKNOWN
- CLEAR_SKY
- CLOUDY
- FOGGY
- RAINY
- SNOWY
- ICY
description: Weather conditions
example: "CLEAR_SKY"
roadContext:
type: string
enum:
- TRAFFIC_JAM
- HEAVY_URBAN_TRAFFIC
- CITY
- SUBURBAN
- EXPRESSWAYS
description: Road context
example: "SUBURBAN"
day:
type: boolean
description: Indicates if the crash happened during the day (true) or at night (false)
example: true
DriverFatigue:
type: object
required:
- tripDistance
- tripDuration
- last12HoursDistance
- last12HoursDuration
- breakTime
properties:
tripDistance:
type: number
format: float
description: Trip distance in kilometers
example: 15.54
tripDuration:
type: integer
description: Trip duration in seconds
example: 1363
last12HoursDistance:
type: number
format: float
description: Distance traveled in the last 12 hours in kilometers
example: 202
last12HoursDuration:
type: integer
description: Driving time in the last 12 hours in seconds
example: 17719
breakTime:
type: integer
description: Break time between the previous trip and the current trip in seconds
example: 7637
AggressiveDriving:
type: object
required:
- safetyScoreAverage
- safetyScoreTrip
- hardBrakingFreqAverage
- hardBrakingFreqTrip
properties:
safetyScoreAverage:
type: number
format: float
minimum: 0
maximum: 11
description: Average safety score
example: 9.0
safetyScoreTrip:
type: number
format: float
minimum: 0
maximum: 11
description: Trip safety score
example: 8.2
hardBrakingFreqAverage:
type: number
format: float
description: Average hard braking frequency
example: 10.6
hardBrakingFreqTrip:
type: number
format: float
description: Trip hard braking frequency
example: 38.6
PhoneUsage:
type: object
required:
- distractionScoreAverage
- distractionScoreTrip
- unlocksTrip
- callDurationTrip
- callForbiddenDurationTrip
- distractionToCrashTime
- lastDistractionType
properties:
distractionScoreAverage:
type: number
format: float
minimum: 0
maximum: 11
description: Average distraction score
example: 8.31
distractionScoreTrip:
type: number
format: float
minimum: 0
maximum: 11
description: Trip distraction score
example: 4.45
unlocksTrip:
type: integer
minimum: 0
description: Number of phone unlocks during the trip
example: 3
callDurationTrip:
type: integer
minimum: 0
description: Total call duration during the trip in seconds
example: 3
callForbiddenDurationTrip:
type: integer
minimum: 0
description: Duration of forbidden calls during the trip in seconds
example: 3
distractionToCrashTime:
type: integer
description: Time between the last distraction and the crash in seconds (if the distraction occurred less than 60 sec before the crash, otherwise 0)
example: 0
lastDistractionType:
type: string
enum:
- AUTHORIZED_CALL_START
- AUTHORIZED_CALL_END
- FORBIDDEN_CALL_START
- FORBIDDEN_CALL_END
- PHONE_UNLOCK
- PHONE_LOCK
- UNAVAILABLE
description: Type of the last distraction
example: "UNAVAILABLE"
Speeding:
type: object
nullable: true
required:
- speedingScoreAverage
- speedingScoreTrip
- speedingDistanceTrip
- speedingDurationTrip
- speedingBeforeCrash
properties:
speedingScoreAverage:
type: number
format: float
minimum: 0
maximum: 11
description: Average speeding score
example: 7.01
speedingScoreTrip:
type: number
format: float
minimum: 0
maximum: 11
description: Trip speeding score
example: 6.2
speedingDistanceTrip:
type: number
format: float
minimum: 0
description: Trip speeding distance in meters
example: 773.0
speedingDurationTrip:
type: integer
minimum: 0
description: Trip speeding duration in seconds
example: 24
speedingBeforeCrash:
type: integer
minimum: 0
description: Mean velocity above the speed limit in km/h during the 20 seconds before the crash
example: 0
RiskFactors:
type: object
required:
- tripConditions
- driverFatigue
- aggressiveDriving
- phoneUse
- speeding
properties:
tripConditions:
type: string
enum:
- LOW
- HIGH
description: Evaluation of the risk related to trip conditions
example: "LOW"
driverFatigue:
type: string
enum:
- LOW
- HIGH
description: Evaluation of the risk related to driver fatigue
example: "LOW"
aggressiveDriving:
type: string
enum:
- LOW
- HIGH
description: Evaluation of the risk related to aggressive driving
example: "HIGH"
phoneUse:
type: string
enum:
- LOW
- HIGH
description: Evaluation of the risk related to phone use
example: "HIGH"
speeding:
type: string
nullable: true
enum:
- LOW
- HIGH
description: Evaluation of the risk related to speeding
example: "LOW"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment