Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Beta: Asset API endpoints are in beta. Please reach out to your account team to enable them for your organization.
/assets endpoints. You will learn how to list, create, retrieve, and update asset data.
Asset Types
- Vehicle – Examples include trucks, buses, etc.
- Trailer – Examples include dry vans, reefers, flatbeds, etc.
- Powered Equipment – Examples include dozers, cranes, etc.
- Unpowered Equipment – Examples include containers, dumpsters, ladders, etc.
- Uncategorized – Any other assets that do not fit the above categories
Working with the /assets Endpoints
The /assets endpoints provide a unified way to manage different types of assets. Whether you’re working with vehicles, trailers, or equipment, you can list, create, update, and manage these assets through a consistent API interface.
Once an asset is created, it remains in Samsara even if the underlying hardware is removed or moved. For vehicles, this is particularly important for maintaining historical data for compliance. Vehicle records cannot be deleted; if a vehicle is retired, mark it using fields such as
name or notes (for example, “Retired on 2025-01-01”).Vehicles
Creating Vehicles
There are two ways to create vehicles in Samsara:- Automatic Creation: Vehicles are automatically created when a Samsara Vehicle Gateway is activated.
- API Creation: You can also create a vehicle manually via the API. To do this, send a
POSTrequest to the/assetsendpoint with a JSON payload that includes"type": "vehicle"along with any other relevant vehicle data.
Automatic vs. API-Created Vehicles
Regardless of how a vehicle is created, once it exists in Samsara:- The vehicle record will persist, ensuring historical data is preserved.
- You cannot delete the vehicle record. Instead, if a vehicle is retired, update the
nameornotesfield accordingly.
Listing Vehicles
To list vehicles, use the List Assets endpoint. You can filter results to vehicles by using thetype=vehicle query parameter.
Example Request
Pagination Note: Samsara returns up to 300 assets per page. Use the
after query parameter with the endCursor value from the previous response to paginate through additional results. See Pagination for more details.Retrieving a vehicle
To retrieve details for a specific vehicle, use the List Assets endpoint with the vehicle’s ID passed via theids query parameter. You can also combine this with type=vehicle for clarity.
Example Request
Updating a vehicle
To update vehicle properties (such asname, licensePlate, notes, or externalIds), use the Update an Asset endpoint (PATCH). You must include the asset’s id as a query parameter.
Example Request
Other Asset Types
In addition to vehicles, you can create other asset types (such as trailers and equipment) using aPOST request to /assets. See the Create an asset documentation for a list of the supported asset types. In this example, we’ll create a new trailer asset.
Example request