Samsara Developer Portal

Integrate your data with the Samsara API, customize the Samsara experience, and join a community of developers building with Samsara.

Get Started

REST API Overview

Learn about the main resources available through Samsara's API

Samsara's REST API provides the following high-level resources:

  • Real-time vehicle locations
  • Hours of Service (driver duty status) records
  • Dispatch and route assignment
  • Route stop status and arrival
  • Driver forms and document capture
  • Driver messaging
  • Driver and vehicle safety data

This guide is meant to give you an overview of some of the key endpoints for integrations.

📘

Reference Docs

Please refer to the API Reference Docs for detailed documentation.

📘

Data Dictionary

You can find a Data Dictionary in spreadsheet form here.

Real-Time Vehicle Locations

Get real-time and historical vehicle location data. We've written a detailed guide on Samsara's vehicle location endpoints here.

Hours of Service Records

Get real-time Hours of Service (HOS) duty status for all drivers and sync driver logs between systems.

If you simply want to get the current HOS status in order to display clock, we recommend using the GET /fleet/hos_logs_summary endpoint.

If you want to collect the entire HOS log for all drivers, we recommend doing a daily poll of the GET /fleet/drivers/{id}/hos_daily_logs for each driver.

Dispatch and Route Assignment

Create routes, schedule them, and assign them to drivers and/or vehicles.

The recommended approach for assigning stops to jobs is using the Addresses endpoints. This allows you to create custom geofences and configure alerts around given addresses. If you do not wish to use the Addresses endpoints, addresses must be provided with a street address and latitude/longitude, and a default geofence of 250 meters will be used.

As part of a routing integration, you can also associate driver documents and forms with routes and get job status updates.

Route Stop Status and Arrival

List route stop (job) status arrival and departure updates, and configure alerts for stop arrival.

Information for stop arrival can either be polled via the GET /fleet/dispatch/routes/job_updates endpoint (which will contain all job state changes), or you can configure webhooks to push an alert to you when vehicles arrive at stops.

The various dispatch job states include: Unassigned, Scheduled, EnRoute, Arrived, Completed, or Skipped. "Arrived" is when a vehicle has stopped at the given job destination. "Completed" is when the vehicle has left the given job destination to head to the next one. For the last stop on a route, the Arrived and Completed timestamps will be exactly the same.

Driver Forms and Document Capture

Create and retrieve driver documents and forms.

Documents can optionally be tied to a particular dispatch job by including the dispatch job ID in the creation of the document.

Driver Messaging

Send and retrieve messages used in the Samsara Driver mobile app.

Driver and Vehicle Safety Data

Get safety information and harsh events for drivers and/or vehicles.

  • GET /fleet/drivers/{id}/safety/score - Get safety information for a given driver during a given time range. This will include lists of any crashes, harsh events (accelerating, braking, turning), speeding, and an aggregated safety score and rank.
  • GET /fleet/vehicles/{id}/safety/score - Get safety information for a given vehicle during a given time range. This will include lists of any crashes, harsh events (accelerating, braking, turning), speeding, and an aggregated safety score and rank.
  • GET /fleet/vehicles/{id}/safety/harsh_event - Retrieve a harsh event at a given time. This includes harsh event classification, location information, and links to video recordings of the event.

Updated 4 months ago



REST API Overview


Learn about the main resources available through Samsara's API

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.