This endpoint will return all safety events associated with your organization based on the parameters passed in. To get core endpoint data, select Read Safety Events & Scores under the Safety & Cameras category when creating or editing an API token. Read Camera Media permissions required to get Safety Event video media via this endpoint. If you include an endTime, the endpoint will return data up until that point. If you do not include an endTime, you can continue to poll the API real-time with the pagination cursor that gets returned on every call. Results are paginated.
Rate limit: 5 requests/sec (learn more about rate limits here).
To use this endpoint, select Read Safety Events & Scores under the Safety & Cameras category when creating or editing an API token. Learn More.
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.
curl --request GET \
--url https://api.samsara.com/safety-events/stream \
--header 'Authorization: Bearer <token>'{
"data": [
{
"asset": {
"id": "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590,6caeb9c0-7e3d-49ae-a015-45c2f68fed4c",
"attributes": [
{
"dateValues": [
"2024-01-15",
"2024-12-31"
],
"id": "494123",
"name": "Compliance/ELD",
"numberValues": [
867,
5309
],
"stringValues": [
"HQ",
"Leased"
]
}
],
"externalIds": {},
"name": "MyAsset-1234",
"tags": [
{
"id": "3914",
"name": "East Coast",
"parentTagId": "4815"
}
],
"type": "trailer",
"vin": "1GBJ6P1B2HV112765"
},
"behaviorLabels": [
{
"label": "Acceleration",
"source": "automated"
}
],
"contextLabels": [
{
"authorId": "1234",
"createdAtTime": "2023-01-27T07:06:25Z",
"name": "Moderate Traffic"
}
],
"createdAtTime": "2023-01-27T07:06:25Z",
"driver": {
"id": "0987",
"attributes": [
{
"dateValues": [
"2024-01-15",
"2024-12-31"
],
"id": "494123",
"name": "Compliance/ELD",
"numberValues": [
867,
5309
],
"stringValues": [
"HQ",
"Leased"
]
}
],
"externalIds": {},
"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": {
"headingDegrees": 120,
"latitude": 37.7749,
"longitude": 137.2719,
"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": {
"externalIds": {},
"id": "12345"
}
},
"maxAccelerationGForce": 1,
"startMs": "2023-01-27T07:01:25Z",
"updatedAtTime": "2023-01-27T10:04:20Z",
"assignedCoach": "0987",
"detectedStreams": [
{
"input": "dashcamRoadFacing",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456",
"auxcamSerial": "ABC123",
"cameraRole": "leftMirrorMount"
}
],
"dismissalReason": {
"code": "incorrect",
"comment": "minorEvent"
},
"media": [
{
"input": "dashcamRoadFacing",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456",
"auxcamSerial": "ABC123",
"cameraRole": "leftMirrorMount"
}
],
"speedingMetadata": {
"maxSpeedKilometersPerHour": 6512700624259081000,
"postedSpeedLimitKilometersPerHour": 5891945604996125000
},
"tripEndTime": "2023-01-27T07:06:25Z",
"tripStartTime": "2023-01-27T07:06:25Z",
"updatedByUserId": "0987"
}
],
"pagination": {
"endCursor": "MjkY",
"hasNextPage": true
}
}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.
RFC 3339 timestamp that indicates when to begin receiving data. Value is compared against updatedAtTime or createdAtTime depending on the queryByTimeField parameter.
RFC 3339 timestamp. If not provided and filtering by updatedAtTime then the endpoint behaves as an unending feed of changes. If endTime is set the same as startTime, the most recent data point before that time will be returned per asset. Value is compared against updatedAtTime or createdAtTime depending on the queryByTimeField parameter.
Optional string that decides which field to compare against the provided time range. Valid values: updatedAtTime, createdAtTime
updatedAtTime, createdAtTime Optional string of comma separated asset IDs. If asset ID is present, events for the specified asset(s) will be returned. Limit of 2000 asset IDs.
Optional string of comma separated driver IDs. If driver ID is present, events for the specified driver(s) will be returned. Limit of 2000 driver IDs.
Optional string of comma separated tag IDs. If tag ID is present, events for the specified tag(s) will be returned. Limit of 2000 tag IDs.
Optional string of comma separated coach IDs to filter events assigned to a particular coach. Limit of 2000 coach IDs.
Optional string of comma separated values to filter behavior labels. Valid values: Acceleration, AggressiveDriving, BluetoothHeadset, Braking, ContextConstructionOrWorkZone, ContextSnowyOrIcy, ContextVulnerableRoadUser, ContextWet, Crash, DefensiveDriving, DidNotYield, Drinking, Drowsy, Eating, EatingDrinking, EdgeDistractedDriving, EdgeRailroadCrossingViolation, FollowingDistance, FollowingDistanceModerate, FollowingDistanceSevere, ForwardCollisionWarning, GenericDistraction, GenericTailgating, HarshTurn, HeavySpeeding, HosViolation, Idling, Invalid, LaneDeparture, LateResponse, LeftTurn, LightSpeeding, MaxSpeed, MobileUsage, ModerateSpeeding, NearCollison, NearPedestrianCollision, NoSeatbelt, ObstructedCamera, OtherViolation, Passenger, PolicyViolationMask, ProtectiveEquipment, RanRedLight, Reversing, RollingStop, RolloverProtection, SevereSpeeding, Smoking, Speeding, UTurn, UnsafeManeuver, UnsafeParking, VulnerableRoadUserCollisionWarning, YawControl
Optional string of comma separated values to filter event states. Valid values: needsReview, reviewed, needsCoaching, coached, dismissed, needsRecognition, recognized
Indicates whether or not to return expanded “asset” data
Indicates whether or not to return expanded “driver” data
Indicates whether or not to return events that are captured by devices with only a Vehicle Gateway (VG) installed.
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.
curl --request GET \
--url https://api.samsara.com/safety-events/stream \
--header 'Authorization: Bearer <token>'{
"data": [
{
"asset": {
"id": "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590,6caeb9c0-7e3d-49ae-a015-45c2f68fed4c",
"attributes": [
{
"dateValues": [
"2024-01-15",
"2024-12-31"
],
"id": "494123",
"name": "Compliance/ELD",
"numberValues": [
867,
5309
],
"stringValues": [
"HQ",
"Leased"
]
}
],
"externalIds": {},
"name": "MyAsset-1234",
"tags": [
{
"id": "3914",
"name": "East Coast",
"parentTagId": "4815"
}
],
"type": "trailer",
"vin": "1GBJ6P1B2HV112765"
},
"behaviorLabels": [
{
"label": "Acceleration",
"source": "automated"
}
],
"contextLabels": [
{
"authorId": "1234",
"createdAtTime": "2023-01-27T07:06:25Z",
"name": "Moderate Traffic"
}
],
"createdAtTime": "2023-01-27T07:06:25Z",
"driver": {
"id": "0987",
"attributes": [
{
"dateValues": [
"2024-01-15",
"2024-12-31"
],
"id": "494123",
"name": "Compliance/ELD",
"numberValues": [
867,
5309
],
"stringValues": [
"HQ",
"Leased"
]
}
],
"externalIds": {},
"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": {
"headingDegrees": 120,
"latitude": 37.7749,
"longitude": 137.2719,
"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": {
"externalIds": {},
"id": "12345"
}
},
"maxAccelerationGForce": 1,
"startMs": "2023-01-27T07:01:25Z",
"updatedAtTime": "2023-01-27T10:04:20Z",
"assignedCoach": "0987",
"detectedStreams": [
{
"input": "dashcamRoadFacing",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456",
"auxcamSerial": "ABC123",
"cameraRole": "leftMirrorMount"
}
],
"dismissalReason": {
"code": "incorrect",
"comment": "minorEvent"
},
"media": [
{
"input": "dashcamRoadFacing",
"url": "https://samsara-driver-media-upload.s3.us-west-2.amazonaws.com/123456",
"auxcamSerial": "ABC123",
"cameraRole": "leftMirrorMount"
}
],
"speedingMetadata": {
"maxSpeedKilometersPerHour": 6512700624259081000,
"postedSpeedLimitKilometersPerHour": 5891945604996125000
},
"tripEndTime": "2023-01-27T07:06:25Z",
"tripStartTime": "2023-01-27T07:06:25Z",
"updatedByUserId": "0987"
}
],
"pagination": {
"endCursor": "MjkY",
"hasNextPage": true
}
}