Skip to main content
PATCH
/
attributes
/
{id}
Update an attribute
curl --request PATCH \
  --url https://api.samsara.com/attributes/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "entityType": "asset",
  "attributeType": "single-select",
  "entities": [
    {
      "dateValues": [
        "2023-12-25"
      ],
      "entityId": "<string>",
      "externalIds": {
        "maintenanceId": "250020",
        "payrollId": "ABFS18600"
      },
      "numberValues": [
        123
      ],
      "stringValues": [
        "<string>"
      ]
    }
  ],
  "name": "License Certifications",
  "numberValues": [
    123
  ],
  "stringValues": [
    "<string>"
  ]
}
'
{
  "data": {
    "entities": [
      {
        "dateValues": [
          "<string>"
        ],
        "entityId": 123,
        "externalIds": {
          "maintenanceId": "250020",
          "payrollId": "ABFS18600"
        },
        "name": "<string>",
        "numberValues": [
          123
        ],
        "stringValues": [
          "<string>"
        ],
        "values": [
          {
            "id": "123e4567-e89b-12d3-a456-426614174000",
            "stringValue": "CDL"
          }
        ]
      }
    ],
    "attributeType": "single-select",
    "entityType": "asset",
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "License Certifications",
    "numberValues": [
      123
    ],
    "stringValues": [
      "<string>"
    ],
    "unit": "METER",
    "values": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "stringValue": "CDL"
      }
    ]
  }
}

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

Samsara-provided UUID of the attribute.

Body

application/json

The attribute to update.

A request body to update an Attribute.

entityType
enum<string>
required

Denotes the type of entity, driver or asset.

Available options:
driver,
asset
Example:

"asset"

attributeType
enum<string>
default:multi-select

Denotes the data type of the attribute's values. Valid values: single-select, multi-select, text, freeform-multi-select, number, date.

Available options:
single-select,
multi-select,
text,
freeform-multi-select,
number,
date
Example:

"single-select"

entities
object[]

Entities that will be applied to this attribute

name
string

Name

Example:

"License Certifications"

numberValues
number<double>[]

Number values that can be associated with this attribute

stringValues
string[]

String values that can be associated with this attribute

Response

Newly created attribute object with ID.

data
object