Safety

Get Safety Events

This endpoint will return details for the specified safety events based on the parameters passed in. Results are paginated.

<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>).

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>

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.

get/safety-events

Request

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

Query parameters

safetyEventIdsstring[] required

Required string of comma separated Safety Event IDs. Unique Samsara IDs (uuid) of the safety event.

includeAssetboolean

Indicates whether or not to return expanded “asset” data

includeDriverboolean

Indicates whether or not to return expanded “driver” data

includeVgOnlyEventsboolean

Indicates whether or not to return events that are captured by devices with only a Vehicle Gateway (VG) installed.

afterstring

If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.

Response

OK response.

Example response

{
  "data": [
    {
      "asset": {
        "attributes": [
          {
            "dateValues": [
              "2024-01-15",
              "2024-12-31"
            ],
            "id": "494123",
            "name": "Compliance/ELD",
            "numberValues": [
              867,
              5309
            ],
            "stringValues": [
              "HQ",
              "Leased"
            ]
          }
        ],
        "id": "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590,6caeb9c0-7e3d-49ae-a015-45c2f68fed4c",
        "name": "MyAsset-1234",
        "tags": [
          {
            "id": "3914",
            "name": "East Coast",
            "parentTagId": "4815"
          }
        ],
        "type": "trailer",
        "vin": "1GBJ6P1B2HV112765"
      },
      "assignedCoach": "0987",
      "behaviorLabels": [
        {
          "label": "Acceleration",
          "source": "automated"
        }
      ],
      "contextLabels": [
        {
          "authorId": "1234",
          "createdAtTime": "2023-01-27T07:06:25Z",
          "name": "Moderate Traffic"
        }
      ],
      "createdAtTime": "2023-01-27T07:06:25Z",
      "detectedStreams": [
        {
          "auxcamSerial": "ABC123",
          "cameraRole": "leftMirrorMount",
          "input": "dashcamRoadFacing",
          "url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
        }
      ],
      "dismissalReason": {
        "code": "incorrect",
        "comment": "minorEvent"
      },
      "driver": {
        "attributes": [
          {
            "dateValues": [
              "2024-01-15",
              "2024-12-31"
            ],
            "id": "494123",
            "name": "Compliance/ELD",
            "numberValues": [
              867,
              5309
            ],
            "stringValues": [
              "HQ",
              "Leased"
            ]
          }
        ],
        "id": "0987",
        "name": "Driver Name",
        "tags": [
          {
            "id": "3914",
            "name": "East Coast",
            "parentTagId": "4815"
          }
        ]
      },
      "endMs": "2023-01-27T07:06:25Z",
      "eventState": "needsCoaching",
      "id": "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590,6caeb9c0-7e3d-49ae-a015-45c2f68fed4c",
      "inboxEventUrl": "https://cloud.samsara.com/",
      "incidentReportUrl": "https://cloud.samsara.com/",
      "location": {
        "accuracyMeters": 5.801,
        "address": {
          "city": "New York",
          "country": "USA",
          "neighborhood": "Mission District",
          "pointOfInterest": "The Eiffel Tower",
          "postalCode": "10010",
          "state": "New York",
          "street": "Main Street",
          "streetNumber": "16"
        },
        "geofence": {
          "id": "12345"
        },
        "headingDegrees": 120,
        "latitude": 37.7749,
        "longitude": 137.2719
      },
      "maxAccelerationGForce": 1,
      "media": [
        {
          "auxcamSerial": "ABC123",
          "cameraRole": "leftMirrorMount",
          "input": "dashcamRoadFacing",
          "url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456"
        }
      ],
      "speedingMetadata": {
        "maxSpeedKilometersPerHour": 4263146179671302700,
        "postedSpeedLimitKilometersPerHour": 3315899840082544600
      },
      "startMs": "2023-01-27T07:01:25Z",
      "tripEndTime": "2023-01-27T07:06:25Z",
      "tripStartTime": "2023-01-27T07:06:25Z",
      "updatedAtTime": "2023-01-27T10:04:20Z",
      "updatedByUserId": "0987"
    }
  ],
  "pagination": {
    "endCursor": "MjkY",
    "hasNextPage": true
  }
}

Changes

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