Skip to main content
PATCH
/
tags
/
{id}
Update a tag
curl --request PATCH \
  --url https://api.samsara.com/tags/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "addresses": [
    "23502866574"
  ],
  "assets": [
    "23502866574"
  ],
  "drivers": [
    "23502866574"
  ],
  "externalIds": {
    "maintenanceId": "250020",
    "payrollId": "ABFS18600"
  },
  "machines": [
    "23502866574"
  ],
  "name": "California",
  "parentTagId": "4815",
  "sensors": [
    "23502866574"
  ],
  "vehicles": [
    "23502866574"
  ]
}
'
{
  "data": {
    "id": "342417",
    "name": "California",
    "parentTagId": "4815",
    "addresses": [
      {
        "id": "23502866574",
        "name": "Driver Don"
      }
    ],
    "assets": [
      {
        "id": "23502866574",
        "name": "Driver Don"
      }
    ],
    "drivers": [
      {
        "id": "23502866574",
        "name": "Driver Don"
      }
    ],
    "externalIds": {
      "maintenanceId": "250020",
      "payrollId": "ABFS18600"
    },
    "machines": [
      {
        "id": "23502866574",
        "name": "Driver Don"
      }
    ],
    "parentTag": {
      "id": "23502866574",
      "name": "US West Vehicles"
    },
    "sensors": [
      {
        "id": "23502866574",
        "name": "Driver Don"
      }
    ],
    "vehicles": [
      {
        "id": "23502866574",
        "name": "Driver Don"
      }
    ]
  }
}

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 Tag. This can either be the Samsara-provided ID or an external ID. External IDs are customer-specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: key:value. For example, crmId:abc123. Automatically populated external IDs are prefixed with samsara.. For example, samsara.name:ELD-exempt.

Body

application/json
addresses
string[]

The addresses that belong to this tag.

The object ID.

assets
string[]

The trailers, unpowered, and powered assets that belong to this tag.

The object ID.

drivers
string[]

The drivers that belong to this tag.

The object ID.

externalIds
object

The external IDs for the given object.

Example:
{
"maintenanceId": "250020",
"payrollId": "ABFS18600"
}
machines
string[]

The machines that belong to this tag.

The object ID.

name
string

Name of this tag.

Required string length: 1 - 191
Example:

"California"

parentTagId
string

If this tag is part a hierarchical tag tree, this is the ID of the parent tag, otherwise this will be omitted.

Example:

"4815"

sensors
string[]

The sensors that belong to this tag.

The object ID.

vehicles
string[]

The vehicles that belong to this tag.

The object ID.

Response

Returns updated tag object.

A single tag.

data
object