This endpoint is still on our legacy API.
Fetch the safety score for the vehicle.
Rate limit: 5 requests/sec (learn more about rate limits here).
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.
To use this endpoint, select Read Safety Events & Scores under the Safety & Cameras category when creating or editing an API token. Learn More.
curl --request GET \
--url https://api.samsara.com/v1/fleet/vehicles/{vehicleId}/safety/score \
--header 'Authorization: Bearer <token>'{
"crashCount": 0,
"harshAccelCount": 1,
"harshBrakingCount": 2,
"harshEvents": [
{
"harshEventType": "Harsh Braking",
"timestampMs": 1535590776000,
"vehicleId": 212014918086169
}
],
"harshTurningCount": 0,
"safetyScore": 97,
"safetyScoreRank": "26",
"timeOverSpeedLimitMs": 3769,
"totalDistanceDrivenMeters": 291836,
"totalHarshEventCount": 3,
"totalTimeDrivenMs": 19708293,
"vehicleId": 4321
}Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
ID of the vehicle. Must contain only digits 0-9.
Timestamp in milliseconds representing the start of the period to fetch, inclusive. Used in combination with endMs. Total duration (endMs - startMs) must be greater than or equal to 1 hour.
Timestamp in milliseconds representing the end of the period to fetch, inclusive. Used in combination with startMs. Total duration (endMs - startMs) must be greater than or equal to 1 hour.
Safety score details.
Safety score details for a vehicle
Crash event count
0
Harsh acceleration event count
1
Harsh braking event count
2
Show child attributes
Harsh turning event count
0
The vehicle’s Safety Score for the requested period. Note that if the vehicle has zero drive time in this period, the Safety Score will be returned as 100.
97
Safety Score Rank
"26"
Amount of time driven over the speed limit in milliseconds
3769
Total distance driven in meters
291836
Total harsh event count
3
Amount of time driven in milliseconds
19708293
Vehicle ID
4321
curl --request GET \
--url https://api.samsara.com/v1/fleet/vehicles/{vehicleId}/safety/score \
--header 'Authorization: Bearer <token>'{
"crashCount": 0,
"harshAccelCount": 1,
"harshBrakingCount": 2,
"harshEvents": [
{
"harshEventType": "Harsh Braking",
"timestampMs": 1535590776000,
"vehicleId": 212014918086169
}
],
"harshTurningCount": 0,
"safetyScore": 97,
"safetyScoreRank": "26",
"timeOverSpeedLimitMs": 3769,
"totalDistanceDrivenMeters": 291836,
"totalHarshEventCount": 3,
"totalTimeDrivenMs": 19708293,
"vehicleId": 4321
}