Samsara Efficiency API

The Efficiency API from Samsara — 1 operation(s) for efficiency.

OpenAPI Specification

samsara-efficiency-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  description: Gain greater visibility by connecting your fleets, equipment, sites, and people.
  title: Samsara Efficiency API
  version: '2024-11-18'
servers:
- url: https://api.samsara.com/
- url: https://api.eu.samsara.com/
security:
- AccessTokenHeader: []
tags:
- name: Efficiency
paths:
  /beta/fleet/drivers/efficiency:
    get:
      description: "Get all driver and associated vehicle efficiency data. \n\n <b>Rate limit:</b> 50 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 Fuel & Energy** under the Fuel & Energy 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: getDriverEfficiency
      parameters:
      - description: If value is `deactivated`, only drivers that are deactivated will appear in the response. This parameter will default to `active` if not provided (fetching only active drivers).
        in: query
        name: driverActivationStatus
        schema:
          enum:
          - active
          - deactivated
          type: string
      - description: 'A filter on the data based on this comma-separated list of driver IDs. Cannot be used with tag filtering or driver status. Example: `driverIds=1234,5678`'
        explode: false
        in: query
        name: driverIds
        schema:
          items:
            type: string
          type: array
        style: form
      - 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: 'Filters summary to drivers based on this comma-separated list of tag IDs. Data from all the drivers'' respective vehicles will be included in the summary, regardless of which tag the vehicle is associated with. Should not be provided in addition to `driverIds`. Example: driverTagIds=1234,5678'
        explode: false
        in: query
        name: driverTagIds
        schema:
          items:
            type: string
          type: array
        style: form
      - description: 'Filters like `driverTagIds` but includes descendants of all the given parent tags. Should not be provided in addition to `driverIds`. Example: `driverParentTagIds=1234,5678`'
        explode: false
        in: query
        name: driverParentTagIds
        schema:
          items:
            type: string
          type: array
        style: form
      - description: 'A start time in RFC 3339 format. The results will be truncated to the hour mark for the provided time. For example, if `startTime` is 2020-03-17T12:06:19Z then the results will include data starting from 2020-03-17T12:00:00Z. The provided start time cannot be in the future. Start time can be at most 31 days before the end time. If the start time is within the last hour, the results will be empty. Default: 24 hours prior to endTime.


          Note that the most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours.'
        in: query
        name: startTime
        schema:
          format: date-time
          type: string
      - description: 'An end time in RFC 3339 format. The results will be truncated to the hour mark for the provided time. For example, if `endTime` is 2020-03-17T12:06:19Z then the results will include data up until 2020-03-17T12:00:00Z. The provided end time cannot be in the future. End time can be at most 31 days after the start time. Default: The current time truncated to the hour mark.


          Note that the most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours'
        in: query
        name: endTime
        schema:
          format: date-time
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriverEfficienciesResponse'
          description: List of all driver and associated vehicle efficiency data
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/standardErrorResponse'
          description: Unexpected error.
      summary: '[beta] List Driver Efficiency'
      tags:
      - Efficiency
