Safety score (V2)
Safety score
Trip safety scores for a vehicle over a date range.
GET
Safety score (V2)
Overview
Returns trip-level safety scores for the specified vehicle. Supports explicit date ranges or preset time windows viaintervalType.
The V1 version of this endpoint is Safety score.
Rate limit: 30 requests per 60 seconds per token.
Endpoint
GET /api/v2/safety-score/{id}
Path parameters
Legacy vehicle ID.
Query parameters
Range start. Optional when
intervalType is supplied.Range end. Optional when
intervalType is supplied.Preset window, used only when
start and finish are omitted:1— instant range (usesDateTime.UtcNowas start)2— relative to end of today in the user’s timezone3— three-day window4— week window
⚠️ The window arithmetic uses a double-negative (-TimeSpan.FromDays(-N)) which adds days tofinishfor types 2–4. Validate results in staging before using preset windows in production.
Response
200 OK — array of trip safety score objects.| Field | Type | Description |
|---|---|---|
| startTime | datetime | Trip start time |
| endTime | datetime | Trip end time |
| riskLevel | string | "Low", "Medium", or "High" |
| riskScore | integer (0–100) | Numeric risk score; lower is safer |
| duration | integer | Trip duration in seconds |
| distance | number | Trip distance in km |
Error responses
| Status | Meaning |
|---|---|
| 401 | Token does not have access to this vehicle |
| 403 | Token scope does not include safety score access |
| 404 | Vehicle not found |
| 400 | Invalid date range |
Authorizations
JWT Bearer token obtained from POST /api/v2/authentication/token/api-key.
Lifetime: ~24 hours (86,399 seconds). Cache the token and reuse it. Re-authenticate 5 minutes before expiry.
Scoping: API key tokens are scoped to the company the key belongs to and may restrict access to a vehicle allowlist and/or action set (see token claims).
No refresh endpoint — re-authenticate with your API key when the token expires.
Path Parameters
Query Parameters
Preset window: 1=instant, 2=today, 3=3-day, 4=week.
Response
Successful response