Creates a new attribute in the organization.
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.
To use this endpoint, select Write Attributes under the Setup & Administration category when creating or editing an API token. Learn More.
curl --request POST \
--url https://api.samsara.com/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributeType": "single-select",
"entityType": "asset",
"name": "License Certifications",
"entities": [
{
"dateValues": [
"2023-12-25"
],
"entityId": "<string>",
"externalIds": {
"maintenanceId": "250020",
"payrollId": "ABFS18600"
},
"numberValues": [
123
],
"stringValues": [
"<string>"
]
}
],
"numberValues": [
123
],
"stringValues": [
"<string>"
],
"unit": "METER"
}
'{
"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.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The attribute to create.
A request body to create an Attribute.
Denotes the data type of the attribute's values. Valid values: single-select, multi-select, text, freeform-multi-select, number, date.
single-select, multi-select, text, freeform-multi-select, number, date "single-select"
Denotes the type of entity, driver or asset.
driver, asset "asset"
Name
"License Certifications"
Entities that will be applied to this attribute
Show child attributes
Number values that can be associated with this attribute
String values that can be associated with this attribute
Unit of the attribute (only for Number attributes).
NO_UNIT, METER, POUND, TON, KILOGRAM, INCH, FOOT, GALLON, LITER, BARREL, POUND_PER_SQUARE_INCH, BAR, KILOPASCAL, FAHRENHEIT, CELSIUS, USD, CAD, EUR, GBP, MXN, HOUR, MINUTE, DAY, MILE_PER_HOUR, KILOMETER_PER_HOUR, HORSEPOWER, KILOWATT, BTU_PER_HOUR, KILOWATT_HOUR, BTU, HERTZ, REVOLUTION_PER_MINUTE, DECIBEL "METER"
Newly created attribute object with ID.
Show child attributes
curl --request POST \
--url https://api.samsara.com/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"attributeType": "single-select",
"entityType": "asset",
"name": "License Certifications",
"entities": [
{
"dateValues": [
"2023-12-25"
],
"entityId": "<string>",
"externalIds": {
"maintenanceId": "250020",
"payrollId": "ABFS18600"
},
"numberValues": [
123
],
"stringValues": [
"<string>"
]
}
],
"numberValues": [
123
],
"stringValues": [
"<string>"
],
"unit": "METER"
}
'{
"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"
}
]
}
}