TMS integration
How to integrate Samsara with a Transport Management System (TMS)
For a summary of available resources, check out the REST API Overview.
Overview
A Transportation Management System (TMS) is software used by trucking fleets to manage dispatch, routing, compliance, and logistics. Integrating Samsara with a TMS enables real-time visibility, automation, and compliance management by syncing essential data between the two systems.
TMS Features
TMS integrations with Samsara may include:
- GPS tracking and telematics for real time visibility and automations.
- Compliance to meet regulatory requirements (Hours of Service, Tachograph)
- Route (load) tracking for route assignment and tracking, driver-vehicle-trailer assignment.
- Driver-dispatch messaging to communicate to drivers in the Samsara Driver app.
- Forms and Workflows customizable forms for drivers to send documents, including text and photos.
Samsara gateways, cameras, and sensors capture GPS and telematics data and send it to the Samsara cloud.
Drivers use the Samsara mobile app to track hours of service, view and complete loads, send messages with fleet admins, and submit forms.
Integration Points
We recommend integrating as many relevant data points as possible so that customers can have a seamless experience. While some TMS integrations may only sync location and vehicle details, others achieve a higher level of functionality by handling two-way synchronization for routes, driver data, forms, messaging, and other key workflows. The broader your integration, the more effectively your customers can leverage Samsara to streamline their day-to-day operations.
Syncing Entities
Entity | Samsara ↔ TMS Sync? | REST APIs | Event APIs |
---|---|---|---|
Addresses | ✅ Two-way sync | GET /addresses POST /addresses PATCH /addresses/:id DELETE /addresses/:id | Webhook Events:AddressCreated AddressUpdated AddressDeleted |
Drivers | ✅ Two-way sync | GET /fleet/drivers POST /fleet/drivers | Webhook Events:DriverCreated DriverUpdated |
Vehicles (Tractors) | ✅ Two-way sync | GET /assets PATCH /assets | |
Trailers | ✅ Two-way sync | GET /assets POST /assets PATCH /assets/:id | |
GPS and Telematics | ➡️ One-way sync | GET /assets/location-and-speed/stream GET /fleet/vehicle/stats | Kafka Messages:GPS and Speed |
Routes (Loads) | ✅ Two-way sync | GET /fleet/routes POST /fleet/routes PATCH /fleet/routes/:id DELETE /fleet/routes/:id | Webhook Events:RouteStopArrival RouteStopDeparture |
Messages | ✅ Two-way sync | GET /v1/fleet/messages POST /v1/fleet/messages | |
Forms | ✅ Two-way sync | GET /form-templates GET /form-submissions POST /form-submissions PATCH /form-submissions/:id | Webhook Events:FormSubmitted |
Compliance Hours of Service (HOS) Tachograph (EU Only) | ➡️ One-way sync | North America:GET /fleet/hos/clocks GET /fleet/hos/logs EU Only: GET /fleet/drivers/tachograph-files/history GET /fleet/vehicles/tachograph-files/history | Kafka Messages:HOS Clocks |
Customer Integration Lifecycle
The high level steps an end customer of both Samsara and the TMS take during implementation.
- Customer setup and installation
- Initial data synchronization and mapping
- Day-to-day operations
Customer setup
Customers install the TMS application either from the Samsara app marketplace, or when redirected to Samsara via your OAuth authorize link. After the OAuth flow is complete, the TMS stores the OAuth credentials and uses the access token to authenticate API calls to read and write data for the customer's Samsara account.
⚠️ Ensure your OAuth 2.0 application is configured to request the correct scopes required for the integration.
Review the OAuth 2.0 guide for implementation details.
Initial data synchronization and mapping
When a customer completes the OAuth flow to install and connect to your TMS application for the first time, it's common to synchronize and map existing entities in the TMS to entities in Samsara.
Recommendation Store the Samsara ID of objects in the TMS database and update the Samsara object's external IDs with a TMS specific ID.
Sync Addresses
Managing addresses in Samsara simplifies route management. While it's possible to use a singleUseLocation
for route stops, we recommend using identifiers for an address. Learn more about creating and managing known locations in the Addresses guide.
Sync Drivers
It’s crucial to keep driver information in sync between Samsara and your TMS so that driver compliance logs, hours of service data, route assignments, messaging, and other driver-related features are accurate and up to date. See the Drivers guide for more details about creating and managing drivers.
Sync Assets: Vehicles, Trailers, and Equipment
See the Assets: Vehicles, Trailers, and Equipment guide for more details about managing assets. Note: this API is still in beta, but will be released very soon and is the only API to create new Assets like vehicles.
Sync Form Templates
Use the Get form templates endpoint (coming soon) to fetch Form Templates, which define standardized fields for data collection. You can pre-fill forms and documents for drivers with key details—like location or asset info—ensuring faster and more consistent form submissions. For more information, see the Form guides.
Sync Compliance Data
- [North America] Sync Hours of Service Logs
- [EU] Sync Tachograph History
[Optional] Setup Webhook endpoints
When building a Samsara Marketplace App, there’s no global webhook handler for all customers. Instead, you must create dedicated webhook endpoints for each customer using the Webhooks API and their respective access tokens. This ensures your app can receive real-time notifications—like form submissions or route updates—for each customer’s data. For more details, see the Webhooks for Marketplace Apps guide.
Day-to-day operations
- Dispatcher assigns a load to a driver – The TMS creates a new load and syncs it with Samsara as a route.
- Driver receives the route in the Samsara Driver App – Includes stop details, trailer assignments, and workflow tasks.
- Samsara updates driver location & Hours of Service status – Ensures dispatch knows the driver’s availability.
- Driver arrives at pickup location – Stops are marked as arrived based on geofence triggers or manual status updates.
- Driver completes required tasks & forms – Bills of lading (BOL), vehicle inspection reports, and other forms are submitted.
- Driver departs and proceeds to the next stop – Samsara updates estimated arrival times (ETAs) for remaining stops.
- Driver reaches the final destination & completes delivery – Proof of delivery (POD) and final forms are submitted.
- TMS receives trip completion data – The order is closed out, and analytics are updated.
Choosing the Right Integration Approach: Polling vs. Webhooks vs. Kafka
To balance real-time accuracy, system performance, and API rate limits, consider these solutions:
- Polling (Batch) – The TMS periodically makes API requests to Samsara at scheduled intervals to retrieve updated data. This approach is simple and works well for large-scale data synchronization, but it can be resource-intensive if frequent updates are needed.
- Webhooks (Event-Driven) – Samsara pushes updates to the TMS when an event occurs, such as a route change, form submission, or driver update. This eliminates the need for polling, providing near-instant synchronization while reducing API load.
- Kafka (Streaming for High-Frequency Data) – Samsara’s Kafka Connector allows real-time streaming of high-frequency updates, such as GPS positions and Hours of Service (HOS) clocks. This approach is best for integrations that require low-latency updates.
The best integrations use a combination of these approaches based on the entity and update frequency.
Note: Route arrive/depart webhook events are only sent for vehicle assigned routes.
Please reach out to your Samsara representative if you need ETAs in the payload of route updates.
How does ETA calculation work?
We use Google Maps for ETAs.
If the ETA is >= 30 min from the stop’s location the ETA is recalculated every 15 minutes
If the ETA is < 30 min out the stop’s location the ETA is recalculated every 5 minutes
HOW and truck-specific routes are not considered.
Learn more about how ETAs are calculated by reading this knowledge base article.
Updated about 2 hours ago