components:
  schemas:
    CoastingDurationMs:
      description: Time spent without engaging the accelerator or brake in milliseconds.
      type: number
    DriveTimeDurationMs:
      description: Time driven in milliseconds.
      type: number
    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
    TotalBrakeEventCount:
      description: Total number of brake events.
      type: number
    FuelConsumedMl:
      description: Fuel consumption in milliliters.
      type: number
    DriverEfficienciesResponse:
      description: Summary of drivers' efficiencies over a time range.
      properties:
        data:
          $ref: '#/components/schemas/DriverEfficienciesResponse_data'
        pagination:
          $ref: '#/components/schemas/paginationResponse'
      type: object
    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
    GreenBandDrivingDurationMs:
      description: Time in efficient RPM (800 to 17000) in milliseconds.
      type: number
    AnticipationBrakeEventCount:
      description: Quick braking events (less than one second after accelerating).
      type: number
    CruiseControlDurationMs:
      description: Time spent in cruise control in milliseconds.
      type: number
    HighTorqueMs:
      description: Time the vehicle engine torque is greater than 90% in milliseconds.
      type: number
    DriverEfficienciesResponse_data:
      properties:
        driverSummaries:
          description: A list of driver and associated vehicle efficiency data.
          items:
            $ref: '#/components/schemas/DriverEfficiency'
          type: array
        summaryEndTime:
          description: 'End time of the window for which this efficiency report was computed. Will be a UTC timestamp in RFC 3339 format. For example: `2020-03-16T16:00:00Z`'
          example: '2020-03-16T16:00:00Z'
          format: date-time
          type: string
        summaryStartTime:
          description: 'Start time of the window for which this efficiency report was computed. Will be a UTC timestamp in RFC 3339 format. For example: `2020-03-15T16:00:00Z`'
          example: '2020-03-15T16:00:00Z'
          format: date-time
          type: string
      type: object
    ExtendedDriverTinyResponse:
      description: A minified driver object.
      properties:
        externalIds:
          description: The [external IDs](https://developers.samsara.com/docs/external-ids) for the given object.
          example:
            maintenanceId: '250020'
            payrollId: ABFS18600
          properties: {}
          type: object
        id:
          description: ID of the driver.
          example: '88668'
          type: string
        name:
          description: Name of the driver.
          example: Susan Bob
          type: string
        username:
          description: Username of the driver.
          example: susanbob
          type: string
      type: object
    DriverEfficiency:
      description: Summary of a driver's efficiency.
      properties:
        anticipationBrakeEventCount:
          $ref: '#/components/schemas/AnticipationBrakeEventCount'
        coastingDurationMs:
          $ref: '#/components/schemas/CoastingDurationMs'
        cruiseControlDurationMs:
          $ref: '#/components/schemas/CruiseControlDurationMs'
        driver:
          $ref: '#/components/schemas/ExtendedDriverTinyResponse'
        greenBandDrivingDurationMs:
          $ref: '#/components/schemas/GreenBandDrivingDurationMs'
        highTorqueMs:
          $ref: '#/components/schemas/HighTorqueMs'
        overSpeedMs:
          $ref: '#/components/schemas/OverSpeedMs'
        totalBrakeEventCount:
          $ref: '#/components/schemas/TotalBrakeEventCount'
        totalDistanceDrivenMeters:
          $ref: '#/components/schemas/DistanceDrivenMeters'
        totalDriveTimeDurationMs:
          $ref: '#/components/schemas/DriveTimeDurationMs'
        totalFuelConsumedMl:
          $ref: '#/components/schemas/FuelConsumedMl'
        totalIdleTimeDurationMs:
          $ref: '#/components/schemas/IdleTimeDurationMs'
        totalPowerTakeOffDurationMs:
          $ref: '#/components/schemas/PowerTakeOffDurationMs'
        vehicleSummaries:
          description: Summaries of vehicle efficiency for each vehicle the driver was driving during the given time period.
          items:
            $ref: '#/components/schemas/VehicleSummary'
          type: array
      type: object
    paginationResponse:
      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
          format: string
          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
    DistanceDrivenMeters:
      description: Distance driven in meters.
      type: number
    OverSpeedMs:
      description: Driving time spent over the efficient speed threshold in milliseconds.
      type: number
    PowerTakeOffDurationMs:
      description: Time spent with power take off enabled while idling in milliseconds.
      type: number
    VehicleSummary:
      properties:
        anticipationBrakeEventCount:
          $ref: '#/components/schemas/AnticipationBrakeEventCount'
        coastingDurationMs:
          $ref: '#/components/schemas/CoastingDurationMs'
        cruiseControlDurationMs:
          $ref: '#/components/schemas/CruiseControlDurationMs'
        distanceDrivenMeters:
          $ref: '#/components/schemas/DistanceDrivenMeters'
        driveTimeDurationMs:
          $ref: '#/components/schemas/DriveTimeDurationMs'
        fuelConsumedMl:
          $ref: '#/components/schemas/FuelConsumedMl'
        greenBandDrivingDurationMs:
          $ref: '#/components/schemas/GreenBandDrivingDurationMs'
        highTorqueMs:
          $ref: '#/components/schemas/HighTorqueMs'
        idleTimeDurationMs:
          $ref: '#/components/schemas/IdleTimeDurationMs'
        overSpeedMs:
          $ref: '#/components/schemas/OverSpeedMs'
        powerTakeOffDurationMs:
          $ref: '#/components/schemas/PowerTakeOffDurationMs'
        totalBrakeEventCount:
          $ref: '#/components/schemas/TotalBrakeEventCount'
        vehicle:
          $ref: '#/components/schemas/vehicleTinyResponse'
      type: object
    IdleTimeDurationMs:
      description: Time spent idling in milliseconds.
      type: number
  securitySchemes:
    AccessTokenHeader:
      type: http
      scheme: bearer
x-original-swagger-version: '2.0'
x-readme:
  explorer-enabled: true
  proxy-enabled: true