Safety

Fetch vehicle safety scores

🚧 This endpoint is still on our legacy API.

Fetch the safety score for the vehicle.

<b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> 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. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

get/v1/fleet/vehicles/{vehicleId}/safety/score

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Path parameters

vehicleIdinteger required

ID of the vehicle. Must contain only digits 0-9.

Query parameters

startMsinteger required

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.

endMsinteger required

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.

Response

Safety score details.

crashCountinteger

Crash event count

harshAccelCountinteger

Harsh acceleration event count

harshBrakingCountinteger

Harsh braking event count

harshTurningCountinteger

Harsh turning event count

safetyScoreinteger

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.

safetyScoreRankstring

Safety Score Rank

timeOverSpeedLimitMsinteger

Amount of time driven over the speed limit in milliseconds

totalDistanceDrivenMetersinteger

Total distance driven in meters

totalHarshEventCountinteger

Total harsh event count

totalTimeDrivenMsinteger

Amount of time driven in milliseconds

vehicleIdinteger

Vehicle ID

Example response

{
  "harshAccelCount": 1,
  "harshBrakingCount": 2,
  "harshEvents": [
    {
      "harshEventType": "Harsh Braking",
      "timestampMs": 1535590776000,
      "vehicleId": 212014918086169
    }
  ],
  "safetyScore": 97,
  "safetyScoreRank": "26",
  "timeOverSpeedLimitMs": 3769,
  "totalDistanceDrivenMeters": 291836,
  "totalHarshEventCount": 3,
  "totalTimeDrivenMs": 19708293,
  "vehicleId": 4321
}

Changes

No recorded changes to this operation across all 1 revision of this API.