The SafetyCulture API gives you the ability to list, add, update, and delete assets.
Asset format
This section describes the complete format of an asset.
Asset top level
Describes the top level details of an asset.
{
"id": "0c2100df-3206-4d41-bc08-2c960233114e",
"code": "0000443d-a0b0-4135-a9d5-88ff8baf371a",
"type": {
"name": "Car",
"type_id": "f0186762-7675-4628-8071-fd60d6d00613"
},
"fields": [
{
"name": "Brand",
"string_value": "Toyota",
"field_id": "ef1223ac-dfb5-11ec-9d64-0242ac120001"
},
],
"created_at": "2022-04-04T07:12:40.736163Z",
"modified_at": "2022-07-26T09:12:23.655252Z",
"site": {
"id": "cb4c0d0a-49b4-4a58-8b4d-3b28f2dc2fa5",
"name": "Sydney HQ"
},
"profile_image": {
"id": "026c6df5-c018-413e-aceb-5d4b9a2e842b",
"token": "1a38755ad36c62439cba05eb01afd74ac12b2b8df1fcf5f19c29768792c931c4",
"filename": "asset.jpeg",
"media_type": "MEDIA_TYPE_IMAGE"
},
"state": "ASSET_STATE_ACTIVE"
}
Key | Type | Description |
---|---|---|
id | string (UUID) | The unique identifier of an asset. This ID is system-generated. |
code | string | The user-defined unique identifier of an asset. This ID is user-generated. |
type | object | The asset type of an asset. |
fields | array | The associated fields of an asset contained in an array as objects. Each asset's fields are based on its asset type. |
site | object | The assigned site of an asset contained in an array. If an asset is not assigned to a site, the API will return nil . |
state | string | The indicator for whether an asset is active or archived. Refer to asset state for potential values. |
created_at | String (ISO8601) | The date created timestamp of an asset. |
modified_at | String (ISO8601) | The date last modified timetstamp of an asset. |
profile_image | object | The profile picture of an asset contained in an array. If an asset doesn't have a profile picture, the API will return nil . |
media | array | The attached media files of an asset contained in an array as objects. |
Asset type
Describes the values of an asset type.
{
"id": "ff1223ac-dfb5-11ec-9d64-0242ac120001",
"name": "Air compressor"
}
Key | Type | Description |
---|---|---|
type_id | string(UUID) | The unique identifier of an asset type. This ID is system-generated. |
name | string | The name of an asset type. |
Asset field
Describes the values of an asset field.
Key | Type | Description |
---|---|---|
field_id | string(UUID) | The unique identifier of an asset field. This ID is system-generated. |
name | string | The name of an asset field. |
string_value | string | The string value of an asset field. This attribute is only used for asset fields using the FIELD_VALUE_TYPE_STRING type. |
money_value | s12.common.Money | The money value of an asset field. This attribute is only used for asset fields using the FIELD_VALUE_TYPE_MONEY type. |
timestamp_value | Timestamp | The timestamp value of an asset field. This attribute is only used for asset fields using the FIELD_VALUE_TYPE_TIMESTAMP type. |
Asset site
Describes the values of a site that's assigned to an asset.
Key | Type | Description |
---|---|---|
id | string(UUID) | The unique identifier of a site. This ID is system-generated. |
name | string | The name of a site. |
Asset state
Describes the state of an asset. Either active or archived.
Name | Description |
---|---|
ASSET_STATE_ACTIVE | Indicates that an asset is active. |
ASSET_STATE_ARCHIVED | Indicates that an asset is archived. |
Asset field types
Describes each type of asset field.
Name | Description |
---|---|
FIELD_VALUE_TYPE_STRING | This type accepts plain text values. |
FIELD_VALUE_TYPE_MONEY | This type accepts numerical values with currency codes. For example, "99.99" numerical value with "AUD" as the currency code. |
FIELD_VALUE_TYPE_TIMESTAMP | This type accepts timestamp values in the ISO8601 format. |
Asset type fields
Describes the association between an asset type and an asset field.
Key | Type | Description |
---|---|---|
field_id | string(UUID) | The unique identifier of an asset field. This ID is system-generated. |
name | string | The name of an asset field. |
visible | boolean | The indicator for whether an asset field is visible for an asset type. A true value indicates that an asset field is associated with the retrieved asset type. A false value indicates otherwise. |