canonical: https://jentic.com/apis/samsara.com/samsara

# Samsara API

Jentic publishes the only available OpenAPI specification for Samsara API, keeping it validated and agent-ready. Track and manage commercial vehicle fleets, drivers, trailers, and industrial equipment through 56 endpoints covering real-time GPS locations, vehicle diagnostics, driver safety scores, Hours of Service (HOS) compliance, DVIRs, route planning, alert configuration, and webhook-based event notifications. The API serves fleet operators managing last-mile delivery, long-haul trucking, and field service operations.

## For AI agents

Track vehicle locations, monitor driver safety, enforce HOS compliance, and manage fleet routes and equipment for commercial transportation and logistics operations.

## Scope

Does not handle route optimization algorithms, fuel card transactions, or vehicle insurance - use for fleet telematics, compliance monitoring, and asset tracking only.

## Capabilities

- Track real-time GPS locations and historical location feeds for entire vehicle fleets
- Monitor vehicle diagnostics including fuel level, odometer, engine hours, and fault codes
- Score driver safety behavior based on harsh events, speeding, and distraction incidents
- Enforce Hours of Service compliance by querying driver HOS clocks, logs, and violations
- Plan and dispatch delivery routes with stop sequences and estimated arrival times
- Configure alert rules for geofence breaches, speeding, idle time, and maintenance triggers
- Record and track Driver Vehicle Inspection Reports (DVIRs) for DOT compliance

## Use cases

### AI Agent Fleet Monitoring

AI agents monitor commercial fleet operations through Jentic's intent search, discovering endpoints for vehicle locations, driver safety, and compliance in real time. An agent searches for 'get vehicle fleet locations', receives the GET /fleet/vehicles/locations schema, and polls the location feed to identify vehicles deviating from planned routes or approaching delivery windows. Jentic handles bearer token authentication and pagination of large fleet responses automatically.

Example prompt: Retrieve the current GPS locations for all vehicles, identify any vehicle more than 5 miles from its assigned route, and return the vehicle ID, driver name, and distance deviation

### Driver Safety and Compliance Scoring

Score and monitor driver behavior using safety events (harsh braking, speeding, phone use) aggregated into per-driver safety scores via GET /safety/scores/drivers/{id}. The API provides individual safety events through GET /safety/events with timestamps, GPS coordinates, and severity classifications. Fleet managers use these scores for coaching programs, insurance negotiations, and DOT audit preparation.

Example prompt: Get the safety score for driver 789 for the current month, then list all harsh-braking and speeding events for that driver to identify patterns

### Hours of Service Compliance Monitoring

Enforce DOT Hours of Service regulations by querying driver HOS clocks (remaining drive time), daily logs, and active violations via the /hos/clocks, /hos/logs, and /hos/violations endpoints. The API enables proactive compliance management - identifying drivers approaching duty limits before violations occur, enabling dispatch to reassign loads or schedule mandatory rest breaks.

Example prompt: Query the HOS clocks for all active drivers, identify any driver with less than 2 hours of remaining drive time, and check for open HOS violations

### Vehicle Diagnostics and Maintenance Alerts

Monitor vehicle health by polling engine diagnostics, fuel levels, odometer readings, and fault codes through GET /fleet/vehicles/stats and the stats feed endpoint. Configure alert rules via POST /alert-configurations to trigger notifications when diagnostic values exceed thresholds - such as low fuel, overdue oil changes, or active engine fault codes requiring immediate maintenance attention.

Example prompt: Get the latest stats for vehicle VH-001 including fuel percentage and odometer, then create an alert configuration that triggers when fuel drops below 15%

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /fleet/vehicles/locations | Get current GPS locations for all vehicles |
| GET | /fleet/vehicles/stats | Get vehicle diagnostics and telemetry |
| GET | /safety/events | List safety events (harsh braking, speeding) |
| GET | /safety/scores/drivers/{id} | Get a driver's safety score |
| GET | /hos/clocks | Get remaining HOS drive time for drivers |
| GET | /hos/violations | List active HOS violations |
| GET | /drivers | List all drivers |
| POST | /routes | Create a dispatch route with stops |

