Assets

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"
}

KeyTypeDescription
idstring (UUID)The unique identifier of an asset. This ID is system-generated.
codestringThe user-defined unique identifier of an asset. This ID is user-generated.
typeobjectThe asset type of an asset.
fieldsarrayThe associated fields of an asset contained in an array as objects. Each asset's fields are based on its asset type.
siteobjectThe assigned site of an asset contained in an array. If an asset is not assigned to a site, the API will return nil.
statestringThe indicator for whether an asset is active or archived. Refer to asset state for potential values.
created_atString (ISO8601)The date created timestamp of an asset.
modified_atString (ISO8601)The date last modified timetstamp of an asset.
profile_imageobjectThe profile picture of an asset contained in an array. If an asset doesn't have a profile picture, the API will return nil.
mediaarrayThe 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"
}
KeyTypeDescription
type_idstring(UUID)The unique identifier of an asset type. This ID is system-generated.
namestringThe name of an asset type.

Asset field

Describes the values of an asset field.

KeyTypeDescription
field_idstring(UUID)The unique identifier of an asset field. This ID is system-generated.
namestringThe name of an asset field.
string_valuestringThe string value of an asset field. This attribute is only used for asset fields using the FIELD_VALUE_TYPE_STRING type.
money_values12.common.MoneyThe money value of an asset field. This attribute is only used for asset fields using the FIELD_VALUE_TYPE_MONEY type.
timestamp_valueTimestampThe 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.

KeyTypeDescription
idstring(UUID)The unique identifier of a site. This ID is system-generated.
namestringThe name of a site.

Asset state

Describes the state of an asset. Either active or archived.

NameDescription
ASSET_STATE_ACTIVEIndicates that an asset is active.
ASSET_STATE_ARCHIVEDIndicates that an asset is archived.

Asset field types

Describes each type of asset field.

NameDescription
FIELD_VALUE_TYPE_STRINGThis type accepts plain text values.
FIELD_VALUE_TYPE_MONEYThis type accepts numerical values with currency codes. For example, "99.99" numerical value with "AUD" as the currency code.
FIELD_VALUE_TYPE_TIMESTAMPThis type accepts timestamp values in the ISO8601 format.

Asset type fields

Describes the association between an asset type and an asset field.

KeyTypeDescription
field_idstring(UUID)The unique identifier of an asset field. This ID is system-generated.
namestringThe name of an asset field.
visiblebooleanThe 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.