Skip to main content
PATCH
/
industrial
/
assets
/
{id}
Update an asset
curl --request PATCH \
  --url https://api.samsara.com/industrial/assets/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customMetadata": {
    "manufacturer": "Samsara",
    "serialNumber": "123ABC"
  },
  "location": {
    "formattedAddress": "350 Rhode Island St, San Francisco CA, 94103",
    "latitude": 37.765363,
    "longitude": -122.403098
  },
  "locationDataInputId": "12345",
  "locationType": "point",
  "name": "<string>",
  "parentId": "",
  "runningStatusDataInputId": "67890",
  "tagIds": [
    "123"
  ]
}
'
{
  "data": {
    "id": "123abcde-4567-8910-1112-fghi1314jklm",
    "isRunning": true,
    "name": "<string>",
    "customMetadata": {
      "manufacturer": "Samsara",
      "serialNumber": "123ABC"
    },
    "dataOutputs": [
      {
        "dataGroup": "Control Pressure",
        "dataInput": {
          "dataGroup": "Pressure",
          "id": "123456",
          "lastPoint": {
            "time": "2020-01-27T07:06:25Z",
            "value": 1992.0506
          },
          "name": "Digital Input 1",
          "units": "PSI"
        },
        "deviceId": "123",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "Digital Output 1"
      }
    ],
    "location": {
      "formattedAddress": "350 Rhode Island St, San Francisco CA, 94103",
      "latitude": 37.765363,
      "longitude": -122.403098
    },
    "locationDataInput": {
      "id": "<string>"
    },
    "locationType": "point",
    "parentAsset": {
      "id": "123abcde-4567-8910-1112-fghi1314jklm",
      "name": "<string>"
    },
    "runningStatusDataInput": {
      "id": "12345"
    },
    "tags": [
      {
        "id": "3914",
        "name": "East Coast",
        "parentTagId": "4815"
      }
    ]
  }
}

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.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Id of the asset to be updated

Body

application/json

The updated asset fields

The asset creation arguments

customMetadata
object

The custom fields of an asset.

Example:
{
"manufacturer": "Samsara",
"serialNumber": "123ABC"
}
location
object

For locationType "point", latitude and longitude are required. For "address", formattedAddress must be provided, and lat/long can be optionally included for displaying a dot on the assets map. For "dataInput", this object should not be passed in.

locationDataInputId
string

Required if locationType is "dataInput". Specifies the id of a location data input which will determine the asset's location. The data input must be in the asset.

Example:

"12345"

locationType
enum<string>

The format of the location. This field is required if a location is provided. Valid values: point, address, dataInput.

Available options:
point,
address,
dataInput
name
string

The name of the asset.

parentId
string

The id of the parent asset that the asset belongs to. Pass in an empty string to remove the child from the parent.

Example:

""

runningStatusDataInputId
string

The asset's isRunning status will be true when the associated data input's value is 1. Data input cannot be of location format. The data input must be in the asset.

Example:

"67890"

tagIds
string[]

The ids of the tags that the asset should belong to.

Response

The updated asset

data
object

Asset