Beta APIs

[beta] Update Safety Events

Asynchronously update eventState, context labels, and/or behavior labels for one or more Safety Events. Returns 202 Accepted immediately. State changes propagate asynchronously; use GET /safety-events to confirm updated state. If any safetyEventIds are not found, the entire request fails with 404 before any mutations are executed.If both eventState and label fields are provided, the two mutations execute serially and are not transactional — a label mutation failure will not roll back a successful state change.

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

patch/safety-events/batch

Request

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

Request body

behaviorLabelsToAddstring[]

Behavior labels to add to the Safety Events.

behaviorLabelsToRemovestring[]

Behavior labels to remove from the Safety Events.

contextLabelsToAddstring[]

Context labels to add to the Safety Events.

contextLabelsToRemovestring[]

Context labels to remove from the Safety Events.

eventState'needsReview' | 'reviewed' | 'needsCoaching' | 'coached' | 'dismissed' | 'needsRecognition' | 'recognized'

The new state to apply to all specified Safety Events. Valid values: needsReview, reviewed, needsCoaching, coached, dismissed, needsRecognition, recognized

safetyEventIdsstring[] required

IDs of the Safety Events to update. Maximum 200.

Example request

{
  "behaviorLabelsToAdd": [
    "FollowingDistanceSevere",
    "HarshImpact",
    "BluetoothHeadset",
    "RollingStop"
  ],
  "behaviorLabelsToRemove": [
    "ProtectiveEquipment",
    "Idling"
  ],
  "contextLabelsToAdd": [
    "Wet Road",
    "Improper Seat Belt",
    "Speed Sign Verified",
    "Wildlife"
  ],
  "contextLabelsToRemove": [
    "Wet Road",
    "Lead Car"
  ],
  "dismissalReason": {
    "code": "incorrect",
    "comment": "minorEvent"
  },
  "eventState": "needsReview",
  "safetyEventIds": [
    "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590",
    "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"
  ]
}

Response

Accepted response.

requestIdstring required

Server-generated UUID for client-side correlation and logging. Not stored or queryable on the backend.

Example response

{
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "responses": [
    {
      "data": {
        "safetyEventId": "bb2ff5ab-30ad-49ec-9d2d-55ec30bbf590"
      },
      "status": 202
    }
  ]
}

Changes

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