Samsara Safety API

The Safety API from Samsara — 5 operation(s) for safety.

OpenAPI Specification

samsara-safety-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  description: Gain greater visibility by connecting your fleets, equipment, sites, and people.
  title: Samsara Safety API
  version: '2024-11-18'
servers:
- url: https://api.samsara.com/
- url: https://api.eu.samsara.com/
security:
- AccessTokenHeader: []
tags:
- name: Safety
paths:
  /fleet/safety-events:
    get:
      description: "Fetch safety events for the organization in a given time period. \n\n **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.\n\nTo 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>"
      operationId: getSafetyEvents
      parameters:
      - description: 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.
        in: query
        name: after
        schema:
          type: string
      - description: 'A start time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).'
        in: query
        name: startTime
        required: true
        schema:
          type: string
      - description: 'An end time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).'
        in: query
        name: endTime
        required: true
        schema:
          type: string
      - description: 'A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678`'
        explode: false
        in: query
        name: tagIds
        schema:
          items:
            type: string
          type: array
        style: form
      - description: 'A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678`'
        explode: false
        in: query
        name: parentTagIds
        schema:
          items:
            type: string
          type: array
        style: form
      - description: 'A filter on the data based on this comma-separated list of vehicle IDs. Example: `vehicleIds=1234,5678`'
        explode: false
        in: query
        name: vehicleIds
        schema:
          items:
            type: string
          type: array
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsListResponse'
          description: List of safety events from given time period.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/standardErrorResponse'
          description: Error response
      summary: List All Safety Events.
      tags:
      - Safety
  /fleet/safety-events/audit-logs/feed:
    get:
      description: "Get continuous safety events. The safety activity event feed offers a change-log for safety events. Use this endpoint to subscribe to safety event changes. See documentation below for all supported change-log types.\n\n| ActivityType      | Description |\n| ----------- | ----------- |\n| CreateSafetyEventActivityType | a new safety event is processed by Samsara      |\n| BehaviorLabelActivityType     | a label is added or removed from a safety event |\n| CoachingStateActivityType     | a safety event coaching state is updated        |\n\n <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>).\n\nTo 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>\n \n\n **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."
      operationId: getSafetyActivityEventFeed
      parameters:
      - description: ' 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.'
        in: query
        name: after
        schema:
          type: string
      - description: ' A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).'
        in: query
        name: startTime
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedResponseBody'
          description: OK response.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedUnauthorizedErrorResponseBody'
          description: Unauthorized response.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedNotFoundErrorResponseBody'
          description: Not Found response.
        '405':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedMethodNotAllowedErrorResponseBody'
          description: Method Not Allowed response.
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedTooManyRequestsErrorResponseBody'
          description: Too Many Requests response.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedInternalServerErrorResponseBody'
          description: Internal Server Error response.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedNotImplementedErrorResponseBody'
          description: Not Implemented response.
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedBadGatewayErrorResponseBody'
          description: Bad Gateway response.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedServiceUnavailableErrorResponseBody'
          description: Service Unavailable response.
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedGatewayTimeoutErrorResponseBody'
          description: Gateway Timeout response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SafetyEventsGetSafetyActivityEventFeedBadRequestErrorResponseBody'
          description: Bad Request response.
      summary: Fetches Safety Activity Event Feed
      tags:
      - Safety
  /v1/fleet/drivers/{driverId}/safety/score:
    get:
      description: "<n class=\"warning\">\n<nh>\n<i class=\"fa fa-exclamation-circle\"></i>\nThis endpoint is still on our legacy API.\n</nh>\n</n>\n\nFetch the safety score for the driver.\n\n <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>). \n\n **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.\n\nTo 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>"
      operationId: V1getDriverSafetyScore
      parameters:
      - description: ID of the driver. Must contain only digits 0-9.
        in: path
        name: driverId
        required: true
        schema:
          format: int64
          type: integer
      - description: 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.
        in: query
        name: startMs
        required: true
        schema:
          format: int64
          type: integer
      - description: 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.
        in: query
        name: endMs
        required: true
        schema:
          format: int64
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1DriverSafetyScoreResponse'
          description: Safety score details.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1ErrorResponse'
          description: Unexpected error.
      summary: Fetch Driver Safety Score
      tags:
      - Safety
  /v1/fleet/vehicles/{vehicleId}/safety/harsh_event:
    get:
      description: "<n class=\"warning\">\n<nh>\n<i class=\"fa fa-exclamation-circle\"></i>\nThis endpoint is still on our legacy API.\n</nh>\n</n>\n\nFetch harsh event details for a vehicle. \n\n **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.\n\nTo 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>"
      operationId: V1getVehicleHarshEvent
      parameters:
      - description: ID of the vehicle. Must contain only digits 0-9.
        in: path
        name: vehicleId
        required: true
        schema:
          format: int64
          type: integer
      - description: Timestamp in milliseconds representing the timestamp of a harsh event.
        in: query
        name: timestamp
        required: true
        schema:
          format: int64
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1VehicleHarshEventResponse'
          description: Harsh event details.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1ErrorResponse'
          description: Unexpected error.
      summary: Fetch Harsh Events
      tags:
      - Safety
  /v1/fleet/vehicles/{vehicleId}/safety/score:
    get:
      description: "<n class=\"warning\">\n<nh>\n<i class=\"fa fa-exclamation-circle\"></i>\nThis endpoint is still on our legacy API.\n</nh>\n</n>\n\nFetch the safety score for the vehicle. \n\n <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>). \n\n **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.\n\nTo 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>"
      operationId: V1getVehicleSafetyScore
      parameters:
      - description: ID of the vehicle. Must contain only digits 0-9.
        in: path
        name: vehicleId
        required: true
        schema:
          format: int64
          type: integer
      - description: 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.
        in: query
        name: startMs
        required: true
        schema:
          format: int64
          type: integer
      - description: 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.
        in: query
        name: endMs
        required: true
        schema:
          format: int64
          type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1VehicleSafetyScoreResponse'
          description: Safety score details.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V1ErrorResponse'
          description: Unexpected error.
      summary: Fetch Vehicle Safety Scores
      tags:
      - Safety
