Assets: Vehicles, Trailers, and Equipment
Manage assets including vehicles, trailers, powered equipment, unpowered equipment, and more.
Beta
Asset API endpoints are in beta. Please reach out to your account team to enable them for your organization.
This guide explains how to manage various asset types—including vehicles, trailers, and equipment—using Samsara’s /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
/assets
EndpointsThe /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.
Note: 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
ornotes
(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
POST
request to the/assets
endpoint with a JSON payload that includes"type": "vehicle"
along with any other relevant vehicle data.
Example request
curl -X POST 'https://api.samsara.com/assets' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <TOKEN>" \
--data '{
"type": "vehicle",
"name": "New Truck",
"vin": "153YV5DN4EN811585",
"make": "FORD",
"model": "F-150",
"year": 2016,
"regulationMode": "regulated"
}'
Example response
{
"name": "New Truck",
"type": "vehicle",
"vin": "153YV5DN4EN811585",
"make": "FORD",
"model": "F-150",
"year": 2016,
"id": "281474994663039",
"createdAtTime": "2025-02-13T19:19:19Z",
"updatedAtTime": "2025-02-13T19:19:19Z"
}
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
name
ornotes
field accordingly.
Listing Vehicles
To list vehicles, use the List Assets endpoint. You can filter results to vehicles by using the type=vehicle
query parameter.
Example Request
curl -X GET 'https://api.samsara.com/assets?type=vehicle' \
--header "Authorization: Bearer <TOKEN>"
Example Response
{
"data": [
{
"name": "Truck",
"type": "vehicle",
"vin": "153YV5DN4EN811585",
"make": "FORD",
"model": "F-150",
"year": 2016,
"regulationMode": "regulated",
"id": "281474994182986",
"createdAtTime": "2025-01-17T20:57:42Z",
"updatedAtTime": "2025-01-27T19:31:43Z"
}
],
"pagination": {
"endCursor": "",
"hasNextPage": false
}
}
Pagination Note: Samsara returns up to 300 assets per page. Use the
after
query parameter with theendCursor
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 the ids
query parameter. You can also combine this with type=vehicle
for clarity.
Example Request
curl -X GET 'https://api.samsara.com/assets?type=vehicle&ids=281474994182986' \
--header "Authorization: Bearer <TOKEN>"
Example Response
{
"data": [
{
"name": "Truck",
"type": "vehicle",
"vin": "153YV5DN4EN811585",
"make": "FORD",
"model": "F-150",
"year": 2016,
"regulationMode": "regulated",
"id": "281474994182986",
"createdAtTime": "2025-01-17T20:57:42Z",
"updatedAtTime": "2025-01-27T19:31:43Z"
}
],
"pagination": {
"endCursor": "",
"hasNextPage": false
}
}
Updating a vehicle
To update vehicle properties (such as name
, licensePlate
, notes
, or externalIds
), use the Update an Asset endpoint (PATCH
). You must include the asset’s id
as a query parameter.
Example Request
curl -X PATCH 'https://api.samsara.com/assets?id=281474994182986' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <TOKEN>" \
--data '{
"name": "TMS Truck #123",
"licensePlate": "CA-123456",
"notes": "Retired from fleet on 2025-01-01"
}'
Example Response
{
"name": "TMS Truck #123",
"type": "vehicle",
"vin": "153YV5DN4EN811585",
"make": "FORD",
"model": "F-150",
"year": 2016,
"regulationMode": "regulated",
"id": "281474994182986",
"createdAtTime": "2025-01-17T20:57:42Z",
"updatedAtTime": "2025-01-27T21:45:00Z"
}
Other Asset Types
In addition to vehicles, you can create other asset types (such as trailers and equipment) using a POST
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
curl -X POST 'https://api.samsara.com/assets' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <TOKEN>" \
--data '{
"type": "trailer",
"name": "Flatbed #42",
"make": "Big Tex",
"model": "14OA-20"
}'
Example Response
{
"name": "Flatbed #42",
"type": "trailer",
"make": "Big Tex",
"model": "14OA-20",
"id": "281474994550668",
"createdAtTime": "2025-02-07T21:45:13Z",
"updatedAtTime": "2025-02-07T21:45:13Z"
}
Tip: Use the same
PATCH
endpoint (withid=<assetID>
) to update properties for trailers or other equipment at any time.
Updated 11 days ago