Industrial

Update an asset

Update an existing asset. Only the provided fields will be updated.

Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

To use this endpoint, select Write Equipment under the Equipment category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>

patch/industrial/assets/{id}

Request

  • Base URL
    https://api.samsara.com
  • Auth
    HTTP bearer

Path parameters

idstring required

Id of the asset to be updated

Request body

customMetadataCustomMetadata

The custom fields of an asset.

locationDataInputIdstring

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.

locationType'point' | 'address' | 'dataInput'

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

namestring

The name of the asset.

parentIdstring

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

runningStatusDataInputIdstring

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.

tagIdsstring[]

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

Example request

{
  "customMetadata": {
    "manufacturer": "Samsara",
    "serialNumber": "123ABC"
  },
  "location": {
    "formattedAddress": "350 Rhode Island St, San Francisco CA, 94103",
    "latitude": 37.765363,
    "longitude": -122.403098
  },
  "locationDataInputId": "12345",
  "runningStatusDataInputId": "67890",
  "tagIds": [
    "123"
  ]
}

Response

The updated asset

Example response

{
  "data": {
    "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"
      }
    ],
    "id": "123abcde-4567-8910-1112-fghi1314jklm",
    "location": {
      "formattedAddress": "350 Rhode Island St, San Francisco CA, 94103",
      "latitude": 37.765363,
      "longitude": -122.403098
    },
    "parentAsset": {
      "id": "123abcde-4567-8910-1112-fghi1314jklm"
    },
    "runningStatusDataInput": {
      "id": "12345"
    },
    "tags": [
      {
        "id": "3914",
        "name": "East Coast",
        "parentTagId": "4815"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.