components:
  schemas:
    SafetyEventsGetSafetyActivityEventFeedResponseBody:
      properties:
        data:
          description: Paginated safety event activity feed limited to 10 events.
          items:
            $ref: '#/components/schemas/SafetyEventActivityFeedItemResponseBody'
          type: array
        pagination:
          $ref: '#/components/schemas/GoaPaginationResponseResponseBody'
      required:
      - data
      - pagination
      type: object
    SafetyEventDownloadInwardVideoUrl:
      description: URL to download the inward video.
      example: https://s3.console.aws.amazon.com/s3/buckets/samsara-dashcam-videos/21575/212014918400828/1553060687222/huKA7IhpBV-camera-video-segment-1244214895.mp4
      type: string
    V1ErrorResponse:
      description: Error message describing why the request failed.
      type: string
    V1VehicleHarshEventResponse_location:
      properties:
        address:
          description: Address of location where the harsh event occurred
          example: 350 Rhode Island St, San Francisco, CA
          type: string
        latitude:
          description: Latitude of location where the harsh event occurred
          example: 33.07614328
          type: number
        longitude:
          description: Longitude of location where the harsh event occurred
          example: -96.14907287
          type: number
      type: object
    vehicleTinyResponse:
      description: A minified vehicle object.
      properties:
        ExternalIds:
          additionalProperties:
            type: string
          description: The [external IDs](https://developers.samsara.com/docs/external-ids) for the given object.
          example:
            maintenanceId: '250020'
            payrollId: ABFS18600
          type: object
        id:
          description: ID of the vehicle.
          example: '123456789'
          type: string
        name:
          description: Name of the vehicle.
          example: 'Midwest Truck #4'
          type: string
      type: object
    SafetyEventDriverObjectResponseBody:
      description: A minified driver object.
      properties:
        id:
          description: ID of the driver.
          example: 0987
          type: string
      type: object
    SafetyEventBehaviorLabelType:
      description: 'The label associated with the safety event. This list often changes, so it is recommended that clients gracefully handle any types not enumerated in this list. Valid values: `genericTailgating`, `genericDistraction`, `defensiveDriving`, `rollingStop`, `nearCollison`, `speeding`, `obstructedCamera`, `didNotYield`, `noSeatbelt`, `mobileUsage`, `drowsy`, `laneDeparture`, `followingDistanceSevere`, `followingDistanceModerate`, `lateResponse`, `acceleration`, `braking`, `harshTurn`, `crash`, `rolloverProtection`, `yawControl`, `ranRedLight`, `forwardCollisionWarning`, `eatingDrinking`, `smoking`, `followingDistance`, `edgeDistractedDriving`.'
      enum:
      - genericTailgating
      - genericDistraction
      - defensiveDriving
      - rollingStop
      - nearCollison
      - speeding
      - obstructedCamera
      - didNotYield
      - noSeatbelt
      - mobileUsage
      - drowsy
      - laneDeparture
      - followingDistanceSevere
      - followingDistanceModerate
      - lateResponse
      - acceleration
      - braking
      - harshTurn
      - crash
      - rolloverProtection
      - yawControl
      - ranRedLight
      - forwardCollisionWarning
      - eatingDrinking
      - smoking
      - followingDistance
      - edgeDistractedDriving
      type: string
    SafetyEventBehaviorLabelsResponseBody:
      description: Behavior label for a safety event.
      properties:
        name:
          description: Name of the behavior label.
          example: Acceleration
          type: string
        type:
          description: 'Type of the BehaviorLabel.  Valid values: `Acceleration`, `Braking`, `Crash`, `DefensiveDriving`, `DidNotYield`, `Drinking`, `Drowsy`, `Eating`, `EatingDrinking`, `EdgeDistractedDriving`, `EdgeRailroadCrossingViolation`, `FollowingDistance`, `FollowingDistanceModerate`, `FollowingDistanceSevere`, `ForwardCollisionWarning`, `GenericDistraction`, `GenericTailgating`, `HarshTurn`, `Invalid`, `LaneDeparture`, `LateResponse`, `MobileUsage`, `NearCollison`, `NoSeatbelt`, `ObstructedCamera`, `PolicyViolationMask`, `RanRedLight`, `RollingStop`, `RolloverProtection`, `Smoking`, `Speeding`, `YawControl`'
          enum:
          - Acceleration
          - Braking
          - Crash
          - DefensiveDriving
          - DidNotYield
          - Drinking
          - Drowsy
          - Eating
          - EatingDrinking
          - EdgeDistractedDriving
          - EdgeRailroadCrossingViolation
          - FollowingDistance
          - FollowingDistanceModerate
          - FollowingDistanceSevere
          - ForwardCollisionWarning
          - GenericDistraction
          - GenericTailgating
          - HarshTurn
          - Invalid
          - LaneDeparture
          - LateResponse
          - MobileUsage
          - NearCollison
          - NoSeatbelt
          - ObstructedCamera
          - PolicyViolationMask
          - RanRedLight
          - RollingStop
          - RolloverProtection
          - Smoking
          - Speeding
          - YawControl
          example: Acceleration
          type: string
      type: object
    SafetyEventMaxAccelerationGForce:
      description: The maximum acceleration value as a multiplier on the force of gravity (g).
      example: 0.123
      type: number
    SafetyEventBehaviorLabels:
      description: The most up-to-date behavior labels associated with the safety event. These labels can be updated by the Safety Report Admin.
      items:
        $ref: '#/components/schemas/SafetyEventBehaviorLabel'
      type: array
    standardErrorResponse:
      description: Error response
      properties:
        message:
          description: The message of the error.
          example: An error has occurred.
          type: string
        requestId:
          description: The ID of the request.
          example: 8916e1c1
          type: string
      type: object
    GoaPaginationResponseResponseBody:
      description: Pagination parameters.
      properties:
        endCursor:
          description: Cursor identifier representing the last element in the response. This value should be used in conjunction with a subsequent request's 'after' query parameter. This may be an empty string if there are no more pages left to view.
          example: MjkY
          type: string
        hasNextPage:
          description: True if there are more pages of results immediately available after this endCursor.
          example: true
          type: boolean
      required:
      - endCursor
      - hasNextPage
      type: object
    SafetyEventsGetSafetyActivityEventFeedTooManyRequestsErrorResponseBody:
      description: Too many requests
      properties:
        message:
          description: Message of error
          example: Exceeded rate limit.
          type: string
        requestId:
          description: The request ID; used when reaching out to support for issues with requests.
          example: 8916e1c1
          type: string
      required:
      - message
      - requestId
      type: object
    V1DriverSafetyScoreResponse:
      description: Safety score details for a driver
      properties:
        crashCount:
          description: Crash event count
          example: 0
          type: integer
        driverId:
          description: Driver ID
          example: 1234
          type: integer
        harshAccelCount:
          description: Harsh acceleration event count
          example: 1
          type: integer
        harshBrakingCount:
          description: Harsh braking event count
          example: 2
          type: integer
        harshEvents:
          items:
            $ref: '#/components/schemas/V1SafetyReportHarshEvent'
          type: array
        harshTurningCount:
          description: Harsh turning event count
          example: 0
          type: integer
        safetyScore:
          description: The drivers Safety Score for the requested period. Note that if the driver has zero drive time in this period, the Safety Score will be returned as 100.
          example: 97
          type: integer
        safetyScoreRank:
          description: Safety Score Rank
          example: '26'
          type: string
        timeOverSpeedLimitMs:
          description: Amount of time driven over the speed limit in milliseconds
          example: 3769
          type: integer
        totalDistanceDrivenMeters:
          description: Total distance driven in meters
          example: 291836
          type: integer
        totalHarshEventCount:
          description: Total harsh event count
          example: 3
          type: integer
        totalTimeDrivenMs:
          description: Amount of time driven in milliseconds
          example: 19708293
          type: integer
      type: object
    SafetyEventActivityFeedItemResponseBody:
      description: Safety event activity feed item.
      properties:
        id:
          description: The ID of the activity event feed line item.
          example: 1622151765-212014918174029-1550954461759
          type: string
        safetyEvent:
          $ref: '#/components/schemas/SafetyEventObjectResponseBody'
        time:
          description: The time the activity occurred in the corresponding safety event in RFC 3339 milliseconds format.
          example: '2019-10-12T07:20:50.52Z'
          type: string
        type:
          description: 'The type of activity that occurred in the safety event. We currently only support CoachingStateActivityType, BehaviorLabelActivityType, and CreateSafetyEventActivityType, but we may add support for more activity types in the future.  Valid values: `BehaviorLabelActivityType`, `CoachingStateActivityType`, `CreateSafetyEventActivityType`'
          enum:
          - BehaviorLabelActivityType
          - CoachingStateActivityType
          - CreateSafetyEventActivityType
          example: CreateSafetyEventActivityType
          type: string
      required:
      - id
      - safetyEvent
      - time
      - type
      type: object
    SafetyEventDownloadTrackedInwardVideoUrl:
      description: URL to download the tracked inward video.
      example: https://s3.console.aws.amazon.com/s3/buckets/samsara-dashcam-videos/21575/212014918400828/1553060687222/huKA7IhpBV-camera-video-segment-1244214895.mp4
      type: string
    SafetyEventObjectResponseBody:
      description: The safety event that was updated.
      properties:
        behaviorLabels:
          description: Behavior labels for a safety event.
          items:
            $ref: '#/components/schemas/SafetyEventBehaviorLabelsResponseBody'
          type: array
        driver:
          $ref: '#/components/schemas/SafetyEventDriverObjectResponseBody'
        id:
          description: The unique Samsara ID of the safety event.
          example: 212014918174029-1550954461759
          type: string
        time:
          description: The time the safety event occurred in RFC 3339 milliseconds format.
          example: '2019-06-13T19:08:25.455Z'
          type: string
        vehicle:
          $ref: '#/components/schemas/SafetyEventVehicleObjectResponseBody'
      type: object
    SafetyEventTime:
      description: The time the safety event occurred in RFC 3339 milliseconds format.
      example: '2019-06-13T19:08:25.455Z'
      type: string
    SafetyEventsGetSafetyActivityEventFeedNotImplementedErrorResponseBody:
      description: Requested endpoint is not yet implemented
      properties:
        message:
          description: Message of error
          example: Not implemented.
          type: string
        requestId:
          description: The request ID; used when reaching out to support for issues with requests.
          example: 8916e1c1
          type: string
      required:
      - message
      - requestId
      type: object
    SafetyEventsGetSafetyActivityEventFeedServiceUnavailableErrorResponseBody:
      description: Service unavailable
      properties:
        message:
          description: Message of error
          example: context deadline exceeded
          type: string
        requestId:
          description: The request ID; used when reaching out to support for issues with requests.
          example: 8916e1c1
          type: string
      required:
      - message
      - requestId
      type: object
    SafetyEventsGetSafetyActivityEventFeedUnauthorizedErrorResponseBody:
      description: Unauthorized
      properties:
        message:
          description: Message of error
          example: Invalid token.
          type: string
        requestId:
          description: The request ID; used when reaching out to support for issues with requests.
          example: 8916e1c1
          type: string
      required:
      - message
      - requestId
      type: object
    SafetyEventsGetSafetyActivityEventFeedMethodNotAllowedErrorResponseBody:
      description: Method not allowed
      properties:
        message:
          description: Message of error
          example: DELETE not allowed on /endpoint.
          type: string
        requestId:
          description: The request ID; used when reaching out to support for issues with requests.
          example: 8916e1c1
          type: string
      required:
      - message
      - requestId
      type: object
    SafetyEventsGetSafetyActivityEventFeedBadRequestErrorResponseBody:
      description: Bad Request parameters
      properties:
        message:
          description: Message of error
          example: Invalid value for parameter.
          type: string
        requestId:
          description: The request ID; used when reaching out to support for issues with requests.
          example: 8916e1c1
          type: string
      required:
      - message
      - requestId
      type: object
    SafetyEventBehaviorLabelSource:
      description: 'The source of the label associated with the safety event. Valid values: `automated`, `userGenerated`.'
      enum:
      - automated
      - userGenerated
      type: string
    V1SafetyReportHarshEvent:
      description: List of harsh events
      properties:
        harshEventType:
          description: Sensor generated harsh event type.
          example: Harsh Braking
          type: string
        timestampMs:
          description: Timestamp that the harsh event occurred in Unix milliseconds since epoch
          example: 1535590776000
          type: integer
        vehicleId:
          description: Vehicle associated with the harsh event
          example: 212014918086169
          type: integer
      type: object
    V1VehicleHarshEventResponse:
      description: Harsh event details for a vehicle
      properties:
        downloadForwardVideoUrl:
          description: URL for downloading the forward facing video
          example: https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-123456789.mp4?...
          type: string
        downloadInwardVideoUrl:
          description: URL for downloading the inward facing video
          example: https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-driver-123456789.mp4?...
          type: string
        downloadTrackedInwardVideoUrl:
          description: URL for downloading the tracked inward facing video
          example: https://samsara-dashcam-videos.s3.us-west-2.amazonaws.com/123/212123456789012/1539201872984/abC123De4-camera-video-segment-driver-123456789.tracked.mp4?...
          type: string
        harshEventType:
          description: 'Type of the harsh event. One of: [Crash, Harsh Acceleration, Harsh Braking, Harsh Turn, ROP Engine, ROP Brake, YC Engine, YC Brake, Harsh Event]'
          example: Harsh Braking
          type: string
        incidentReportUrl:
          description: URL of the associated incident report page
          example: https://cloud.samsara.com/o/1234/fleet/reports/safety/vehicle/212123456789012/incident/1539201882984
          type: string
        isDistracted:
          description: Whether the driver was deemed distracted during this harsh event
          example: true
          type: boolean
        location:
          $ref: '#/components/schemas/V1VehicleHarshEventResponse_location'
      required:
      - harshEventType
      - incidentReportUrl
      type: object
    SafetyEvent:
      description: A safety event.
      properties:
        behaviorLabels:
          $ref: '#/components/schemas/SafetyEventBehaviorLabels'
        coachingState:
          $ref: '#/components/schemas/SafetyEventCoachingState'
        downloadForwardVideoUrl:
          $ref: '#/components/schemas/SafetyEventDownloadForwardVideoUrl'
        downloadInwardVideoUrl:
          $ref: '#/components/schemas/SafetyEventDownloadInwardVideoUrl'
        downloadTrackedInwardVideoUrl:
          $ref: '#/components/schemas/SafetyEventDownloadTrackedInwardVideoUrl'
        driver:
          $ref: '#/components/schemas/driverTinyResponse'
        id:
          $ref: '#/components/schemas/SafetyEventId'
        location:
          $ref: '#/components/schemas/location'
        maxAccelerationGForce:
          $ref: '#/components/schemas/SafetyEventMaxAccelerationGForce'
        time:
        

# --- truncated at 32 KB (39 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/samsara/refs/heads/main/openapi/samsara-safety-api-openapi.yml