## Key resources

- **Vehicles** — Track locations, diagnostics, stats feeds, and historical location data for fleet vehicles
- **Drivers** — Manage driver profiles, assign vehicles, and track duty status
- **Safety** — Score driver behavior and retrieve individual safety events with GPS data
- **HOS (Hours of Service)** — Monitor driver compliance with DOT duty limits, clocks, logs, and violations
- **Routes** — Plan and dispatch delivery or service routes with stop sequences
- **DVIRs** — Record and retrieve Driver Vehicle Inspection Reports for regulatory compliance
- **Alerts & Webhooks** — Configure alert rules and receive real-time event notifications via webhooks

## Why Jentic

- **Setup:** Wiring the Samsara API by hand means learning its bearer auth, tracking feed cursors for fleet, safety, and HOS (duty-status) data on api.samsara.com, and handling pagination and retries yourself. Through Jentic you install once, import Samsara from the API Directory, store the bearer token once, and your agent calls it.
- **Permission scoping:** Samsara puts the driver id in the URL path (/safety/scores/drivers/{id}), so a rule can pin your agent to specific drivers and read paths: it can pull the locations, stats, and safety data you allow and nothing else. You choose the operations it may call, so writes like creating routes are not included unless you add them.
- **Credential handling:** Your Samsara bearer token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'track vehicle fleet locations' or 'list duty-status violations', and Jentic returns the matching Samsara operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Tesla Fleet API** — Direct vehicle control and telemetry for Tesla EV fleets
- **Smartcar API** — Consumer vehicle data API supporting 40+ car brands for connected car apps
- **Particle Cloud API** — IoT device control platform for custom sensor hardware deployed alongside fleet vehicles

## FAQ

### Why is there no official OpenAPI spec for Samsara API?

Samsara does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Samsara API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Samsara API use?

The Samsara API uses Bearer token authentication. API tokens are generated in the Samsara dashboard under Settings > API Tokens with configurable permission scopes (read, write, or full access). Through Jentic, these tokens are stored in the encrypted Jentic One instance and agents receive scoped access without handling raw token strings.

### Can I get real-time vehicle locations for my entire fleet?

Yes. The GET /fleet/vehicles/locations endpoint returns the current GPS position, heading, and speed for all vehicles. For continuous monitoring, use GET /fleet/vehicles/locations/feed which returns only vehicles that have moved since your last request, reducing bandwidth for large fleets. Historical location data is available via GET /fleet/vehicles/locations/history with time range filters.

### How do I check driver Hours of Service compliance through Jentic?

Search Jentic for 'check driver hours of service compliance' to discover the HOS endpoints. GET /hos/clocks returns remaining drive time and duty time for all active drivers. GET /hos/violations lists any current regulatory violations. Use these together to proactively identify drivers approaching duty limits before violations occur.

### What vehicle diagnostic data is available through this API?

GET /fleet/vehicles/stats returns odometer readings, fuel level percentage, engine hours, ambient temperature, tire pressure (where equipped), and active fault codes. The stats feed endpoint (GET /fleet/vehicles/stats/feed) provides incremental updates only for vehicles with changed values, and stats history supports time-range queries for trend analysis.

### Can I set up automated alerts for fleet events?

Yes. POST /alert-configurations creates alert rules for conditions like geofence entry/exit, speeding over a threshold, excessive idle time, or diagnostic fault codes. Alerts trigger webhook notifications (configured via POST /webhooks) for real-time integration with dispatch systems, Slack channels, or custom automation workflows.

### Can I limit what my agent is allowed to do with the Samsara API?

Yes. Because you run Jentic One yourself, you decide exactly which Samsara operations your agent may call, so read paths like GET /fleet/vehicles/locations, GET /fleet/vehicles/stats, and GET /safety/scores/drivers/{id} can be permitted while writes such as POST /routes stay off unless you add them. Since Samsara puts the driver id in the URL path (/safety/scores/drivers/{id}), your rules can also pin the agent to specific drivers, letting it pull only the locations, stats, and safety data you allow. Your own configuration determines which operations and credentials the agent can use, and it can call nothing outside that scope.
